[PATCH net-next 02/14] net: hns3: modify macro hnae3_dev_udp_gso_supported

From: Guangbin Huang
Date: Fri Sep 23 2022 - 22:33:28 EST


Redefine macro hnae3_dev_udp_gso_supported(hdev) to
hnae3_ae_dev_udp_gso_supported(ae_dev), so it can be
used in both hclge and hns3_enet layer.

Signed-off-by: Guangbin Huang <huangguangbin2@xxxxxxxxxx>
---
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 4 ++--
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 21308c5e280b..3bc3fc528ed9 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -110,8 +110,8 @@ enum HNAE3_DEV_CAP_BITS {
#define hnae3_ae_dev_fec_supported(ae_dev) \
test_bit(HNAE3_DEV_SUPPORT_FEC_B, (ae_dev)->caps)

-#define hnae3_dev_udp_gso_supported(hdev) \
- test_bit(HNAE3_DEV_SUPPORT_UDP_GSO_B, (hdev)->ae_dev->caps)
+#define hnae3_ae_dev_udp_gso_supported(ae_dev) \
+ test_bit(HNAE3_DEV_SUPPORT_UDP_GSO_B, (ae_dev)->caps)

#define hnae3_dev_qb_supported(hdev) \
test_bit(HNAE3_DEV_SUPPORT_QB_B, (hdev)->ae_dev->caps)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 39b75b68474c..9e4935a90c8b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3320,7 +3320,7 @@ static void hns3_set_default_feature(struct net_device *netdev)
if (hnae3_ae_dev_fd_supported(ae_dev))
netdev->features |= NETIF_F_NTUPLE;

- if (test_bit(HNAE3_DEV_SUPPORT_UDP_GSO_B, ae_dev->caps))
+ if (hnae3_ae_dev_udp_gso_supported(ae_dev))
netdev->features |= NETIF_F_GSO_UDP_L4;

if (test_bit(HNAE3_DEV_SUPPORT_HW_TX_CSUM_B, ae_dev->caps))
--
2.33.0