[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929155334.12454-34-shenjian15@huawei.com>
Date: Wed, 29 Sep 2021 23:51:20 +0800
From: Jian Shen <shenjian15@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <andrew@...n.ch>,
<hkallweit1@...il.com>
CC: <netdev@...r.kernel.org>, <linuxarm@...neuler.org>
Subject: [RFCv2 net-next 033/167] net: geneve: use netdev feature helpers
Use netdev_feature_xxx helpers to replace the logical operation
for netdev features.
Signed-off-by: Jian Shen <shenjian15@...wei.com>
---
drivers/net/geneve.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 1ab94b5f9bbf..d2179c103300 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1219,14 +1219,16 @@ static void geneve_setup(struct net_device *dev)
SET_NETDEV_DEVTYPE(dev, &geneve_type);
- dev->features |= NETIF_F_LLTX;
- dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
- dev->features |= NETIF_F_RXCSUM;
- dev->features |= NETIF_F_GSO_SOFTWARE;
-
- dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST;
- dev->hw_features |= NETIF_F_RXCSUM;
- dev->hw_features |= NETIF_F_GSO_SOFTWARE;
+ netdev_feature_set_bit(NETIF_F_LLTX_BIT, &dev->features);
+ netdev_feature_set_bits(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST,
+ &dev->features);
+ netdev_feature_set_bit(NETIF_F_RXCSUM_BIT, &dev->features);
+ netdev_feature_set_bits(NETIF_F_GSO_SOFTWARE, &dev->features);
+
+ netdev_feature_set_bits(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_FRAGLIST,
+ &dev->hw_features);
+ netdev_feature_set_bit(NETIF_F_RXCSUM_BIT, &dev->hw_features);
+ netdev_feature_set_bits(NETIF_F_GSO_SOFTWARE, &dev->hw_features);
/* MTU range: 68 - (something less than 65535) */
dev->min_mtu = ETH_MIN_MTU;
--
2.33.0
Powered by blists - more mailing lists