netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] Make simple TX hash little endian safe.
Date: Mon, 21 Jul 2008 12:32:15 +0000	[thread overview]
Message-ID: <20080721123215.GA4376@ff.dom.local> (raw)
In-Reply-To: <1216630088-10328-1-git-send-email-andi@firstfloor.org>

On 21-07-2008 10:48, Andi Kleen wrote:
> From: Andi Kleen <andi@basil.nowhere.org>
> 
> Currently it will not use the lower
> bits at all on big endian system, mapping e.g. all connections to a single
> queue on a local network which only differs in the low bits.

It seems ports could be treated similarly, btw?

Jarek P.

> 
> Also fold the upper 16 bits always in the lower 16bits.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  net/core/dev.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 2eed17b..c35fefc 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1694,8 +1694,11 @@ static u16 simple_tx_hash(struct net_device *dev, struct sk_buff *skb)
>  	ports = (u32 *) (skb_network_header(skb) + (ihl * 4));
>  
>  	hash = 0;
> -	while (alen--)
> -		hash ^= *addr++;
> +	while (alen--) {
> +		hash ^= ntohl(*addr); 
> +		addr++;
> +	}
> +	hash ^= hash >> 16; /* More folding needed? */
>  
>  	switch (ip_proto) {
>  	case IPPROTO_TCP:

  parent reply	other threads:[~2008-07-21 12:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21  8:48 [PATCH] Make simple TX hash little endian safe Andi Kleen
2008-07-21  8:48 ` [PATCH] Add a statistics counter for tx hash miss Andi Kleen
2008-07-21 16:33   ` David Miller
2008-07-21 16:44     ` Andi Kleen
2008-07-21 16:51       ` David Miller
2008-07-21 12:32 ` Jarek Poplawski [this message]
2008-07-21 15:17   ` [PATCH] Make simple TX hash little endian safe Andi Kleen
2008-07-21 16:44 ` David Miller
2008-07-21 17:20   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080721123215.GA4376@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).