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>
This commit is contained in:
committed by
David S. Miller
parent
9497a0518e
commit
f01a5236bd
@ -2303,7 +2303,7 @@ unsigned long netdev_fix_features(unsigned long features, const char *name);
|
||||
void netif_stacked_transfer_operstate(const struct net_device *rootdev,
|
||||
struct net_device *dev);
|
||||
|
||||
int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev);
|
||||
int netif_skb_features(struct sk_buff *skb);
|
||||
|
||||
static inline int net_gso_ok(int features, int gso_type)
|
||||
{
|
||||
@ -2320,7 +2320,7 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features)
|
||||
static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
|
||||
{
|
||||
if (skb_is_gso(skb)) {
|
||||
int features = netif_get_vlan_features(skb, dev);
|
||||
int features = netif_skb_features(skb);
|
||||
|
||||
return (!skb_gso_ok(skb, features) ||
|
||||
unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
|
||||
|
Reference in New Issue
Block a user