diff options
author | Changli Gao <xiaosuo@gmail.com> | 2011-08-19 01:07:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-19 01:07:54 -0400 |
commit | 1ff1986fc94ee711df3cf19d45f2abf351436a6d (patch) | |
tree | 8301dc9db8afac2dcd7cc864ac1abd56657d6f27 /net/core | |
parent | 939cf3069d31a6e0e335eb5e08ef04895f2d013d (diff) |
net: rps: support 802.1Q
For the 802.1Q packets, if the NIC doesn't support hw-accel-vlan-rx, RPS
won't inspect the internal 4 tuples to generate skb->rxhash, so this kind
of traffic can't get any benefit from RPS.
This patch adds the support for 802.1Q to RPS.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ead0366ee1e4..be7ee506f17a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2529,6 +2529,7 @@ void __skb_get_rxhash(struct sk_buff *skb) | |||
2529 | int nhoff, hash = 0, poff; | 2529 | int nhoff, hash = 0, poff; |
2530 | const struct ipv6hdr *ip6; | 2530 | const struct ipv6hdr *ip6; |
2531 | const struct iphdr *ip; | 2531 | const struct iphdr *ip; |
2532 | const struct vlan_hdr *vlan; | ||
2532 | u8 ip_proto; | 2533 | u8 ip_proto; |
2533 | u32 addr1, addr2; | 2534 | u32 addr1, addr2; |
2534 | u16 proto; | 2535 | u16 proto; |
@@ -2565,6 +2566,13 @@ again: | |||
2565 | addr2 = (__force u32) ip6->daddr.s6_addr32[3]; | 2566 | addr2 = (__force u32) ip6->daddr.s6_addr32[3]; |
2566 | nhoff += 40; | 2567 | nhoff += 40; |
2567 | break; | 2568 | break; |
2569 | case __constant_htons(ETH_P_8021Q): | ||
2570 | if (!pskb_may_pull(skb, sizeof(*vlan) + nhoff)) | ||
2571 | goto done; | ||
2572 | vlan = (const struct vlan_hdr *) (skb->data + nhoff); | ||
2573 | proto = vlan->h_vlan_encapsulated_proto; | ||
2574 | nhoff += sizeof(*vlan); | ||
2575 | goto again; | ||
2568 | default: | 2576 | default: |
2569 | goto done; | 2577 | goto done; |
2570 | } | 2578 | } |