FreeBSD/sys/dev/cxgbe/t4_main.c
/* Translates hardware hash types to kernel. */
Translates hardware hash types to kernel.
Translates hardware hash types to kernel .
static int
hashen_to_hashconfig(int hashen)
{
	int hashconfig = 0;
	if (hashen & F_FW_RSS_VI_CONFIG_CMD_UDPEN) {
		MPASS(hashen & (F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN |
		    F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN));
		if (hashen & F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
			hashconfig |= RSS_HASHTYPE_RSS_UDP_IPV4;
		if (hashen & F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
			hashconfig |= RSS_HASHTYPE_RSS_UDP_IPV6;
	}
	if (hashen & F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN)
		hashconfig |= RSS_HASHTYPE_RSS_TCP_IPV4;
	if (hashen & F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN)
		hashconfig |= RSS_HASHTYPE_RSS_TCP_IPV6;
	if (hashen & F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN)
		hashconfig |= RSS_HASHTYPE_RSS_IPV4;
	if (hashen & F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN)
		hashconfig |= RSS_HASHTYPE_RSS_IPV6;
	return (hashconfig);
}
static int hashen_to_hashconfig ( int hashen ) { int hashconfig = 0 ; if ( hashen & F_FW_RSS_VI_CONFIG_CMD_UDPEN ) { MPASS ( hashen & ( F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN ) ) ; if ( hashen & F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN ) hashconfig |= RSS_HASHTYPE_RSS_UDP_IPV4 ; if ( hashen & F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN ) hashconfig |= RSS_HASHTYPE_RSS_UDP_IPV6 ; } if ( hashen & F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN ) hashconfig |= RSS_HASHTYPE_RSS_TCP_IPV4 ; if ( hashen & F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN ) hashconfig |= RSS_HASHTYPE_RSS_TCP_IPV6 ; if ( hashen & F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN ) hashconfig |= RSS_HASHTYPE_RSS_IPV4 ; if ( hashen & F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN ) hashconfig |= RSS_HASHTYPE_RSS_IPV6 ; return ( hashconfig ) ; }
Translates hardware hash types to kernel.
Translates hardware hash types to kernel .
/*
		 * If UDP hashing was enabled it must have been enabled for
		 * either IPv4 or IPv6 (inclusive or).  Enabling UDP without
		 * enabling any 4-tuple hash is nonsense configuration.
		 */