From nobody Sat Feb 7 23:47:47 2026 Received: from canpmsgout01.his.huawei.com (canpmsgout01.his.huawei.com [113.46.200.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D2D8441046; Tue, 20 Jan 2026 14:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.216 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919410; cv=none; b=VwdNJtCT8pNy/dHzf8EMitWDLgbxmbHIXdf7BEx4275aH2yVpHMjcNAtnsCSqIYN/jlklm96GATt8E7/XcUttf6k3eNfEx8BUNBmU8DIdjYiOBCWXg+GSlpFcQvpZQcEskKafHaoiTupTtIil+OU8BKfQGGUeXIdwFJVnlbjr3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919410; c=relaxed/simple; bh=hkX+WwtAoehPviNL0MwOhdwoksltnEN33zDQSa4VjMs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UNboYWYmgYn/csIbuHfR4kfqYMHvf/cXTtWpgcamUsZhEPd3EZ3TdgU7BSd4u5fzedsDOZZJqFkI3GrbRdpancKyPl7ICu+DUsSgLIBgQs3nf36KqeyBlp8VlgjvcK8NWo59oLTgDvdYXXeJY8+mUO3LvPZMvRUljy9HC3ExICM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=iAaTSGfP; arc=none smtp.client-ip=113.46.200.216 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="iAaTSGfP" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=XWbiB+vEHF8mL6SecFGQ5KLYzQQiNDTGcUV0CW+Plv0=; b=iAaTSGfP74uFXbow0x4SodMOGg4ozANgci8HEWDA+IDoEE6X18QbEQ8QLB8rXvVkSZ5gT0a81 +TT6NmdCOYvvoR0YvgglgCy1TQxnuLQZE5tJZ4Tw5IzU25VxDkYHIhOr3xGoAwh4f5/dvD/vEOK HvZgbCDIb0SNAE7MkHRchr8= Received: from mail.maildlp.com (unknown [172.19.163.104]) by canpmsgout01.his.huawei.com (SkyGuard) with ESMTPS id 4dwV4550fVz1T4Gv; Tue, 20 Jan 2026 22:25:57 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 442214056E; Tue, 20 Jan 2026 22:29:59 +0800 (CST) Received: from DESKTOP-62GVMTR.china.huawei.com (10.174.188.120) by kwepemf100013.china.huawei.com (7.202.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Tue, 20 Jan 2026 22:29:58 +0800 From: Fan Gong To: Fan Gong , Zhu Yikai , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn CC: , , luosifu , Xin Guo , Zhou Shuai , Wu Like , Shi Jing , Luo Yang Subject: [PATCH net-next v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Date: Tue, 20 Jan 2026 22:29:47 +0800 Message-ID: X-Mailer: git-send-email 2.51.0.windows.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong --- .../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 =3D netdev_priv(irq_cfg->netdev); =20 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); } =20 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); } =20 @@ -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 =3D DIM_CQ_PERIOD_MODE_START_FROM_CQE; =20 + 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 =3D &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); =20 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 =3D 0; q_id < nic_dev->q_params.num_qps; q_id++) { irq_cfg =3D &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, --=20 2.43.0 From nobody Sat Feb 7 23:47:47 2026 Received: from canpmsgout08.his.huawei.com (canpmsgout08.his.huawei.com [113.46.200.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C282444102E; Tue, 20 Jan 2026 14:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919408; cv=none; b=JCO+mell51PBhRXx0AuKAV47gAYJFZjCdPDozF2Q/q6tvcmEiz7opR13rlcXoOaf535Hk8XXGy7R/V9r+RMDlzAy+YUlGpWjFLQSced2Qi2n7KhcgD7bvOL3poRXtKYMRm3NsT2CV8EEPJqdJZ8cqWdXjSgddg9DF0890/SLflA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919408; c=relaxed/simple; bh=hJIiuCinADs+F2K0CXoXYmOInua1H1sOGul+Z4K2VSs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mikf/X4EMmkNRT67okSATzQFrR4sT8/k5N63PlbQQhQHwaZrLM/BK87F7b5Ij0jXrCpsHxE9HyGgUT0br+PDO0ZUCwfTSV0FA991lPPBronP+oL1XYOF+lU4HwBZYgv7FeP5cxMTbsgZRbk7ztOt2p1kgQovJE3COTs/gR2U+wE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=b89yRSvG; arc=none smtp.client-ip=113.46.200.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="b89yRSvG" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=A4OhSwwajnlbJjvs/Q79oC2Uvf5aCohLYBqTNgiZ5oo=; b=b89yRSvGMrh+gtH8+5gf0Iva+IGYO7lLRUGf6akpxjCx1TehG07XJ+9wV6OjFn4vTMDoGicq3 MIxs/k06f3fLBHW/BxMYiTItmn2dvTNcNMV0XzYR1AkEWFLhU2QiC4wAQYllhG071pXWxP9ByYf exr88Uptb7sEkm+bX939kOg= Received: from mail.maildlp.com (unknown [172.19.163.15]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4dwV4s1QCmzmV6J; Tue, 20 Jan 2026 22:26:37 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 2511440565; Tue, 20 Jan 2026 22:30:01 +0800 (CST) Received: from DESKTOP-62GVMTR.china.huawei.com (10.174.188.120) by kwepemf100013.china.huawei.com (7.202.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Tue, 20 Jan 2026 22:30:00 +0800 From: Fan Gong To: Fan Gong , Zhu Yikai , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn CC: , , luosifu , Xin Guo , Zhou Shuai , Wu Like , Shi Jing , Luo Yang Subject: [PATCH net-next v01 2/5] hinic3: Fix code Style(remove empty lines between error handling) Date: Tue, 20 Jan 2026 22:29:48 +0800 Message-ID: <2e3783a4d63c422447aab454dc26792f92bcd97b.1768915707.git.zhuyikai1@h-partners.com> X-Mailer: git-send-email 2.51.0.windows.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" Fix code style of removing empty lines between the actions on the error handling path. Co-developed-by: Zhu Yikai Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong --- 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) } =20 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 nu= m_aeqs, } =20 destroy_workqueue(aeqs->workq); - err_free_aeqs: kfree(aeqs); =20 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); =20 @@ -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"); =20 @@ -415,7 +411,6 @@ static int hinic3_probe(struct pci_dev *pdev, const str= uct pci_device_id *id) =20 err_uninit_pci: hinic3_pci_uninit(pdev); - err_out: dev_err(&pdev->dev, "PCIe device probe failed\n"); =20 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 *netde= v) =20 err_free_rxqs: hinic3_free_rxqs(netdev); - err_free_txqs: hinic3_free_txqs(netdev); =20 @@ -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); =20 diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/e= thernet/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, =20 err_drop_pkt: dev_kfree_skb_any(skb); - err_out: return NETDEV_TX_OK; } --=20 2.43.0 From nobody Sat Feb 7 23:47:47 2026 Received: from canpmsgout07.his.huawei.com (canpmsgout07.his.huawei.com [113.46.200.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C37CA44102F; Tue, 20 Jan 2026 14:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.222 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919408; cv=none; b=mJIeczB0WXy6QlCrOVGTJVLnpqdgUNKiIy/VUSsjFpealxpPYp8V8kA7LRwKiyQxcuNSSpmKUTR5G6aGnZ7wp3MSpLrJy0ojdqtlDC/nwHT9V8Jw3iF9ttNJjBfo9C+3wErCR9KMpzcNKGO3IdVu7F/6vIlLMKLg4X0OzPAdy3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919408; c=relaxed/simple; bh=O1XFFyAoaxKuZ+CVZRzqRWtI1lDMsZQl8WUrynlEDFM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XRzhEkBi11wqNy/eBIWEz5IOe4sTzg7P7L8pGuUkDiSaB8sdQESaqkIWF9MxI6+wir8F6CPSlVlnx+tY4jKIY/+xfy8oLBXsoM8QOStGnTBe0u+zKBxPVY/yglGFEwNnXS4fNrCuaAT0lurxTcE8OEilsUPUJOVaWT7GRrih/KE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=ZB9WbBvU; arc=none smtp.client-ip=113.46.200.222 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="ZB9WbBvU" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=bL4qp+lXFE2452QYi0P16NYT5Mi/5g2ecYZa0M3HDBY=; b=ZB9WbBvU0zbRBB/enag3mhxp6gwAwDOX6TK4VVqY60OBXVzijK62V3ReAGITKZJddL8ihYVDf 36uX6834G1wIZA7lbY3S4JNkjbyt5/Tbt+SKw8+nZQhGJUkwcCDpECKb0B73X7zqfpfTUbw+1Iz QTnSNHNY9GMsXkeJhS0Oj/I= Received: from mail.maildlp.com (unknown [172.19.163.127]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4dwV4w1VpbzLlSN; Tue, 20 Jan 2026 22:26:40 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id D53DC402AB; Tue, 20 Jan 2026 22:30:02 +0800 (CST) Received: from DESKTOP-62GVMTR.china.huawei.com (10.174.188.120) by kwepemf100013.china.huawei.com (7.202.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Tue, 20 Jan 2026 22:30:01 +0800 From: Fan Gong To: Fan Gong , Zhu Yikai , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn CC: , , luosifu , Xin Guo , Zhou Shuai , Wu Like , Shi Jing , Luo Yang Subject: [PATCH net-next v01 3/5] hinic3: Remove redundant defensive code Date: Tue, 20 Jan 2026 22:29:49 +0800 Message-ID: X-Mailer: git-send-email 2.51.0.windows.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" According to comment of patch 03, check codes that were merged and remove redundant defensive codes. Co-developed-by: Zhu Yikai Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong --- 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/e= thernet/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 *tx= q) int hinic3_alloc_txqs(struct net_device *netdev) { struct hinic3_nic_dev *nic_dev =3D netdev_priv(netdev); - struct hinic3_hwdev *hwdev =3D nic_dev->hwdev; u16 q_id, num_txqs =3D nic_dev->max_qps; struct pci_dev *pdev =3D nic_dev->pdev; struct hinic3_txq *txq; =20 - if (!num_txqs) { - dev_err(hwdev->dev, "Cannot allocate zero size txqs\n"); - return -EINVAL; - } - nic_dev->txqs =3D kcalloc(num_txqs, sizeof(*nic_dev->txqs), GFP_KERNEL); if (!nic_dev->txqs) return -ENOMEM; --=20 2.43.0 From nobody Sat Feb 7 23:47:47 2026 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 988B444CF3A; Tue, 20 Jan 2026 14:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919410; cv=none; b=K+XEAFU+gz22aqWaGa1YfmEGwkCVStJyBLXTCQMSVRBKNEeTZ0WUpmzB+qIjSNtYX2U3+doVHtMt8PMyLLBScvcxX3zkr3nQHXHNbvv21kdI2yLrp0HKI/mscVDiCTW9T6uqeMCrZuyvGNDkSttBq5lxVtbnt2P5efvzOadV+kQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919410; c=relaxed/simple; bh=EABVssCM123G7jWb1K2EzG7DAOvkk0hnvjBy1LCXY/0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I9Ez4yfSE8dUW7ZbpWDzVy0wfqz0GBh4iwqccsKh8c1Xc3AATg6uDNefs/PgobWHVPE/4YJUGl88Ro36A8oft7O/B7b0B3WCWunTcH/QgY3qiWxTFvYh8OszIweAc8l1NVQodYHsYQ/zcbGkfb+S4MAIwxiAV1Uf0DZ8WOATBmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=pFH6JFXL; arc=none smtp.client-ip=113.46.200.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="pFH6JFXL" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=RyoonJga84J5TYM1qUcca+lnnVeYd8lqRPR77Y61Dr4=; b=pFH6JFXLbQyoXthbYVtnz8XH05nCtt8/a74b8NqgOmA90cMyIz71b1r684czZpqvGBTqii1gw EwJT6JaTFJUWUDxgaSf1e1NybnJQos/F8513ZI0oGkqz2qtv4KwI2v6VtbBasEwh68HEcD/2BUk 07caBsoVuxLI1MLC5DEUvhk= Received: from mail.maildlp.com (unknown [172.19.162.140]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4dwV4J60p6zcbPb; Tue, 20 Jan 2026 22:26:08 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 9D40F20104; Tue, 20 Jan 2026 22:30:04 +0800 (CST) Received: from DESKTOP-62GVMTR.china.huawei.com (10.174.188.120) by kwepemf100013.china.huawei.com (7.202.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Tue, 20 Jan 2026 22:30:03 +0800 From: Fan Gong To: Fan Gong , Zhu Yikai , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn CC: , , luosifu , Xin Guo , Zhou Shuai , Wu Like , Shi Jing , Luo Yang Subject: [PATCH net-next v01 4/5] hinic3: Use array_size instead of multiplying Date: Tue, 20 Jan 2026 22:29:50 +0800 Message-ID: X-Mailer: git-send-email 2.51.0.windows.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" According to comment of patch 03, check codes that were merged and use array_size instead of multiplying. Co-developed-by: Zhu Yikai Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong --- 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 =3D hinic3_global_func_id(hwdev); feature_nego.opcode =3D opcode; if (opcode =3D=3D 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))); =20 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, } =20 if (opcode =3D=3D 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))); =20 return 0; } --=20 2.43.0 From nobody Sat Feb 7 23:47:47 2026 Received: from canpmsgout04.his.huawei.com (canpmsgout04.his.huawei.com [113.46.200.219]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1C3D44104B; Tue, 20 Jan 2026 14:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.219 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919412; cv=none; b=NTzPNIdlhzRvFYmmmO+q6xOXl1l6OyQoKNXXlwIR+P0aY1596m8F5GRn3wERwCZdo59n9He109a7MKw5GaFwPhsWbGpf5vVQBrmaGWGE1QXLxbfe7cR/Pl5KMWUNA+jBKmC0r9WD7iUf/OL+Q/VctV+PECgJsYYuWJweS7LUWEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919412; c=relaxed/simple; bh=kCqO2ZJkcDyyuTwrrkKrfVhZlwsoYyDv6tsJCP9WnZ0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WYhXsRRYB2p94050+ZlHDBI24qHvNYwYDKOUuVjmpNhQPrNNThcghQ6vUSet2d8jBM8ziCfKjlM1DzkbBANvlf6nmH+G5ddQ4SMZ8IY+a5Cf8U6nWF8Rn4mAqtTlIlQ5q0hGttp7JLNLGpbpgxdI2WIAtVRVFTqCOiGJHIcIri4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=jFYrdIlD; arc=none smtp.client-ip=113.46.200.219 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="jFYrdIlD" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=oTXEVLgDumVCBFxpbO8s07ckXDCKC5Us7m6vOmueETk=; b=jFYrdIlD6scNu1lCaG+lOb4ovAPAm3AE9S1DxjPS7XzWJTmJ91siw+9jJyf+J11uZU12gG9yH LrnTfdTLhSwbMToijlqDkRUVizKzS3vHaCZhmU4HQ65F+hNejkdJvNhi2AWqUghbMyFPrVX1hO0 jCqW7GUZ1Ef7kIbZk0dcWgE= Received: from mail.maildlp.com (unknown [172.19.162.223]) by canpmsgout04.his.huawei.com (SkyGuard) with ESMTPS id 4dwV4x21Srz1prMB; Tue, 20 Jan 2026 22:26:41 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 85C1840569; Tue, 20 Jan 2026 22:30:06 +0800 (CST) Received: from DESKTOP-62GVMTR.china.huawei.com (10.174.188.120) by kwepemf100013.china.huawei.com (7.202.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Tue, 20 Jan 2026 22:30:05 +0800 From: Fan Gong To: Fan Gong , Zhu Yikai , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn CC: , , luosifu , Xin Guo , Zhou Shuai , Wu Like , Shi Jing , Luo Yang Subject: [PATCH net-next v01 5/5] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI Date: Tue, 20 Jan 2026 22:29:51 +0800 Message-ID: X-Mailer: git-send-email 2.51.0.windows.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" Separate the CTX_PREF_CI_HI of rq and sq to improve readability. Co-developed-by: Zhu Yikai Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong --- 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/n= et/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) =20 +/* 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_que= ue *rq, RQ_CTXT_PREF_SET(RQ_WQ_PREFETCH_THRESHOLD, CACHE_THRESHOLD)); =20 rq_ctxt->pref_ci_owner =3D - 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)); =20 rq_ctxt->pref_wq_pfn_hi_ci =3D --=20 2.43.0