@@ -2271,7 +2271,7 @@ static netdev_features_t xgbe_features_check(struct sk_buff *skb,
struct net_device *netdev,
netdev_features_t features)
{
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
features = vxlan_features_check(skb, features);
return features;
@@ -12856,7 +12856,7 @@ static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
!skb_gso_validate_mac_len(skb, 9700)))
features &= ~NETIF_F_GSO_MASK;
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
return vxlan_features_check(skb, features);
}
@@ -11097,7 +11097,7 @@ static netdev_features_t bnxt_features_check(struct sk_buff *skb,
struct bnxt *bp = netdev_priv(dev);
u8 *l4_proto;
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
switch (vlan_get_protocol(skb)) {
case htons(ETH_P_IP):
if (!skb->encapsulation)
@@ -5092,7 +5092,7 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
* Q-in-Q packets.
* Offload features for normal (non tunnel) packets are unchanged.
*/
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
if (!skb->encapsulation ||
!(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS))
return features;
@@ -2678,7 +2678,7 @@ static netdev_features_t mlx4_en_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
features = vxlan_features_check(skb, features);
/* The ConnectX-3 doesn't support outer IPv6 checksums but it does
@@ -3910,7 +3910,7 @@ netdev_features_t mlx5e_features_check(struct sk_buff *skb,
{
struct mlx5e_priv *priv = netdev_priv(netdev);
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
features = vxlan_features_check(skb, features);
/* Validate if the tunneled packet is being offloaded by HW */
@@ -3605,7 +3605,7 @@ nfp_net_features_check(struct sk_buff *skb, struct net_device *dev,
u8 l4_hdr;
/* We can't do TSO over double tagged packets (802.1AD) */
- features &= vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
if (!skb->encapsulation)
return features;
@@ -496,7 +496,7 @@ static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
return vxlan_features_check(skb, features);
}
@@ -1860,7 +1860,8 @@ static netdev_features_t cp_features_check(struct sk_buff *skb,
if (skb_shinfo(skb)->gso_size > MSSMask)
features &= ~NETIF_F_TSO;
- return vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
+ return features;
}
static const struct net_device_ops cp_netdev_ops = {
.ndo_open = cp_open,
@@ -4374,7 +4374,8 @@ static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
features &= ~NETIF_F_CSUM_MASK;
}
- return vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
+ return features;
}
static void rtl8169_pcierr_interrupt(struct net_device *dev)
@@ -3983,7 +3983,7 @@ static netdev_features_t lan78xx_features_check(struct sk_buff *skb,
if (skb->len + TX_OVERHEAD > MAX_SINGLE_PACKET_SIZE)
features &= ~NETIF_F_GSO_MASK;
- features = vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
features = vxlan_features_check(skb, features);
return features;
@@ -6998,7 +6998,8 @@ netdev_features_t qeth_features_check(struct sk_buff *skb,
features &= ~NETIF_F_SG;
}
- return vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
+ return features;
}
EXPORT_SYMBOL_GPL(qeth_features_check);
@@ -727,8 +727,8 @@ static inline bool skb_vlan_tagged_multi(struct sk_buff *skb)
*
* Returns features without unsafe ones if the skb has multiple tags.
*/
-static inline netdev_features_t vlan_features_check(struct sk_buff *skb,
- netdev_features_t features)
+static inline void vlan_features_check(struct sk_buff *skb,
+ netdev_features_t *features)
{
if (skb_vlan_tagged_multi(skb)) {
/* In the case of multi-tagged packets, use a direct mask
@@ -736,12 +736,10 @@ static inline netdev_features_t vlan_features_check(struct sk_buff *skb,
* sure that only devices supporting NETIF_F_HW_CSUM will
* have checksum offloading support.
*/
- features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
- NETIF_F_FRAGLIST | NETIF_F_HW_VLAN_CTAG_TX |
- NETIF_F_HW_VLAN_STAG_TX;
+ *features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
+ NETIF_F_FRAGLIST | NETIF_F_HW_VLAN_CTAG_TX |
+ NETIF_F_HW_VLAN_STAG_TX;
}
-
- return features;
}
/**
@@ -3484,7 +3484,8 @@ static netdev_features_t dflt_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{
- return vlan_features_check(skb, features);
+ vlan_features_check(skb, &features);
+ return features;
}
static void gso_features_check(const struct sk_buff *skb,
For the origin type for netdev_features_t would be changed to be unsigned long * from u64, so changes the prototype of vlan_features_check for adaption. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- drivers/net/ethernet/realtek/8139cp.c | 3 ++- drivers/net/ethernet/realtek/r8169_main.c | 3 ++- drivers/net/usb/lan78xx.c | 2 +- drivers/s390/net/qeth_core_main.c | 3 ++- include/linux/if_vlan.h | 12 +++++------- net/core/dev.c | 3 ++- 14 files changed, 22 insertions(+), 20 deletions(-)