diff options
author | Jesse Gross <jesse@nicira.com> | 2010-10-29 12:14:54 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-15 09:22:53 -0800 |
commit | c8d5bcd1aff89199cde4bd82c5c40fb704c8bba4 (patch) | |
tree | 3447709cb98b3571881a5a6930d5dfc51f5d6dc6 /net/core | |
parent | e1e78db628b33c657944865e3bca01ee59cc5b80 (diff) | |
download | linux-c8d5bcd1aff89199cde4bd82c5c40fb704c8bba4.tar.bz2 |
offloading: Support multiple vlan tags in GSO.
We assume that hardware TSO can't support multiple levels of vlan tags
but we allow it to be done. Therefore, enable GSO to parse these tags
so we can fallback to software.
Signed-off-by: Jesse Gross <jesse@nicira.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 0b403d503311..368930a988e3 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1794,16 +1794,18 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); struct packet_type *ptype; __be16 type = skb->protocol; + int vlan_depth = ETH_HLEN; int err; - if (type == htons(ETH_P_8021Q)) { - struct vlan_ethhdr *veh; + while (type == htons(ETH_P_8021Q)) { + struct vlan_hdr *vh; - if (unlikely(!pskb_may_pull(skb, VLAN_ETH_HLEN))) + if (unlikely(!pskb_may_pull(skb, vlan_depth + VLAN_HLEN))) return ERR_PTR(-EINVAL); - veh = (struct vlan_ethhdr *)skb->data; - type = veh->h_vlan_encapsulated_proto; + vh = (struct vlan_hdr *)(skb->data + vlan_depth); + type = vh->h_vlan_encapsulated_proto; + vlan_depth += VLAN_HLEN; } skb_reset_mac_header(skb); |