lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220918094336.28958-22-shenjian15@huawei.com>
Date:   Sun, 18 Sep 2022 09:43:02 +0000
From:   Jian Shen <shenjian15@...wei.com>
To:     <davem@...emloft.net>, <kuba@...nel.org>, <ecree.xilinx@...il.com>,
        <andrew@...n.ch>, <hkallweit1@...il.com>,
        <alexandr.lobakin@...el.com>, <saeed@...nel.org>, <leon@...nel.org>
CC:     <netdev@...r.kernel.org>, <linuxarm@...wei.com>
Subject: [RFCv8 PATCH net-next 21/55] net: iavf: adjust net device features relative macroes

The macro IAVF_NETDEV_VLAN_FEATURE_ALLOWED use NETIF_F_XXX as
parameter directly, change it to use NETIF_F_XXX_BIT, for all
the macroes NETIF_F_XXX will be removed later.

Signed-off-by: Jian Shen <shenjian15@...wei.com>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 39fbfe6e18e9..31d4825c8a6c 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -4601,8 +4601,8 @@ iavf_get_netdev_vlan_features(struct iavf_adapter *adapter)
 }
 
 #define IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested, allowed, feature_bit) \
-	(!(((requested) & (feature_bit)) && \
-	   !((allowed) & (feature_bit))))
+	(!(netdev_feature_test(feature_bit, requested) && \
+	   !netdev_feature_test(feature_bit, allowed)))
 
 /**
  * iavf_fix_netdev_vlan_features - fix NETDEV VLAN features based on support
@@ -4620,31 +4620,31 @@ iavf_fix_netdev_vlan_features(struct iavf_adapter *adapter,
 
 	if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
 					      allowed_features,
-					      NETIF_F_HW_VLAN_CTAG_TX))
+					      NETIF_F_HW_VLAN_CTAG_TX_BIT))
 		requested_features &= ~NETIF_F_HW_VLAN_CTAG_TX;
 
 	if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
 					      allowed_features,
-					      NETIF_F_HW_VLAN_CTAG_RX))
+					      NETIF_F_HW_VLAN_CTAG_RX_BIT))
 		requested_features &= ~NETIF_F_HW_VLAN_CTAG_RX;
 
 	if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
 					      allowed_features,
-					      NETIF_F_HW_VLAN_STAG_TX))
+					      NETIF_F_HW_VLAN_STAG_TX_BIT))
 		requested_features &= ~NETIF_F_HW_VLAN_STAG_TX;
 	if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
 					      allowed_features,
-					      NETIF_F_HW_VLAN_STAG_RX))
+					      NETIF_F_HW_VLAN_STAG_RX_BIT))
 		requested_features &= ~NETIF_F_HW_VLAN_STAG_RX;
 
 	if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
 					      allowed_features,
-					      NETIF_F_HW_VLAN_CTAG_FILTER))
+					      NETIF_F_HW_VLAN_CTAG_FILTER_BIT))
 		requested_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
 
 	if (!IAVF_NETDEV_VLAN_FEATURE_ALLOWED(requested_features,
 					      allowed_features,
-					      NETIF_F_HW_VLAN_STAG_FILTER))
+					      NETIF_F_HW_VLAN_STAG_FILTER_BIT))
 		requested_features &= ~NETIF_F_HW_VLAN_STAG_FILTER;
 
 	if ((requested_features & netdev_ctag_vlan_offload_features) &&
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ