Skip to content

Commit

Permalink
net: rps: support 802.1Q
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xiaosuo authored and davem330 committed Aug 19, 2011
1 parent 939cf30 commit 1ff1986
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2529,6 +2529,7 @@ void __skb_get_rxhash(struct sk_buff *skb)
int nhoff, hash = 0, poff;
const struct ipv6hdr *ip6;
const struct iphdr *ip;
const struct vlan_hdr *vlan;
u8 ip_proto;
u32 addr1, addr2;
u16 proto;
Expand Down Expand Up @@ -2565,6 +2566,13 @@ void __skb_get_rxhash(struct sk_buff *skb)
addr2 = (__force u32) ip6->daddr.s6_addr32[3];
nhoff += 40;
break;
case __constant_htons(ETH_P_8021Q):
if (!pskb_may_pull(skb, sizeof(*vlan) + nhoff))
goto done;
vlan = (const struct vlan_hdr *) (skb->data + nhoff);
proto = vlan->h_vlan_encapsulated_proto;
nhoff += sizeof(*vlan);
goto again;
default:
goto done;
}
Expand Down

0 comments on commit 1ff1986

Please sign in to comment.