net: rps: skip fragment when computing rxhash
Subsystems (2)
PATCH 2/8 net: rps: skip fragment when computing rxhash
Fragmented IP packets may have no transfer header, so when computing rxhash, we should skip them.
Signed-off-by Changli Gao <[email protected]>
--- net/core/dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/dev.c +4 -1
@@ -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;
Quoted 13 lines · Changli Gao
Fragmented IP packets may have no transfer header, so when computing rxhash, we should skip them.
Signed-off-by Changli Gao <[email protected]>--- net/core/dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)net/core/dev.c +0
-0@@ -2284,7 +2284,10 @@ __u32 __skb_get_rxhash(struct sk_buff *skb) goto done;
net/core/dev.c __u32 __skb_get_rxhash(struct sk_buff *skb) · line 2293
Quoted 10 lines
net/core/dev.c +4
-1ip = (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 <[email protected]>
BTW, it is nicer to add some spaces :
if (ip->frag_off & htons(IP_MF | IP_OFFSET))
From: Eric Dumazet <[email protected]>
Date: Wed, 18 Aug 2010 08:25:01 +0200
Quoted 5 lines · Changli Gao
Quoted 4 lines
Fragmented IP packets may have no transfer header, so when computing rxhash, we should skip them.
Signed-off-by Changli Gao <[email protected]>
...
Quoted 1 line
Acked-by Eric Dumazet <[email protected]>
Applied.
Quoted 3 lines
BTW, it is nicer to add some spaces :
if (ip->frag_off & htons(IP_MF | IP_OFFSET))
I took care of this.