offloading: Force software GSO for multiple vlan tags.

We currently use vlan_features to check for TSO support if there is
a vlan tag.  However, it's quite likely that the NIC is not able to
do TSO when there is an arbitrary number of tags.  Therefore if there
is more than one tag (in-band or out-of-band), fall back to software
emulation.

Signed-off-by: Jesse Gross <jesse@nicira.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jesse Gross
2010-10-29 12:14:55 +00:00
committed by David S. Miller
parent c8d5bcd1af
commit 58e998c6d2
2 changed files with 19 additions and 4 deletions

View File

@ -1968,6 +1968,22 @@ static inline void skb_orphan_try(struct sk_buff *skb)
}
}
int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev)
{
__be16 protocol = skb->protocol;
if (protocol == htons(ETH_P_8021Q)) {
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
protocol = veh->h_vlan_encapsulated_proto;
} else if (!skb->vlan_tci)
return dev->features;
if (protocol != htons(ETH_P_8021Q))
return dev->features & dev->vlan_features;
else
return 0;
}
/*
* Returns true if either:
* 1. skb has frag_list and the device doesn't support FRAGLIST, or