diff options
author | Jesse Gross <jesse@nicira.com> | 2011-01-09 01:23:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 02:35:33 -0500 |
commit | f01a5236bd4b140198fbcc550f085e8361fd73fa (patch) | |
tree | 01d122dcd3aa7e8e1f84f11f74f5c30593a5f850 /include/linux | |
parent | 9497a0518e8183959e45da05f317f1cb36f2cd7c (diff) |
net offloading: Generalize netif_get_vlan_features().
netif_get_vlan_features() is currently only used by netif_needs_gso(),
so it only concerns itself with GSO features. However, several other
places also should take into account the contents of the packet when
deciding whether to offload to hardware. This generalizes the function
to return features about all of the various forms of offloading. Since
offloads tend to be linked together, this avoids duplicating the logic
in each location (i.e. the scatter/gather code also needs the checksum
logic).
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netdevice.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0f6b1c965815..d4dac09a5ad2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2303,7 +2303,7 @@ unsigned long netdev_fix_features(unsigned long features, const char *name); | |||
2303 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2303 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
2304 | struct net_device *dev); | 2304 | struct net_device *dev); |
2305 | 2305 | ||
2306 | int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev); | 2306 | int netif_skb_features(struct sk_buff *skb); |
2307 | 2307 | ||
2308 | static inline int net_gso_ok(int features, int gso_type) | 2308 | static inline int net_gso_ok(int features, int gso_type) |
2309 | { | 2309 | { |
@@ -2320,7 +2320,7 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features) | |||
2320 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 2320 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
2321 | { | 2321 | { |
2322 | if (skb_is_gso(skb)) { | 2322 | if (skb_is_gso(skb)) { |
2323 | int features = netif_get_vlan_features(skb, dev); | 2323 | int features = netif_skb_features(skb); |
2324 | 2324 | ||
2325 | return (!skb_gso_ok(skb, features) || | 2325 | return (!skb_gso_ok(skb, features) || |
2326 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 2326 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |