diff options
author | Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> | 2015-03-27 14:31:12 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 13:33:22 -0700 |
commit | 8cb65d00086bfba22bac87ff18b751432fc74003 (patch) | |
tree | 93911010d1ed7f433b57456af85680c13bf227f8 /include/linux/if_vlan.h | |
parent | f5a7fb88e1f82542ca14ba93a1d4fa35471c60ca (diff) | |
download | linux-stable-8cb65d00086bfba22bac87ff18b751432fc74003.tar.gz linux-stable-8cb65d00086bfba22bac87ff18b751432fc74003.tar.bz2 linux-stable-8cb65d00086bfba22bac87ff18b751432fc74003.zip |
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 'include/linux/if_vlan.h')
-rw-r--r-- | include/linux/if_vlan.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 4265d440ec4d..920e4457ce6e 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -606,4 +606,26 @@ static inline bool skb_vlan_tagged_multi(const struct sk_buff *skb) return true; } +/** + * vlan_features_check - drop unsafe features for skb with multiple tags. + * @skb: skbuff to query + * @features: features to be checked + * + * Returns features without unsafe ones if the skb has multiple tags. + */ +static inline netdev_features_t vlan_features_check(const struct sk_buff *skb, + netdev_features_t features) +{ + 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); + + return features; +} + #endif /* !(_LINUX_IF_VLAN_H_) */ |