From: John Fastabend Date: Sat, 30 Oct 2010 14:22:32 +0000 (+0000) Subject: 8021q: set hard_header_len when VLAN offload features are toggled X-Git-Tag: MMI-PSA29.97-13-9~21446^2~583 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=029f5fc31cdb35d6c8a7fe9a54bf21556e175988;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 8021q: set hard_header_len when VLAN offload features are toggled Toggling the vlan tx|rx hw offloads needs to set the hard_header_len as well otherwise we end up using LL_RESERVED_SPACE incorrectly. This results in pskb_expand_head() being used unnecessarily. Signed-off-by: John Fastabend Acked-by: Jesse Gross Signed-off-by: David S. Miller --- diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 52077ca22072..55d2135889fc 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -334,6 +334,12 @@ static void vlan_transfer_features(struct net_device *dev, vlandev->features &= ~dev->vlan_features; vlandev->features |= dev->features & dev->vlan_features; vlandev->gso_max_size = dev->gso_max_size; + + if (dev->features & NETIF_F_HW_VLAN_TX) + vlandev->hard_header_len = dev->hard_header_len; + else + vlandev->hard_header_len = dev->hard_header_len + VLAN_HLEN; + #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid; #endif