From nobody Sun Feb 8 06:21:56 2026 Received: from canpmsgout03.his.huawei.com (canpmsgout03.his.huawei.com [113.46.200.218]) (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 DA82825332E; Thu, 29 Jan 2026 04:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769659285; cv=none; b=KF/k9XlKVczjMO6QOIbj7LrUHIYG99qChGpXdiwQXGyBy6WhBwd7Xx9cz+PDiYCNR3CDQSahWTpDJ4YPPtcdxDOsOE8lhwVVglb45t+ZFR3fIXAWBRkG6bDilJ5SG5GYYMlxOFBLUD//Aq7GaQHoscrTsAT5TMvQB73egqx/G6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769659285; c=relaxed/simple; bh=gHAA1WJwTbyyaVtyfKep2S5JOr4pYIUFsrmSbvuZWms=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rNOY+EtNatPMTlnL81KTd0IHJfMsk+jgaSHMzoKAdrUcMFGYuqgDuxYEUZWj4IdoMfliYc4E0hgQin1Rx9QKKk+JPqY3m6nqIT/dBAkfUNmjsBcOuP8Z+EhtpcZhTNbCm83YrA+CaybCQECAPo/8FM0ALkP6gQ6e8WxHv7s0zrQ= 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=nVITNLI1; arc=none smtp.client-ip=113.46.200.218 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="nVITNLI1" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=RwPgRnAseT8QxpJmGIomNK00Fg6cKaoUhkAqIPs5378=; b=nVITNLI1GQFwKBb6KlNrOYI8EkXQCQ2Kn4ttig0jXn1RzCTV2YOmnqPvJbvtgMfZzK2W1NX85 b5OA3o8j42mX9neRXK2tE6o1256EFXBdkGeIBAPvt8OiGhDz0yN0JelgyhpYY+8DhJMr5N7fgz/ aCNifX1vuTAxgf64Xj0ZIYM= Received: from mail.maildlp.com (unknown [172.19.162.144]) by canpmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4f1lhc2L6pzpSxF; Thu, 29 Jan 2026 11:57:20 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id E22B440567; Thu, 29 Jan 2026 12:01:19 +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; Thu, 29 Jan 2026 12:01:18 +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 v03 1/4] hinic3: Fix code Style(remove empty lines between error handling) Date: Thu, 29 Jan 2026 12:01:08 +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: 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 previous review comment, fix code style of removing empty lines between the actions on the error handling path to make it more idiomatic in the merged code. Link: https://lore.kernel.org/netdev/20250902180937.4c8d9eb3@kernel.org/ 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 Sun Feb 8 06:21:56 2026 Received: from canpmsgout09.his.huawei.com (canpmsgout09.his.huawei.com [113.46.200.224]) (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 890CC293C4E; Thu, 29 Jan 2026 04:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.224 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769659296; cv=none; b=bv1H/3hP4JR5/t5kbxOWlbNn6zJfG0Er1tM3XhcgqV5d7pOIrIGjDmd4o8pJVvrpGWigeVs4dauozwKyD6Ca9nG52NL8pjZ5jQEkt7hEdCZx0vVoMcedTM1WueHyaDfqkVL4tsx41nwlviL7faR9udNBj7fRHUSYmGA4dga6x5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769659296; c=relaxed/simple; bh=UKr6hUIN8lEhbTpowr90NC6/IYy5O2qLuzxD7VvO16w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DCnx6aUC9d8TzPcqCcLwCKzB3P7+erIs9N4GNRKOVhbwtVq4wZMz/sLOF007NA6XlS3uybBXmnIP9RD/IfrNiOwtoIITkq3J6bkdI5Wi9OuyakzDQ3cAOfzx9AVHBB6CKsmGUWOxjTjYlLezbHYUi+ZT4R6xuoPtkXpnOBoyjPA= 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=uspDWEAa; arc=none smtp.client-ip=113.46.200.224 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="uspDWEAa" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=WTmurGlQCMkCkWDcKq8Td0eQuXfFJHK3iydsOHwlq3E=; b=uspDWEAapNM0peGZe1Ks2sXOV5CeHQTUXiYaF+I2e8mrXw4bJV6H7Y+dmCNcEEzL21x7wivMC 706qs7uJ1rMfUfD3coFXjoxHnvRstbuWHiaphnUGaTYSF6oB0bl6D88MhNun5wCKBv1AP1+r6ch PndnLR32e3amlttLKhxeSU4= Received: from mail.maildlp.com (unknown [172.19.162.92]) by canpmsgout09.his.huawei.com (SkyGuard) with ESMTPS id 4f1ljF5FDGz1cyv1; Thu, 29 Jan 2026 11:57:53 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id AAE6640565; Thu, 29 Jan 2026 12:01:21 +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; Thu, 29 Jan 2026 12:01:20 +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 v03 2/4] hinic3: Remove defensive txq_num check Date: Thu, 29 Jan 2026 12:01:09 +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: kwepems500001.china.huawei.com (7.221.188.70) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" Since commit 1f3838b84a63 ("hinic3: Add Rss function") nic_dev->num_txqs cannot be zero in hinic3_alloc_txqs(). So remove the check for this case. Link: https://lore.kernel.org/netdev/20250902180843.5ba05bf2@kernel.org/ 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 Sun Feb 8 06:21:56 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 E212126E6F9; Thu, 29 Jan 2026 04:01:32 +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=1769659296; cv=none; b=Mz0m3NA/44hg3J5t0tZKL62jbTlDg/wQufEHDvQ+0gbh+z6keuFWNnaW9qodOAYUfLzkPdj9+oAbMkXr6RxDYAkaMOeUZ5njFxoRIeSr6fSq3P4Oyt8abyd/BWzmq+tvXxYy362brElsbO3jVHOdtQZVd4KQw/rt59VOogKnx8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769659296; c=relaxed/simple; bh=ychpanj36WbEomqU04vKETM7biFM/K4RVu1ga0yzr04=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i75Xn2Y8LmhMH90GTHHo/Rnj0oq1IzJ8mjf5WBfWqh3BN0oS/lt+nDGyhndJ1NVrYjHHvkEDGQSK3xjddOC7V5+u8Zhr8K4uzpoetwg9EcWjR7/eRvc3gqYTPjI7mevpbtdTNvM6tnEmiAJX8yYxiEbxwSP335XiNvvh8dyOzD8= 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=XN01uYR/; 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="XN01uYR/" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=Ryuj9j6vDep6asza+dAvOmwNUl15l4C6QintKx4bQTw=; b=XN01uYR/sH1xHQgbLRKPsRN5mLi3Amp2GrmUGerpzyiL0YZpQlePt8nIxXHclJUiKdbjbWjrb 99WyyUpI2aFyOb+TKhgduskIu7WTP024SQmTm2RuIyreR9oxPLEIcSfFmw1q30KhwRB91EORTR4 nJspeECVl7edJVmAhIUb1zA= Received: from mail.maildlp.com (unknown [172.19.163.163]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4f1ljG48gqzmV95; Thu, 29 Jan 2026 11:57:54 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id A457340565; Thu, 29 Jan 2026 12:01:23 +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; Thu, 29 Jan 2026 12:01:22 +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 v03 3/4] hinic3: Use array_size instead of multiplying Date: Thu, 29 Jan 2026 12:01:10 +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: kwepems500001.china.huawei.com (7.221.188.70) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" Since commit 17fcb3dc12bb ("hinic3: module initialization and tx/rx logic") use "size * sizeof(u64)" in hinic3_feature_nego. Use array_size instead of multiplying can make it clearer. Link: https://lore.kernel.org/netdev/20250911123120.GG30363@horms.kernel.or= g/ Co-developed-by: Zhu Yikai Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong Reviewed-by: Joe Damato --- 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 Sun Feb 8 06:21:56 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 E316F288C96; Thu, 29 Jan 2026 04:01:32 +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=1769659296; cv=none; b=OJRmcwjKMASZBr6cBvB+/mRvj7WOgdNlJjLWsZZ4CzPo0Erdui6Qs7cHkizwq7LzWRD1Ym8dwGlb2BgUImtAp15GghSGdcQSx03yRXRB6l5N81DDdI0r5UzZ+oPJl3K8SgKUxLOWAUSjM3LVHry+QRy0kbjxxIbcDhHhK1rgGfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769659296; c=relaxed/simple; bh=kCqO2ZJkcDyyuTwrrkKrfVhZlwsoYyDv6tsJCP9WnZ0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bghjQm3kJdvxhtotdAFf8Y+js8ORrqu8QUF9WXQ6KBKKMiZVJziOs9f2aJFgEX1syWqlEN5C30knqxRdKyNLXCXjRjYmbbbt/629QhxaHe03ST/54xjlHwFnwnaxMOepksrS/snYZn4GKikbKK3/9Qj3zsCVzo6l/sbcNH/z4wg= 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.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="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.92]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4f1ljJ3XL2zmV95; Thu, 29 Jan 2026 11:57:56 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 8EA6440565; Thu, 29 Jan 2026 12:01:25 +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; Thu, 29 Jan 2026 12:01:24 +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 v03 4/4] hinic3: RQ use RQ_CTXT_PREF_CI_HI instead of SQ_CTXT_PREF_CI_HI Date: Thu, 29 Jan 2026 12:01:11 +0800 Message-ID: <7b34bf318c64398f34048c823c15b2eec5a679bc.1769656467.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