Netdev List
 help / color / mirror / Atom feed
From: Changli Gao <xiaosuo@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Changli Gao <xiaosuo@gmail.com>
Subject: [PATCH] net: use skb_get_rxhash()
Date: Tue, 24 Aug 2010 17:52:38 +0800	[thread overview]
Message-ID: <1282643558-20866-1-git-send-email-xiaosuo@gmail.com> (raw)

Although it is rare the line contains skb->rxhash is executed:

 * The forwarded skbs should have the the rx queue recoreded.
 * The local generated skbs should have non zero sk_hash in most of cases.

when it is executed, a non zero rxhash will be better.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 net/core/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 859e30f..ea041fd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2034,7 +2034,7 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
 	if (skb->sk && skb->sk->sk_hash)
 		hash = skb->sk->sk_hash;
 	else
-		hash = (__force u16) skb->protocol ^ skb->rxhash;
+		hash = (__force u16) skb->protocol ^ skb_get_rxhash(skb);
 	hash = jhash_1word(hash, hashrnd);
 
 	return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);

             reply	other threads:[~2010-08-24  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  9:52 Changli Gao [this message]
2010-08-24 10:21 ` [PATCH] net: use skb_get_rxhash() Eric Dumazet
2010-08-24 13:53   ` Changli Gao
2010-08-24 14:09     ` Eric Dumazet
2010-08-24 14:35       ` Changli Gao

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=1282643558-20866-1-git-send-email-xiaosuo@gmail.com \
    --to=xiaosuo@gmail.com \
    --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