FreeBSD/sys/dev/cxgbe/t4_main.c
/* Translates kernel hash types to hardware. */
Translates kernel hash types to hardware.
Translates kernel hash types to hardware .
static int
hashconfig_to_hashen(int hashconfig)
{
	int hashen = 0;
	if (hashconfig & RSS_HASHTYPE_RSS_IPV4)
		hashen |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN;
	if (hashconfig & RSS_HASHTYPE_RSS_IPV6)
		hashen |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN;
	if (hashconfig & RSS_HASHTYPE_RSS_UDP_IPV4) {
		hashen |= F_FW_RSS_VI_CONFIG_CMD_UDPEN |
		    F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN;
	}
	if (hashconfig & RSS_HASHTYPE_RSS_UDP_IPV6) {
		hashen |= F_FW_RSS_VI_CONFIG_CMD_UDPEN |
		    F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN;
	}
	if (hashconfig & RSS_HASHTYPE_RSS_TCP_IPV4)
		hashen |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN;
	if (hashconfig & RSS_HASHTYPE_RSS_TCP_IPV6)
		hashen |= F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN;
	return (hashen);
}
static int hashconfig_to_hashen ( int hashconfig ) { int hashen = 0 ; if ( hashconfig & RSS_HASHTYPE_RSS_IPV4 ) hashen |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN ; if ( hashconfig & RSS_HASHTYPE_RSS_IPV6 ) hashen |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN ; if ( hashconfig & RSS_HASHTYPE_RSS_UDP_IPV4 ) { hashen |= F_FW_RSS_VI_CONFIG_CMD_UDPEN | F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN ; } if ( hashconfig & RSS_HASHTYPE_RSS_UDP_IPV6 ) { hashen |= F_FW_RSS_VI_CONFIG_CMD_UDPEN | F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN ; } if ( hashconfig & RSS_HASHTYPE_RSS_TCP_IPV4 ) hashen |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN ; if ( hashconfig & RSS_HASHTYPE_RSS_TCP_IPV6 ) hashen |= F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN ; return ( hashen ) ; }
Translates kernel hash types to hardware.
Translates kernel hash types to hardware .