diff mbox series

[RFCv2,net-next,007/167] net: convert the prototype of vxlan_features_check

Message ID 20210929155334.12454-8-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the netdev_features_t | expand

Commit Message

shenjian (K) Sept. 29, 2021, 3:50 p.m. UTC
For the origin type for netdev_features_t would be changed to
be unsigned long * from u64, so changes the prototype of
vxlan_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  |  3 ++-
 drivers/net/ethernet/cisco/enic/enic_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/qlogic/qlcnic/qlcnic_main.c  |  3 ++-
 drivers/net/usb/lan78xx.c                         |  2 +-
 include/net/vxlan.h                               | 13 ++++++-------
 8 files changed, 15 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 3fb15f675ddf..29bca9fabcde 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -2272,7 +2272,7 @@  static netdev_features_t xgbe_features_check(struct sk_buff *skb,
 					     netdev_features_t features)
 {
 	vlan_features_check(skb, &features);
-	features = vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
 
 	return features;
 }
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 105aae3e21bf..f444515452a5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12857,7 +12857,8 @@  static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
 		features &= ~NETIF_F_GSO_MASK;
 
 	vlan_features_check(skb, &features);
-	return vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
+	return features;
 }
 
 static int __bnx2x_vlan_configure_vid(struct bnx2x *bp, u16 vid, bool add)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 13dbdd5d07b4..558a07c5b4bc 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -253,7 +253,7 @@  static netdev_features_t enic_features_check(struct sk_buff *skb,
 	if (!skb->encapsulation)
 		return features;
 
-	features = vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
 
 	switch (vlan_get_protocol(skb)) {
 	case htons(ETH_P_IPV6):
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index a3c2a3e2d392..dd6a41182446 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2679,7 +2679,7 @@  static netdev_features_t mlx4_en_features_check(struct sk_buff *skb,
 						netdev_features_t features)
 {
 	vlan_features_check(skb, &features);
-	features = vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
 
 	/* The ConnectX-3 doesn't support outer IPv6 checksums but it does
 	 * support inner IPv6 checksums and segmentation so  we need to
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index b6aa5da06776..4518a490cdcd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3911,7 +3911,7 @@  netdev_features_t mlx5e_features_check(struct sk_buff *skb,
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 
 	vlan_features_check(skb, &features);
-	features = vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
 
 	/* Validate if the tunneled packet is being offloaded by HW */
 	if (skb->encapsulation &&
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 8f3a2a021082..d823f2a22472 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -497,7 +497,8 @@  static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
 					       netdev_features_t features)
 {
 	vlan_features_check(skb, &features);
-	return vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
+	return features;
 }
 
 static const struct net_device_ops qlcnic_netdev_ops = {
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index bf477ea4ac26..9bfee75cbaf1 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3984,7 +3984,7 @@  static netdev_features_t lan78xx_features_check(struct sk_buff *skb,
 		features &= ~NETIF_F_GSO_MASK;
 
 	vlan_features_check(skb, &features);
-	features = vxlan_features_check(skb, features);
+	vxlan_features_check(skb, &features);
 
 	return features;
 }
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 08537aa14f7c..a801e59e2313 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -296,13 +296,13 @@  struct vxlan_dev {
 struct net_device *vxlan_dev_create(struct net *net, const char *name,
 				    u8 name_assign_type, struct vxlan_config *conf);
 
-static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
-						     netdev_features_t features)
+static inline void vxlan_features_check(struct sk_buff *skb,
+					netdev_features_t *features)
 {
 	u8 l4_hdr = 0;
 
 	if (!skb->encapsulation)
-		return features;
+		return;
 
 	switch (vlan_get_protocol(skb)) {
 	case htons(ETH_P_IP):
@@ -312,7 +312,7 @@  static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
 		l4_hdr = ipv6_hdr(skb)->nexthdr;
 		break;
 	default:
-		return features;
+		return;
 	}
 
 	if ((l4_hdr == IPPROTO_UDP) &&
@@ -321,10 +321,9 @@  static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
 	     (skb_inner_mac_header(skb) - skb_transport_header(skb) !=
 	      sizeof(struct udphdr) + sizeof(struct vxlanhdr)) ||
 	     (skb->ip_summed != CHECKSUM_NONE &&
-	      !can_checksum_protocol(features, inner_eth_hdr(skb)->h_proto))))
-		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
+	      !can_checksum_protocol(*features, inner_eth_hdr(skb)->h_proto))))
+		*features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
 
-	return features;
 }
 
 /* IP header + UDP + VXLAN + Ethernet header */