* [PATCH 2/8] net: rps: skip fragment when computing rxhash
@ 2010-08-18 5:01 Changli Gao
2010-08-18 6:25 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: Changli Gao @ 2010-08-18 5:01 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Changli Gao
Fragmented IP packets may have no transfer header, so when computing
rxhash, we should skip them.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
net/core/dev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 3f82781..b7c5309 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2284,7 +2284,10 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
goto done;
ip = (struct iphdr *) skb->data + nhoff;
- ip_proto = ip->protocol;
+ if (ip->frag_off & htons(IP_MF|IP_OFFSET))
+ ip_proto = 0;
+ else
+ ip_proto = ip->protocol;
addr1 = (__force u32) ip->saddr;
addr2 = (__force u32) ip->daddr;
ihl = ip->ihl;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/8] net: rps: skip fragment when computing rxhash
2010-08-18 5:01 [PATCH 2/8] net: rps: skip fragment when computing rxhash Changli Gao
@ 2010-08-18 6:25 ` Eric Dumazet
2010-08-20 0:11 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-08-18 6:25 UTC (permalink / raw)
To: Changli Gao; +Cc: David S. Miller, netdev
Le mercredi 18 août 2010 à 13:01 +0800, Changli Gao a écrit :
> Fragmented IP packets may have no transfer header, so when computing
> rxhash, we should skip them.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ---
> net/core/dev.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 3f82781..b7c5309 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2284,7 +2284,10 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
> goto done;
>
> ip = (struct iphdr *) skb->data + nhoff;
> - ip_proto = ip->protocol;
> + if (ip->frag_off & htons(IP_MF|IP_OFFSET))
> + ip_proto = 0;
> + else
> + ip_proto = ip->protocol;
> addr1 = (__force u32) ip->saddr;
> addr2 = (__force u32) ip->daddr;
> ihl = ip->ihl;
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
BTW, it is nicer to add some spaces :
if (ip->frag_off & htons(IP_MF | IP_OFFSET))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/8] net: rps: skip fragment when computing rxhash
2010-08-18 6:25 ` Eric Dumazet
@ 2010-08-20 0:11 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-08-20 0:11 UTC (permalink / raw)
To: eric.dumazet; +Cc: xiaosuo, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 18 Aug 2010 08:25:01 +0200
> Le mercredi 18 août 2010 à 13:01 +0800, Changli Gao a écrit :
>> Fragmented IP packets may have no transfer header, so when computing
>> rxhash, we should skip them.
>>
>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
...
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
> BTW, it is nicer to add some spaces :
>
> if (ip->frag_off & htons(IP_MF | IP_OFFSET))
I took care of this.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-20 0:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-18 5:01 [PATCH 2/8] net: rps: skip fragment when computing rxhash Changli Gao
2010-08-18 6:25 ` Eric Dumazet
2010-08-20 0:11 ` David Miller
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).