From nobody Mon Feb 9 19:31:08 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 BE033429817; Tue, 20 Jan 2026 12:38:59 +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=1768912743; cv=none; b=KyNzj3SBdnAiBuU2HJ2Gq16QnFtdJ+pXf0gC2eAtJOIS0+kTKvMHUgW67rLygyh/aL0vdcfyYZRhYGn/wYq6OVtiLBZ4h2A8mX5LNLGJEYj17ZJEh/j3hKSx3BnYrKA2pFf/KDTy4WB7qfEdskj+JRyfUkTijtXZAGLbemzwdcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912743; c=relaxed/simple; bh=hkX+WwtAoehPviNL0MwOhdwoksltnEN33zDQSa4VjMs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ivoUEoo9LY+6P2ss8KeVhxMj4wCu2EdB9zrfzwn+sZOQ2E+3K334gb1/g6tttYcE/RwWo4oKIc6SbOOgUbmdAwAvG2aFMj28CCLiky762bczJ0+aADzbyBIjOEHLLTJholHfCpd7ZIpz738WjbRX0WQ1ius1KpLec6C9SQCyU/s= 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.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="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.0]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4dwRc04JhTzcb1r; Tue, 20 Jan 2026 20:34:56 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 3CF76405A8; Tue, 20 Jan 2026 20:38:52 +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 20:38:50 +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 v01 1/5] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Date: Tue, 20 Jan 2026 20:38:39 +0800 Message-ID: <95b0a3832fc85cffc2eefed28f739edd55d0bdee.1768911232.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: kwepems500001.china.huawei.com (7.221.188.70) 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 Mon Feb 9 19:31:08 2026 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (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 4120742885C; Tue, 20 Jan 2026 12:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912739; cv=none; b=cjniJW+U/l4bm0t3iuo8xqE6jc//12KyNNni4OmKidfn56M2jGZdAwJEaCU4vKzNtiWJEel9qWGmZ9dXnDMp9Pb0qWmHihFgxNipG8aK1bswUtQBkwbgPSxTSk+3DDDaUpH1HQDHYv51geh6ubqLPuajXmuXaVgxEYLQzVrG6VM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912739; c=relaxed/simple; bh=hJIiuCinADs+F2K0CXoXYmOInua1H1sOGul+Z4K2VSs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CNYP2g/q7wDDczOd1Qy0ip4TTGDfHBMyB1YwuQDkxU4d/+AGWIyncQBGKgiJuGvpxDUlD2TVhp9xOSq3nHzhcHehrRA5MHU/3Gx6C0Rm5DXzctcQ9xR0ypIbSSjy9Ja4O5uceAn82d+KJ9NHPl9toJJrY5ngQB4nOjvLUvJ/Dlw= 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.225 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.127]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4dwRch6FsSz1K96j; Tue, 20 Jan 2026 20:35:32 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 17E5040570; Tue, 20 Jan 2026 20:38:54 +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 20:38:52 +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 v01 2/5] hinic3: Fix code Style(remove empty lines between error handling) Date: Tue, 20 Jan 2026 20:38:40 +0800 Message-ID: <1a91a20827e0f3db273719464d7db2a55305ace7.1768911232.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: kwepems500001.china.huawei.com (7.221.188.70) 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 Mon Feb 9 19:31:08 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 3ABE842980D; Tue, 20 Jan 2026 12:38:59 +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=1768912741; cv=none; b=R4r31LHU4nZFmT8b6HVfGje0JnveacpM+bP4QLzWWKQ5WYpByeJQVFH68LmgU6WU9Cb0rVHUkFx5mp9yg9kFPbAU1ZnJzW7c4SIRdPlAxT+Sl4lR4BjZ7sQ8DT0bIZIctka63PgLGGVamRnfec8P1NX5GSKlmWXJ/MDn3PdW3JM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912741; c=relaxed/simple; bh=O1XFFyAoaxKuZ+CVZRzqRWtI1lDMsZQl8WUrynlEDFM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RA5lDN/dBomTKgjh50VSgE7sbJ/ZZ09BzulSnp85D9CZjE38uO9MxJvy1VFJi6ai+fBSF3iQpyMveotiuIIb/YwiCe2axZvZaD6SOsGdb635DTmc2Yeu2jf0OOsugVpO0bGYoYJMkCf6Hh1UB7yIlOZtpuq5JuvgjK6g5rch7g4= 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.162.92]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4dwRcj2PvPzLlSN; Tue, 20 Jan 2026 20:35:33 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id E958940562; Tue, 20 Jan 2026 20:38:55 +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 20:38:54 +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 v01 3/5] hinic3: Remove redundant defensive code Date: Tue, 20 Jan 2026 20:38:41 +0800 Message-ID: <72cee6f7f0915ab45d3c46fabda944dddc0d72eb.1768911232.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: kwepems500001.china.huawei.com (7.221.188.70) 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 Mon Feb 9 19:31:08 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 BE6C642E000; Tue, 20 Jan 2026 12:39: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=1768912747; cv=none; b=p+ejKaVRXJBZud0zwY8HG73Ahc1qi23fl62Vurjj52ZEFjKkjKsiEli69Q7mVan+Y7GysiwPRpZXudW6vu2xZo4accgTHSslju8yLPxQaZdGS0ykM9cwU7Z3GC59kBmaXqDvaiuolpTCQNsu+LGxJ84jJXXCM05fPr2149KJ5zo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912747; c=relaxed/simple; bh=EABVssCM123G7jWb1K2EzG7DAOvkk0hnvjBy1LCXY/0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FZ77ZIXHpt1d+LCJZo/nzRPLdkue0HWYR5iDs9sEoEZJ4qFmmDKH0HRo3kXhptfvzgsDPA1hx41nye6JY2uRIOwmgDk62I0QgZ26/q++Ca6+kkNKXOJBip9W7LUu83JmBJCVdPP/+irK/XFmxf8JoLHKfUo9xy4bScyflsiqRrM= 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.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="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.163.200]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4dwRcj6GlTzmV6J; Tue, 20 Jan 2026 20:35:33 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id BE1414055B; Tue, 20 Jan 2026 20:38:57 +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 20:38:56 +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 v01 4/5] hinic3: Use array_size instead of multiplying Date: Tue, 20 Jan 2026 20:38:42 +0800 Message-ID: <18c4b650ed9d18d1163c0755bb375364362e8ffa.1768911232.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: kwepems500001.china.huawei.com (7.221.188.70) 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 Mon Feb 9 19:31:08 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 7D89842B72C; Tue, 20 Jan 2026 12:39:02 +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=1768912744; cv=none; b=NMBQ/2HzHcceQm1RXtc13Pldi+/6LFzD7p+y9RhVuoWRqiyIOrcmkXCBZ9i1oBJmWPOCMJF7kaHSpgJrd/npKbzUCe8TcJJmyPsy4A8sjIgJVD/4Qorna6fdNmxk+RIVp3nGudeG1iL+cIyCxo2H9TemnaGHW1EYPUKgJ8kGRRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912744; c=relaxed/simple; bh=kCqO2ZJkcDyyuTwrrkKrfVhZlwsoYyDv6tsJCP9WnZ0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SqmWl3X9Hjkb8isDM2FCEZGxgxfTGOzuPfYqpRm6Tf3rhfOus9034V+Zb6c4DddIuJbqgllh2yrAxewRaevgP+dfZRVrORZsDNa/ITxtQkeYnpo6Kk8mb9iI8b9lnVASpoyY7XPB5BRAeglkZUgTo1Hq5SStuB3HkQd3cAW6d6M= 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.140]) by canpmsgout04.his.huawei.com (SkyGuard) with ESMTPS id 4dwRck2hqpz1prLv; Tue, 20 Jan 2026 20:35:34 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 924AA20104; Tue, 20 Jan 2026 20:38: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 20:38: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 v01 5/5] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI Date: Tue, 20 Jan 2026 20:38:43 +0800 Message-ID: <3e9283e95663ddb23c2f1e5fef05f893af94e8e8.1768911232.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: kwepems500001.china.huawei.com (7.221.188.70) 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