src/dpdk/drivers/net/ixgbe/base/ixgbe_82599.c
void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
					   union ixgbe_atr_hash_dword input,
					   union ixgbe_atr_hash_dword common,
					   u8 queue)
{
	u64 fdirhashcmd;
	u8 flow_type;
	bool tunnel;
	u32 fdircmd;

	DEBUGFUNC("ixgbe_fdir_add_signature_filter_82599");

	/*
	 * Get the flow_type in order to program FDIRCMD properly
	 * lowest 2 bits are FDIRCMD.L4TYPE, third lowest bit is FDIRCMD.IPV6
	 * fifth is FDIRCMD.TUNNEL_FILTER
	 */
	tunnel = !!(input.formatted.flow_type & IXGBE_ATR_L4TYPE_TUNNEL_MASK);
	flow_type = input.formatted.flow_type &
		    (IXGBE_ATR_L4TYPE_TUNNEL_MASK - 1);
	switch (flow_type) {
	case IXGBE_ATR_FLOW_TYPE_TCPV4:
	case IXGBE_ATR_FLOW_TYPE_UDPV4:
	case IXGBE_ATR_FLOW_TYPE_SCTPV4:
	case IXGBE_ATR_FLOW_TYPE_TCPV6:
	case IXGBE_ATR_FLOW_TYPE_UDPV6:
	case IXGBE_ATR_FLOW_TYPE_SCTPV6:
		break;
	default:
		DEBUGOUT(" Error on flow type input\n");
		return;
	}

	/* configure FDIRCMD register */
	fdircmd = IXGBE_FDIRCMD_CMD_ADD_FLOW | IXGBE_FDIRCMD_FILTER_UPDATE |
		  IXGBE_FDIRCMD_LAST | IXGBE_FDIRCMD_QUEUE_EN;
	fdircmd |= (u32)flow_type << IXGBE_FDIRCMD_FLOW_TYPE_SHIFT;
	fdircmd |= (u32)queue << IXGBE_FDIRCMD_RX_QUEUE_SHIFT;
	if (tunnel)
		fdircmd |= IXGBE_FDIRCMD_TUNNEL_FILTER;

	/*
	 * The lower 32-bits of fdirhashcmd is for FDIRHASH, the upper 32-bits
	 * is for FDIRCMD.  Then do a 64-bit register write from FDIRHASH.
	 */
	fdirhashcmd = (u64)fdircmd << 32;
	fdirhashcmd |= (u64)ixgbe_atr_compute_sig_hash_82599(input, common);
	IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd);

	DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd);

	return;
}
/**
 * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter
 * @hw: pointer to hardware structure
 * @input: unique input dword
 * @common: compressed common input dword
 * @queue: queue index to direct traffic to
 *
 * Note that the tunnel bit in input must not be set when the hardware
 * tunneling support does not exist.
 **/
Adds a signature hash filter
@hw: pointer to hardware structure
@input: unique input dword
@common: compressed common input dword
@queue: queue index to direct traffic to

Note that the tunnel bit in input must not be set when the hardware
tunneling support does not exist.
Adds a signature hash filter @hw : pointer to hardware structure @input : unique input dword @common : compressed common input dword @queue : queue index to direct traffic to Note that the tunnel bit in input must not be set when the hardware tunneling support does not exist .
void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
					   union ixgbe_atr_hash_dword input,
					   union ixgbe_atr_hash_dword common,
					   u8 queue)
{
	u64 fdirhashcmd;
	u8 flow_type;
	bool tunnel;
	u32 fdircmd;
	DEBUGFUNC("ixgbe_fdir_add_signature_filter_82599");
	tunnel = !!(input.formatted.flow_type & IXGBE_ATR_L4TYPE_TUNNEL_MASK);
	flow_type = input.formatted.flow_type &
		    (IXGBE_ATR_L4TYPE_TUNNEL_MASK - 1);
	switch (flow_type) {
	case IXGBE_ATR_FLOW_TYPE_TCPV4:
	case IXGBE_ATR_FLOW_TYPE_UDPV4:
	case IXGBE_ATR_FLOW_TYPE_SCTPV4:
	case IXGBE_ATR_FLOW_TYPE_TCPV6:
	case IXGBE_ATR_FLOW_TYPE_UDPV6:
	case IXGBE_ATR_FLOW_TYPE_SCTPV6:
		break;
	default:
		DEBUGOUT(" Error on flow type input\n");
		return;
	}
	fdircmd = IXGBE_FDIRCMD_CMD_ADD_FLOW | IXGBE_FDIRCMD_FILTER_UPDATE |
		  IXGBE_FDIRCMD_LAST | IXGBE_FDIRCMD_QUEUE_EN;
	fdircmd |= (u32)flow_type << IXGBE_FDIRCMD_FLOW_TYPE_SHIFT;
	fdircmd |= (u32)queue << IXGBE_FDIRCMD_RX_QUEUE_SHIFT;
	if (tunnel)
		fdircmd |= IXGBE_FDIRCMD_TUNNEL_FILTER;
	fdirhashcmd = (u64)fdircmd << 32;
	fdirhashcmd |= (u64)ixgbe_atr_compute_sig_hash_82599(input, common);
	IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd);
	DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd);
	return;
}
void ixgbe_fdir_add_signature_filter_82599 ( struct ixgbe_hw * hw , union ixgbe_atr_hash_dword input , union ixgbe_atr_hash_dword common , u8 queue ) { u64 fdirhashcmd ; u8 flow_type ; bool tunnel ; u32 fdircmd ; DEBUGFUNC ( " " ) ; tunnel = ! ! ( input . formatted . flow_type & IXGBE_ATR_L4TYPE_TUNNEL_MASK ) ; flow_type = input . formatted . flow_type & ( IXGBE_ATR_L4TYPE_TUNNEL_MASK - 1 ) ; switch ( flow_type ) { case IXGBE_ATR_FLOW_TYPE_TCPV4 : case IXGBE_ATR_FLOW_TYPE_UDPV4 : case IXGBE_ATR_FLOW_TYPE_SCTPV4 : case IXGBE_ATR_FLOW_TYPE_TCPV6 : case IXGBE_ATR_FLOW_TYPE_UDPV6 : case IXGBE_ATR_FLOW_TYPE_SCTPV6 : break ; default : DEBUGOUT ( " \n " ) ; return ; } fdircmd = IXGBE_FDIRCMD_CMD_ADD_FLOW | IXGBE_FDIRCMD_FILTER_UPDATE | IXGBE_FDIRCMD_LAST | IXGBE_FDIRCMD_QUEUE_EN ; fdircmd |= ( u32 ) flow_type << IXGBE_FDIRCMD_FLOW_TYPE_SHIFT ; fdircmd |= ( u32 ) queue << IXGBE_FDIRCMD_RX_QUEUE_SHIFT ; if ( tunnel ) fdircmd |= IXGBE_FDIRCMD_TUNNEL_FILTER ; fdirhashcmd = ( u64 ) fdircmd << 32 ; fdirhashcmd |= ( u64 ) ixgbe_atr_compute_sig_hash_82599 ( input , common ) ; IXGBE_WRITE_REG64 ( hw , IXGBE_FDIRHASH , fdirhashcmd ) ; DEBUGOUT2 ( " \n " , queue , ( u32 ) fdirhashcmd ) ; return ; }
ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter
 @hw: pointer to hardware structure
 @input: unique input dword
 @common: compressed common input dword
 @queue: queue index to direct traffic to
ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter @hw : pointer to hardware structure @input : unique input dword @common : compressed common input dword @queue : queue index to direct traffic to
/*
	 * Get the flow_type in order to program FDIRCMD properly
	 * lowest 2 bits are FDIRCMD.L4TYPE, third lowest bit is FDIRCMD.IPV6
	 * fifth is FDIRCMD.TUNNEL_FILTER
	 */ /* configure FDIRCMD register */ /*
	 * The lower 32-bits of fdirhashcmd is for FDIRHASH, the upper 32-bits
	 * is for FDIRCMD.  Then do a 64-bit register write from FDIRHASH.
	 */