aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2010-10-20 09:56:04 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-21 04:26:52 -0400
commit7b9c60903714bf0a19d746b228864bad3497284e (patch)
treec9dd632ea640b1f56634de8a1f029dd88dea2599 /include
parenteab6d18d20fc5b5ba04a7e7fcd6f357197870e51 (diff)
vlan: Enable software emulation for vlan accleration.
Currently users of hardware vlan accleration need to know whether the device supports it before generating packets. However, vlan acceleration will soon be available in a more flexible manner so knowing ahead of time becomes much more difficult. This adds a software fallback path for vlan packets on devices without the necessary offloading support, similar to other types of hardware accleration. Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 880d56565828..2861565a27d9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2248,9 +2248,17 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features)
2248 2248
2249static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 2249static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
2250{ 2250{
2251 return skb_is_gso(skb) && 2251 if (skb_is_gso(skb)) {
2252 (!skb_gso_ok(skb, dev->features) || 2252 int features = dev->features;
2253 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 2253
2254 if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci)
2255 features &= dev->vlan_features;
2256
2257 return (!skb_gso_ok(skb, features) ||
2258 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
2259 }
2260
2261 return 0;
2254} 2262}
2255 2263
2256static inline void netif_set_gso_max_size(struct net_device *dev, 2264static inline void netif_set_gso_max_size(struct net_device *dev,