[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220924023024.14219-5-huangguangbin2@huawei.com>
Date: Sat, 24 Sep 2022 10:30:14 +0800
From: Guangbin Huang <huangguangbin2@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>
CC: <edumazet@...gle.com>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<huangguangbin2@...wei.com>, <lipeng321@...wei.com>,
<lanhao@...wei.com>
Subject: [PATCH net-next 04/14] net: hns3: modify macro hnae3_dev_fd_forward_tc_supported
Redefine macro hnae3_dev_fd_forward_tc_supported(hdev) to
hnae3_ae_dev_fd_forward_tc_supported(ae_dev), so it can be
used in both hclge and hns3_enet layer.
Signed-off-by: Guangbin Huang <huangguangbin2@...wei.com>
---
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 4 ++--
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +-
3 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 60e06c7be32d..60fda66e08bd 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -116,8 +116,8 @@ enum HNAE3_DEV_CAP_BITS {
#define hnae3_ae_dev_qb_supported(ae_dev) \
test_bit(HNAE3_DEV_SUPPORT_QB_B, (ae_dev)->caps)
-#define hnae3_dev_fd_forward_tc_supported(hdev) \
- test_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, (hdev)->ae_dev->caps)
+#define hnae3_ae_dev_fd_forward_tc_supported(ae_dev) \
+ test_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, (ae_dev)->caps)
#define hnae3_dev_ptp_supported(hdev) \
test_bit(HNAE3_DEV_SUPPORT_PTP_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 9e4935a90c8b..ede31db761b3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3331,7 +3331,7 @@ static void hns3_set_default_feature(struct net_device *netdev)
if (test_bit(HNAE3_DEV_SUPPORT_UDP_TUNNEL_CSUM_B, ae_dev->caps))
netdev->features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
- if (test_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, ae_dev->caps))
+ if (hnae3_ae_dev_fd_forward_tc_supported(ae_dev))
netdev->features |= NETIF_F_HW_TC;
netdev->hw_features |= netdev->features;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 0134bc8f7865..5fa5ae7c32a6 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -5649,7 +5649,7 @@ static int hclge_fd_ad_config(struct hclge_dev *hdev, u8 stage, int loc,
action->write_rule_id_to_bd);
hnae3_set_field(ad_data, HCLGE_FD_AD_RULE_ID_M, HCLGE_FD_AD_RULE_ID_S,
action->rule_id);
- if (test_bit(HNAE3_DEV_SUPPORT_FD_FORWARD_TC_B, ae_dev->caps)) {
+ if (hnae3_ae_dev_fd_forward_tc_supported(ae_dev)) {
hnae3_set_bit(ad_data, HCLGE_FD_AD_TC_OVRD_B,
action->override_tc);
hnae3_set_field(ad_data, HCLGE_FD_AD_TC_SIZE_M,
--
2.33.0
Powered by blists - more mailing lists