public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles
@ 2026-01-20 12:38 Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Fan Gong
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 12:38 UTC (permalink / raw)
  To: Fan Gong, Zhu Yikai, netdev, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn
  Cc: linux-kernel, linux-doc, luosifu, Xin Guo, Zhou Shuai, Wu Like,
	Shi Jing, Luo Yang

This patchset provides netif_queue_set_napi bug fix and serveral code styles
fixes to :

Fix netif_queue_set_napi queue_index parameter passing error.
Remove empty lines between error handling.
Remove redundant defensive code.
Use array_size instead of multiplying.
Sq use SQ_CTXT_PREF_CI_HI to improve readability.

Thanks,
Fan gong

Fan Gong (5):
  hinic3: Fix netif_queue_set_napi queue_index parameter passing error
  hinic3: Fix code Style(remove empty lines between error handling)
  hinic3: Remove redundant defensive code
  hinic3: Use array_size instead of multiplying
  hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI

 .../net/ethernet/huawei/hinic3/hinic3_cmdq.c  |  3 ---
 .../net/ethernet/huawei/hinic3/hinic3_eqs.c   |  1 -
 .../net/ethernet/huawei/hinic3/hinic3_irq.c   | 23 +++++++++++--------
 .../net/ethernet/huawei/hinic3/hinic3_lld.c   |  5 ----
 .../net/ethernet/huawei/hinic3/hinic3_main.c  |  4 ----
 .../net/ethernet/huawei/hinic3/hinic3_mbox.c  |  2 --
 .../ethernet/huawei/hinic3/hinic3_nic_cfg.c   |  6 +++--
 .../ethernet/huawei/hinic3/hinic3_nic_io.c    |  6 ++++-
 .../net/ethernet/huawei/hinic3/hinic3_tx.c    |  7 ------
 9 files changed, 23 insertions(+), 34 deletions(-)


base-commit: 4515ec4ad58a37e70a9e1256c0b993958c9b7497
-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH net v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
@ 2026-01-20 12:38 ` Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 2/5] hinic3: Fix code Style(remove empty lines between error handling) Fan Gong
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 12:38 UTC (permalink / raw)
  To: Fan Gong, Zhu Yikai, netdev, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn
  Cc: linux-kernel, linux-doc, luosifu, Xin Guo, Zhou Shuai, Wu Like,
	Shi Jing, Luo Yang

Incorrectly transmitted interrupt number instead of queue number
when using netif_queue_set_napi. Besides, move this to appropriate
code location.
Remove redundant netif_stop_subqueue beacuase it is not part of the
hinic3_send_one_skb process.

Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
 .../net/ethernet/huawei/hinic3/hinic3_irq.c   | 23 +++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c b/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c
index 6950ee4d037b..ef3bc88e0a65 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c
@@ -63,21 +63,12 @@ static void qp_add_napi(struct hinic3_irq_cfg *irq_cfg)
 	struct hinic3_nic_dev *nic_dev = netdev_priv(irq_cfg->netdev);
 
 	netif_napi_add(nic_dev->netdev, &irq_cfg->napi, hinic3_poll);
-	netif_queue_set_napi(irq_cfg->netdev, irq_cfg->irq_id,
-			     NETDEV_QUEUE_TYPE_RX, &irq_cfg->napi);
-	netif_queue_set_napi(irq_cfg->netdev, irq_cfg->irq_id,
-			     NETDEV_QUEUE_TYPE_TX, &irq_cfg->napi);
 	napi_enable(&irq_cfg->napi);
 }
 
 static void qp_del_napi(struct hinic3_irq_cfg *irq_cfg)
 {
 	napi_disable(&irq_cfg->napi);
-	netif_queue_set_napi(irq_cfg->netdev, irq_cfg->irq_id,
-			     NETDEV_QUEUE_TYPE_RX, NULL);
-	netif_queue_set_napi(irq_cfg->netdev, irq_cfg->irq_id,
-			     NETDEV_QUEUE_TYPE_TX, NULL);
-	netif_stop_subqueue(irq_cfg->netdev, irq_cfg->irq_id);
 	netif_napi_del(&irq_cfg->napi);
 }
 
@@ -240,6 +231,11 @@ int hinic3_qps_irq_init(struct net_device *netdev)
 		INIT_WORK(&irq_cfg->rxq->dim.work, hinic3_rx_dim_work);
 		irq_cfg->rxq->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_CQE;
 
+		netif_queue_set_napi(irq_cfg->netdev, q_id,
+				     NETDEV_QUEUE_TYPE_RX, &irq_cfg->napi);
+		netif_queue_set_napi(irq_cfg->netdev, q_id,
+				     NETDEV_QUEUE_TYPE_TX, &irq_cfg->napi);
+
 		hinic3_set_msix_auto_mask_state(nic_dev->hwdev,
 						irq_cfg->msix_entry_idx,
 						HINIC3_SET_MSIX_AUTO_MASK);
@@ -254,6 +250,10 @@ int hinic3_qps_irq_init(struct net_device *netdev)
 		q_id--;
 		irq_cfg = &nic_dev->q_params.irq_cfg[q_id];
 		qp_del_napi(irq_cfg);
+		netif_queue_set_napi(irq_cfg->netdev, q_id,
+				     NETDEV_QUEUE_TYPE_RX, NULL);
+		netif_queue_set_napi(irq_cfg->netdev, q_id,
+				     NETDEV_QUEUE_TYPE_TX, NULL);
 
 		hinic3_set_msix_state(nic_dev->hwdev, irq_cfg->msix_entry_idx,
 				      HINIC3_MSIX_DISABLE);
@@ -276,6 +276,11 @@ void hinic3_qps_irq_uninit(struct net_device *netdev)
 	for (q_id = 0; q_id < nic_dev->q_params.num_qps; q_id++) {
 		irq_cfg = &nic_dev->q_params.irq_cfg[q_id];
 		qp_del_napi(irq_cfg);
+		netif_queue_set_napi(irq_cfg->netdev, q_id,
+				     NETDEV_QUEUE_TYPE_RX, NULL);
+		netif_queue_set_napi(irq_cfg->netdev, q_id,
+				     NETDEV_QUEUE_TYPE_TX, NULL);
+
 		hinic3_set_msix_state(nic_dev->hwdev, irq_cfg->msix_entry_idx,
 				      HINIC3_MSIX_DISABLE);
 		hinic3_set_msix_auto_mask_state(nic_dev->hwdev,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net v01 2/5] hinic3: Fix code Style(remove empty lines between error handling)
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Fan Gong
@ 2026-01-20 12:38 ` Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 3/5] hinic3: Remove redundant defensive code Fan Gong
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 12:38 UTC (permalink / raw)
  To: Fan Gong, Zhu Yikai, netdev, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn
  Cc: linux-kernel, linux-doc, luosifu, Xin Guo, Zhou Shuai, Wu Like,
	Shi Jing, Luo Yang

Fix code style of removing empty lines between the actions on the
error handling path.

Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
 drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c | 3 ---
 drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c  | 1 -
 drivers/net/ethernet/huawei/hinic3/hinic3_lld.c  | 5 -----
 drivers/net/ethernet/huawei/hinic3/hinic3_main.c | 4 ----
 drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c | 2 --
 drivers/net/ethernet/huawei/hinic3/hinic3_tx.c   | 1 -
 6 files changed, 16 deletions(-)

diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c b/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c
index ef539d1b69a3..86720bb119e9 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.c
@@ -878,14 +878,11 @@ int hinic3_cmdqs_init(struct hinic3_hwdev *hwdev)
 	}
 
 	hinic3_free_db_addr(hwdev, cmdqs->cmdqs_db_base);
-
 err_destroy_cmdq_wq:
 	destroy_cmdq_wq(hwdev, cmdqs);
-
 err_free_cmdqs:
 	dma_pool_destroy(cmdqs->cmd_buf_pool);
 	kfree(cmdqs);
-
 err_out:
 	return err;
 }
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c b/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c
index 1ecc2aca1e35..a2c3962116d5 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_eqs.c
@@ -686,7 +686,6 @@ int hinic3_aeqs_init(struct hinic3_hwdev *hwdev, u16 num_aeqs,
 	}
 
 	destroy_workqueue(aeqs->workq);
-
 err_free_aeqs:
 	kfree(aeqs);
 
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c
index 2b77fea1e0b3..87413e192f10 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c
@@ -230,7 +230,6 @@ static int hinic3_mapping_bar(struct pci_dev *pdev,
 		iounmap(pci_adapter->mgmt_reg_base);
 err_unmap_intr_reg_base:
 	iounmap(pci_adapter->intr_reg_base);
-
 err_unmap_cfg_reg_base:
 	iounmap(pci_adapter->cfg_reg_base);
 
@@ -285,10 +284,8 @@ static int hinic3_pci_init(struct pci_dev *pdev)
 err_release_regions:
 	pci_clear_master(pdev);
 	pci_release_regions(pdev);
-
 err_disable_device:
 	pci_disable_device(pdev);
-
 err_free_pci_adapter:
 	pci_set_drvdata(pdev, NULL);
 	mutex_destroy(&pci_adapter->pdev_mutex);
@@ -382,7 +379,6 @@ static int hinic3_probe_func(struct hinic3_pcidev *pci_adapter)
 	hinic3_func_uninit(pdev);
 err_unmap_bar:
 	hinic3_unmapping_bar(pci_adapter);
-
 err_out:
 	dev_err(&pdev->dev, "PCIe device probe function failed\n");
 
@@ -415,7 +411,6 @@ static int hinic3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 err_uninit_pci:
 	hinic3_pci_uninit(pdev);
-
 err_out:
 	dev_err(&pdev->dev, "PCIe device probe failed\n");
 
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c
index a33f86675954..6275d94dfefd 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c
@@ -104,7 +104,6 @@ static int hinic3_alloc_txrxqs(struct net_device *netdev)
 
 err_free_rxqs:
 	hinic3_free_rxqs(netdev);
-
 err_free_txqs:
 	hinic3_free_txqs(netdev);
 
@@ -475,17 +474,14 @@ static int hinic3_nic_probe(struct auxiliary_device *adev,
 	disable_delayed_work_sync(&nic_dev->periodic_work);
 	hinic3_update_nic_feature(nic_dev, 0);
 	hinic3_set_nic_feature_to_hw(nic_dev);
-
 err_uninit_sw:
 	hinic3_sw_uninit(netdev);
-
 err_free_nic_io:
 	hinic3_free_nic_io(nic_dev);
 err_free_nic_dev:
 	hinic3_free_nic_dev(nic_dev);
 err_free_netdev:
 	free_netdev(netdev);
-
 err_unregister_adev_event:
 	hinic3_adev_event_unregister(adev);
 	dev_err(&pdev->dev, "NIC service probe failed\n");
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c b/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c
index 6eb441d6a590..c871fd0fb109 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_mbox.c
@@ -446,10 +446,8 @@ int hinic3_init_mbox(struct hinic3_hwdev *hwdev)
 		hinic3_uninit_func_mbox_msg_channel(hwdev);
 err_uninit_mgmt_msg_ch:
 	uninit_mgmt_msg_channel(mbox);
-
 err_destroy_workqueue:
 	destroy_workqueue(mbox->workq);
-
 err_free_mbox:
 	kfree(mbox);
 
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
index ef32aed7d761..4e361c9bd043 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
@@ -609,7 +609,6 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
 
 err_drop_pkt:
 	dev_kfree_skb_any(skb);
-
 err_out:
 	return NETDEV_TX_OK;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net v01 3/5] hinic3: Remove redundant defensive code
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 2/5] hinic3: Fix code Style(remove empty lines between error handling) Fan Gong
@ 2026-01-20 12:38 ` Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 4/5] hinic3: Use array_size instead of multiplying Fan Gong
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 12:38 UTC (permalink / raw)
  To: Fan Gong, Zhu Yikai, netdev, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn
  Cc: linux-kernel, linux-doc, luosifu, Xin Guo, Zhou Shuai, Wu Like,
	Shi Jing, Luo Yang

According to comment of patch 03, check codes that were merged and
remove redundant defensive codes.

Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
 drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
index 4e361c9bd043..6d3dc930ca97 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
@@ -44,16 +44,10 @@ static void hinic3_txq_stats_init(struct hinic3_txq *txq)
 int hinic3_alloc_txqs(struct net_device *netdev)
 {
 	struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
-	struct hinic3_hwdev *hwdev = nic_dev->hwdev;
 	u16 q_id, num_txqs = nic_dev->max_qps;
 	struct pci_dev *pdev = nic_dev->pdev;
 	struct hinic3_txq *txq;
 
-	if (!num_txqs) {
-		dev_err(hwdev->dev, "Cannot allocate zero size txqs\n");
-		return -EINVAL;
-	}
-
 	nic_dev->txqs = kcalloc(num_txqs, sizeof(*nic_dev->txqs),  GFP_KERNEL);
 	if (!nic_dev->txqs)
 		return -ENOMEM;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net v01 4/5] hinic3: Use array_size instead of multiplying
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
                   ` (2 preceding siblings ...)
  2026-01-20 12:38 ` [PATCH net v01 3/5] hinic3: Remove redundant defensive code Fan Gong
@ 2026-01-20 12:38 ` Fan Gong
  2026-01-20 12:38 ` [PATCH net v01 5/5] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI Fan Gong
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 12:38 UTC (permalink / raw)
  To: Fan Gong, Zhu Yikai, netdev, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn
  Cc: linux-kernel, linux-doc, luosifu, Xin Guo, Zhou Shuai, Wu Like,
	Shi Jing, Luo Yang

According to comment of patch 03, check codes that were merged and
use array_size instead of multiplying.

Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
 drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
index b6cc7bb7bb0c..44abccf9cb29 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
@@ -23,7 +23,8 @@ static int hinic3_feature_nego(struct hinic3_hwdev *hwdev, u8 opcode,
 	feature_nego.func_id = hinic3_global_func_id(hwdev);
 	feature_nego.opcode = opcode;
 	if (opcode == MGMT_MSG_CMD_OP_SET)
-		memcpy(feature_nego.s_feature, s_feature, size * sizeof(u64));
+		memcpy(feature_nego.s_feature, s_feature,
+		       array_size(size, sizeof(u64)));
 
 	mgmt_msg_params_init_default(&msg_params, &feature_nego,
 				     sizeof(feature_nego));
@@ -37,7 +38,8 @@ static int hinic3_feature_nego(struct hinic3_hwdev *hwdev, u8 opcode,
 	}
 
 	if (opcode == MGMT_MSG_CMD_OP_GET)
-		memcpy(s_feature, feature_nego.s_feature, size * sizeof(u64));
+		memcpy(s_feature, feature_nego.s_feature,
+		       array_size(size, sizeof(u64)));
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net v01 5/5] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
                   ` (3 preceding siblings ...)
  2026-01-20 12:38 ` [PATCH net v01 4/5] hinic3: Use array_size instead of multiplying Fan Gong
@ 2026-01-20 12:38 ` Fan Gong
  2026-01-20 14:27 ` [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
  2026-01-20 23:47 ` Jakub Kicinski
  6 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 12:38 UTC (permalink / raw)
  To: Fan Gong, Zhu Yikai, netdev, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Andrew Lunn
  Cc: linux-kernel, linux-doc, luosifu, Xin Guo, Zhou Shuai, Wu Like,
	Shi Jing, Luo Yang

Separate the CTX_PREF_CI_HI of rq and sq to improve readability.

Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
 drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c
index d86cd1ba4605..90887d2bb127 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_io.c
@@ -162,6 +162,9 @@ struct hinic3_clean_queue_ctxt {
 #define SQ_CTXT_WQ_BLOCK_SET(val, member)  \
 	FIELD_PREP(SQ_CTXT_WQ_BLOCK_##member##_MASK, val)
 
+/* reuse SQ macro for RQ because the hardware format is identical */
+#define RQ_CTXT_PREF_CI_HI(val)            SQ_CTXT_PREF_CI_HI(val)
+
 #define RQ_CTXT_PI_IDX_MASK                GENMASK(15, 0)
 #define RQ_CTXT_CI_IDX_MASK                GENMASK(31, 16)
 #define RQ_CTXT_CI_PI_SET(val, member)  \
@@ -629,7 +632,8 @@ static void hinic3_rq_prepare_ctxt(struct hinic3_io_queue *rq,
 			    RQ_CTXT_PREF_SET(RQ_WQ_PREFETCH_THRESHOLD, CACHE_THRESHOLD));
 
 	rq_ctxt->pref_ci_owner =
-		cpu_to_le32(RQ_CTXT_PREF_SET(SQ_CTXT_PREF_CI_HI(ci_start), CI_HI) |
+		cpu_to_le32(RQ_CTXT_PREF_SET(RQ_CTXT_PREF_CI_HI(ci_start),
+					     CI_HI) |
 			    RQ_CTXT_PREF_SET(1, OWNER));
 
 	rq_ctxt->pref_wq_pfn_hi_ci =
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
                   ` (4 preceding siblings ...)
  2026-01-20 12:38 ` [PATCH net v01 5/5] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI Fan Gong
@ 2026-01-20 14:27 ` Fan Gong
  2026-01-20 23:47 ` Jakub Kicinski
  6 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-20 14:27 UTC (permalink / raw)
  To: gongfan1
  Cc: andrew+netdev, davem, edumazet, guoxin09, horms, kuba, linux-doc,
	linux-kernel, luosifu, luoyang82, netdev, pabeni, shijing34,
	wulike1, zhoushuai28, zhuyikai1

Sorry for choosing the wrong branch. We should send to net-next instead of net.
We'll send a new patchset to net-next soon.

Thanks,
Fan gong

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles
  2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
                   ` (5 preceding siblings ...)
  2026-01-20 14:27 ` [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
@ 2026-01-20 23:47 ` Jakub Kicinski
  2026-01-21  4:24   ` Fan Gong
  6 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2026-01-20 23:47 UTC (permalink / raw)
  To: Fan Gong
  Cc: Zhu Yikai, netdev, David S. Miller, Eric Dumazet, Paolo Abeni,
	Simon Horman, Andrew Lunn, linux-kernel, linux-doc, luosifu,
	Xin Guo, Zhou Shuai, Wu Like, Shi Jing, Luo Yang

On Tue, 20 Jan 2026 20:38:38 +0800 Fan Gong wrote:
> This patchset provides netif_queue_set_napi bug fix and serveral code styles
> fixes to :
> 
> Fix netif_queue_set_napi queue_index parameter passing error.
> Remove empty lines between error handling.
> Remove redundant defensive code.
> Use array_size instead of multiplying.
> Sq use SQ_CTXT_PREF_CI_HI to improve readability.

no reposts within 24h please
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
-- 
pv-bot: 24h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles
  2026-01-20 23:47 ` Jakub Kicinski
@ 2026-01-21  4:24   ` Fan Gong
  0 siblings, 0 replies; 9+ messages in thread
From: Fan Gong @ 2026-01-21  4:24 UTC (permalink / raw)
  To: kuba
  Cc: andrew+netdev, davem, edumazet, gongfan1, guoxin09, horms,
	linux-doc, linux-kernel, luosifu, luoyang82, netdev, pabeni,
	shijing34, wulike1, zhoushuai28, zhuyikai1

On 1/21/2026 7:47 AM, Jakub Kicinski wrote:
> On Tue, 20 Jan 2026 20:38:38 +0800 Fan Gong wrote:
>> This patchset provides netif_queue_set_napi bug fix and serveral code styles
>> fixes to :
>>
>> Fix netif_queue_set_napi queue_index parameter passing error.
>> Remove empty lines between error handling.
>> Remove redundant defensive code.
>> Use array_size instead of multiplying.
>> Sq use SQ_CTXT_PREF_CI_HI to improve readability.
>
> no reposts within 24h please
> https://www.kernel.org/doc/html/next/process/maintainer-netdev.html

Sorry for reposting and incorrectly confusing net and net-next.
We will send a new patchset tomorrow and add Fixed tag in patchs for fixes.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-21  4:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20 12:38 [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
2026-01-20 12:38 ` [PATCH net v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Fan Gong
2026-01-20 12:38 ` [PATCH net v01 2/5] hinic3: Fix code Style(remove empty lines between error handling) Fan Gong
2026-01-20 12:38 ` [PATCH net v01 3/5] hinic3: Remove redundant defensive code Fan Gong
2026-01-20 12:38 ` [PATCH net v01 4/5] hinic3: Use array_size instead of multiplying Fan Gong
2026-01-20 12:38 ` [PATCH net v01 5/5] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI Fan Gong
2026-01-20 14:27 ` [PATCH net v01 0/5] net: hinic3: Fix netif_queue_set_napi input parameters and code styles Fan Gong
2026-01-20 23:47 ` Jakub Kicinski
2026-01-21  4:24   ` Fan Gong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox