mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guangbin Huang <huangguangbin2@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>
Cc: <edumazet@google.com>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<huangguangbin2@huawei.com>, <lipeng321@huawei.com>,
	<lanhao@huawei.com>
Subject: [PATCH net-next 08/14] net: hns3: modify macro hnae3_dev_tx_push_supported
Date: Sat, 24 Sep 2022 10:30:18 +0800	[thread overview]
Message-ID: <20220924023024.14219-9-huangguangbin2@huawei.com> (raw)
In-Reply-To: <20220924023024.14219-1-huangguangbin2@huawei.com>

Redefine macro hnae3_dev_tx_push_supported(hdev) to
hnae3_ae_dev_tx_push_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           | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c        | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index b802de61e63b..2a6d2ff3056b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -128,8 +128,8 @@ enum HNAE3_DEV_CAP_BITS {
 #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)
+#define hnae3_ae_dev_tx_push_supported(ae_dev) \
+	test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, (ae_dev)->caps)
 
 #define hnae3_dev_phy_imp_supported(hdev) \
 	test_bit(HNAE3_DEV_SUPPORT_PHY_IMP_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 878c60d58061..fa7949fb2cb0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -5229,7 +5229,7 @@ static void hns3_state_init(struct hnae3_handle *handle)
 
 	set_bit(HNS3_NIC_STATE_INITED, &priv->state);
 
-	if (test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps))
+	if (hnae3_ae_dev_tx_push_supported(ae_dev))
 		set_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state);
 
 	if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index f866b6676318..dd1a32659800 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -1192,7 +1192,7 @@ static int hns3_set_tx_push(struct net_device *netdev, u32 tx_push)
 	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
 	u32 old_state = test_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state);
 
-	if (!test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps) && tx_push)
+	if (!hnae3_ae_dev_tx_push_supported(ae_dev) && tx_push)
 		return -EOPNOTSUPP;
 
 	if (tx_push == old_state)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 5fa5ae7c32a6..a93df064da46 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -1709,7 +1709,7 @@ static int hclge_alloc_tqps(struct hclge_dev *hdev)
 		 * the queue can execute push mode or doorbell mode on
 		 * device memory.
 		 */
-		if (test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps))
+		if (hnae3_ae_dev_tx_push_supported(ae_dev))
 			tqp->q.mem_base = hdev->hw.hw.mem_base +
 					  HCLGE_TQP_MEM_OFFSET(hdev, i);
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 34ac33783e97..191daa5cc537 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -353,7 +353,7 @@ static int hclgevf_alloc_tqps(struct hclgevf_dev *hdev)
 		 * the queue can execute push mode or doorbell mode on
 		 * device memory.
 		 */
-		if (test_bit(HNAE3_DEV_SUPPORT_TX_PUSH_B, ae_dev->caps))
+		if (hnae3_ae_dev_tx_push_supported(ae_dev))
 			tqp->q.mem_base = hdev->hw.hw.mem_base +
 					  HCLGEVF_TQP_MEM_OFFSET(hdev, i);
 
-- 
2.33.0


  parent reply	other threads:[~2022-09-24  2:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24  2:30 [PATCH net-next 00/14] redefine some macros of feature abilities judgement Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 01/14] net: hns3: modify macro hnae3_dev_fec_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 02/14] net: hns3: modify macro hnae3_dev_udp_gso_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 03/14] net: hns3: modify macro hnae3_dev_qb_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 04/14] net: hns3: modify macro hnae3_dev_fd_forward_tc_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 05/14] net: hns3: modify macro hnae3_dev_ptp_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 06/14] net: hns3: modify macro hnae3_dev_int_ql_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 07/14] net: hns3: modify macro hnae3_dev_hw_csum_supported Guangbin Huang
2022-09-24  2:30 ` Guangbin Huang [this message]
2022-09-24  2:30 ` [PATCH net-next 09/14] net: hns3: modify macro hnae3_dev_phy_imp_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 10/14] net: hns3: modify macro hnae3_dev_ras_imp_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 11/14] net: hns3: delete redundant macro hnae3_dev_tqp_txrx_indep_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 12/14] net: hns3: modify macro hnae3_dev_hw_pad_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 13/14] net: hns3: modify macro hnae3_dev_stash_supported Guangbin Huang
2022-09-24  2:30 ` [PATCH net-next 14/14] net: hns3: modify macro hnae3_dev_pause_supported Guangbin Huang
2022-09-24 11:27 ` [PATCH net-next 00/14] redefine some macros of feature abilities judgement Leon Romanovsky
2022-09-26 12:56   ` huangguangbin (A)
2022-09-26 17:11     ` Jakub Kicinski
2022-09-27  3:21       ` huangguangbin (A)
2022-09-27 10:24       ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220924023024.14219-9-huangguangbin2@huawei.com \
    --to=huangguangbin2@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=lanhao@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®