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>
This commit is contained in:

committed by
David S. Miller

parent
f5a7fb88e1
commit
8cb65d0008
@@ -2562,6 +2562,13 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
|
||||
return features;
|
||||
}
|
||||
|
||||
static netdev_features_t dflt_features_check(const struct sk_buff *skb,
|
||||
struct net_device *dev,
|
||||
netdev_features_t features)
|
||||
{
|
||||
return vlan_features_check(skb, features);
|
||||
}
|
||||
|
||||
netdev_features_t netif_skb_features(struct sk_buff *skb)
|
||||
{
|
||||
struct net_device *dev = skb->dev;
|
||||
@@ -2583,22 +2590,12 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
|
||||
dev->vlan_features |
|
||||
NETIF_F_HW_VLAN_CTAG_TX |
|
||||
NETIF_F_HW_VLAN_STAG_TX);
|
||||
else
|
||||
goto finalize;
|
||||
|
||||
if (skb_vlan_tagged_multi(skb))
|
||||
features = netdev_intersect_features(features,
|
||||
NETIF_F_SG |
|
||||
NETIF_F_HIGHDMA |
|
||||
NETIF_F_FRAGLIST |
|
||||
NETIF_F_GEN_CSUM |
|
||||
NETIF_F_HW_VLAN_CTAG_TX |
|
||||
NETIF_F_HW_VLAN_STAG_TX);
|
||||
|
||||
finalize:
|
||||
if (dev->netdev_ops->ndo_features_check)
|
||||
features &= dev->netdev_ops->ndo_features_check(skb, dev,
|
||||
features);
|
||||
else
|
||||
features &= dflt_features_check(skb, dev, features);
|
||||
|
||||
return harmonize_features(skb, features);
|
||||
}
|
||||
|
Reference in New Issue
Block a user