[PATCH net-next 07/14] net: hns3: modify macro hnae3_dev_hw_csum_supported

Guangbin Huang
2022-09-24T02:34:00Z

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

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

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index ed06f8db2a27..b802de61e63b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -125,8 +125,8 @@ enum HNAE3_DEV_CAP_BITS {
#define hnae3_ae_dev_int_ql_supported(ae_dev) \
test_bit(HNAE3_DEV_SUPPORT_INT_QL_B, (ae_dev)->caps)

-#define hnae3_dev_hw_csum_supported(hdev) \
- test_bit(HNAE3_DEV_SUPPORT_HW_TX_CSUM_B, (hdev)->ae_dev->caps)
+#define hnae3_ae_dev_hw_csum_supported(ae_dev) \
+ test_bit(HNAE3_DEV_SUPPORT_HW_TX_CSUM_B, (ae_dev)->caps)

#define hnae3_dev_tx_push_supported(hdev) \
test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_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 ede31db761b3..878c60d58061 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3323,7 +3323,7 @@ static void hns3_set_default_feature(struct net_device *netdev)
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))
+ if (hnae3_ae_dev_hw_csum_supported(ae_dev))
netdev->features |= NETIF_F_HW_CSUM;
else
netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
@@ -5235,7 +5235,7 @@ static void hns3_state_init(struct hnae3_handle *handle)
if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3)
set_bit(HNAE3_PFLAG_LIMIT_PROMISC, &handle->supported_pflags);

- if (test_bit(HNAE3_DEV_SUPPORT_HW_TX_CSUM_B, ae_dev->caps))
+ if (hnae3_ae_dev_hw_csum_supported(ae_dev))
set_bit(HNS3_NIC_STATE_HW_TX_CSUM_ENABLE, &priv->state);

if (hnae3_ae_dev_rxd_adv_layout_supported(ae_dev))
--
2.33.0