Subject: Re: [PATCH] Software receive packet steering

From: Stephen Hemminger <[email-masked]>
Date: Wed, 8 Apr 2009 16:08:42 -0700

On Wed, 8 Apr 2009 15:48:12 -0700
Tom Herbert <[email-masked]> wrote:

> 	if (skb->protocol == __constant_htons(ETH_P_IP)) {
> +		struct iphdr *iph = (struct iphdr *)skb->data;
> +		__be16 *layer4hdr = (__be16 *)((u32 *)iph + iph->ihl);
> +
> +		hash = 0;
> +		if (!(iph->frag_off &
> +		      __constant_htons(IP_MF|IP_OFFSET)) &&
> +		    ((iph->protocol == IPPROTO_TCP) ||
> +		     (iph->protocol == IPPROTO_UDP)))
> +			hash = ntohs(*layer4hdr ^ *(layer4hdr + 1));
> +
> +		hash ^= (ntohl(iph->saddr ^ iph->daddr)) & 0xffff;
> +		goto got_hash;

The hash could should be same as existing Tx hash?

What about using hardware RSS values?