diff options
author | Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> | 2015-03-27 01:31:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 16:33:22 -0400 |
commit | 8cb65d00086bfba22bac87ff18b751432fc74003 (patch) | |
tree | 93911010d1ed7f433b57456af85680c13bf227f8 /net/core | |
parent | f5a7fb88e1f82542ca14ba93a1d4fa35471c60ca (diff) |
net: Move check for multiple vlans to drivers
To allow drivers to handle the features check for multiple tags,
move the check to ndo_features_check().
As no drivers currently handle multiple tagged TSO, introduce
dflt_features_check() and call it if the driver does not have
ndo_features_check().
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 04bffcd4a48d..cb46badbef5a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2562,6 +2562,13 @@ static netdev_features_t harmonize_features(struct sk_buff *skb, | |||
2562 | return features; | 2562 | return features; |
2563 | } | 2563 | } |
2564 | 2564 | ||
2565 | static netdev_features_t dflt_features_check(const struct sk_buff *skb, | ||
2566 | struct net_device *dev, | ||
2567 | netdev_features_t features) | ||
2568 | { | ||
2569 | return vlan_features_check(skb, features); | ||
2570 | } | ||
2571 | |||
2565 | netdev_features_t netif_skb_features(struct sk_buff *skb) | 2572 | netdev_features_t netif_skb_features(struct sk_buff *skb) |
2566 | { | 2573 | { |
2567 | struct net_device *dev = skb->dev; | 2574 | struct net_device *dev = skb->dev; |
@@ -2583,22 +2590,12 @@ netdev_features_t netif_skb_features(struct sk_buff *skb) | |||
2583 | dev->vlan_features | | 2590 | dev->vlan_features | |
2584 | NETIF_F_HW_VLAN_CTAG_TX | | 2591 | NETIF_F_HW_VLAN_CTAG_TX | |
2585 | NETIF_F_HW_VLAN_STAG_TX); | 2592 | NETIF_F_HW_VLAN_STAG_TX); |
2586 | else | ||
2587 | goto finalize; | ||
2588 | 2593 | ||
2589 | if (skb_vlan_tagged_multi(skb)) | ||
2590 | features = netdev_intersect_features(features, | ||
2591 | NETIF_F_SG | | ||
2592 | NETIF_F_HIGHDMA | | ||
2593 | NETIF_F_FRAGLIST | | ||
2594 | NETIF_F_GEN_CSUM | | ||
2595 | NETIF_F_HW_VLAN_CTAG_TX | | ||
2596 | NETIF_F_HW_VLAN_STAG_TX); | ||
2597 | |||
2598 | finalize: | ||
2599 | if (dev->netdev_ops->ndo_features_check) | 2594 | if (dev->netdev_ops->ndo_features_check) |
2600 | features &= dev->netdev_ops->ndo_features_check(skb, dev, | 2595 | features &= dev->netdev_ops->ndo_features_check(skb, dev, |
2601 | features); | 2596 | features); |
2597 | else | ||
2598 | features &= dflt_features_check(skb, dev, features); | ||
2602 | 2599 | ||
2603 | return harmonize_features(skb, features); | 2600 | return harmonize_features(skb, features); |
2604 | } | 2601 | } |