DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jiacheng Ye <yejiacheng4@h-partners.com>
To: dev@dpdk.org
Cc: Feifei Wang <wangfeifei40@huawei.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	stable@dpdk.org
Subject: [PATCH v4 06/27] net/hinic3: attach ethdev and set ops in secondary process
Date: Fri, 23 Oct 2026 23:57:47 +0800	[thread overview]
Message-ID: <20261023155809.855-7-yejiacheng4@h-partners.com> (raw)
In-Reply-To: <20261023155809.855-1-yejiacheng4@h-partners.com>

The secondary process probe path returns early without attaching the
already-created ethdev or assigning its dev_ops, leaving the device
unusable in secondary processes. Attach the ethdev and set the matching
PF/VF ops.

Fixes: 468368457681 ("net/hinic3: add device initialization")
Cc: stable@dpdk.org

Signed-off-by: Jiacheng Ye <yejiacheng4@h-partners.com>
---
 drivers/net/hinic3/hinic3_ethdev.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c
index eb5ddd9de6..5d67615a94 100644
--- a/drivers/net/hinic3/hinic3_ethdev.c
+++ b/drivers/net/hinic3/hinic3_ethdev.c
@@ -2127,6 +2127,9 @@ hinic3_dev_close(struct rte_eth_dev *eth_dev)
 		HINIC3_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
 	int ret;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return 0;
+
 	if (hinic3_test_and_set_bit(HINIC3_DEV_CLOSE, &nic_dev->dev_status)) {
 		PMD_DRV_LOG(WARNING, "Device %s already closed",
 			    nic_dev->dev_name);
@@ -3400,6 +3403,18 @@ hinic3_func_init(struct rte_eth_dev *eth_dev)
 		PMD_DRV_LOG(INFO, "Initialize %s in secondary process",
 			    eth_dev->data->name);
 
+		nic_dev = HINIC3_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
+		if (nic_dev == NULL) {
+			PMD_DRV_LOG(ERR, "nic_dev hwdev is NULL, dev_name: %s",
+				    eth_dev->data->name);
+			return -ENOMEM;
+		}
+
+		if (HINIC3_FUNC_TYPE(nic_dev->hwdev) == TYPE_VF)
+			eth_dev->dev_ops = &hinic3_pmd_vf_ops;
+		else
+			eth_dev->dev_ops = &hinic3_pmd_ops;
+
 		return 0;
 	}
 
-- 
2.33.0


  parent reply	other threads:[~2026-10-23 15:58 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 14:44 [PATCH v1 00/17] net/hinic3: add PMD features and fixes Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 01/17] net/hinic3: fix offload and cmdq/compact CQE config Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 02/17] net/hinic3: add CIR drop statistics and VF LAG support Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 03/17] net/hinic3: add FEC mode get/set and capability support Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 04/17] net/hinic3: add mbox message recording and debug dump Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 05/17] net/hinic3: add COS mask and COS map support Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 06/17] net/hinic3: add VF link state and promiscuous support Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 07/17] net/hinic3: convert cmdq ops to static global variables Jiacheng Ye
2026-10-10 14:44 ` [PATCH v1 08/17] net/hinic3: update RSS hash type configuration Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 09/17] net/hinic3: refactor flow rule parsing Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 10/17] net/hinic3: add SP560 NIC type identification and handling Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 11/17] net/hinic3: add device kvargs parameters support Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 12/17] net/hinic3: add compact CQE Rx path and ptype table Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 13/17] net/hinic3: expand TSO from 127 to 255 segments Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 14/17] net/hinic3: split Tx burst function for compact CQE support Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 15/17] net/hinic3: add pseudo-header checksum calculation Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 16/17] net/hinic3: add per-tile prefetch/drop/CEQ cmdq ops Jiacheng Ye
2026-10-10 14:45 ` [PATCH v1 17/17] net/hinic3: add mbox count telemetry support Jiacheng Ye
2026-10-10 18:30 ` [PATCH v1 00/17] net/hinic3: add PMD features and fixes Stephen Hemminger
2026-10-14 14:39   ` jiachengye_123
2026-10-14 15:08 ` [PATCH v2 00/26] " Jiacheng Ye
2026-10-14 15:08   ` [PATCH v2 01/26] net/hinic3: fix SP230 VF PCI device ID Jiacheng Ye
2026-10-14 15:08   ` [PATCH v2 02/26] net/hinic3: fix double removal in ethertype flow destroy Jiacheng Ye
2026-10-14 15:08   ` [PATCH v2 03/26] net/hinic3: fix VXLAN VNI spec and mask write Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 04/26] net/hinic3: fix vport enable null dereference Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 05/26] net/hinic3: attach ethdev and set ops in secondary process Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 06/26] net/hinic3: add NIC type identification Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 07/26] net/hinic3: fix offload and cmdq/compact CQE config Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 08/26] net/hinic3: add CIR drop statistics and VF LAG support Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 09/26] net/hinic3: add FEC mode get/set and capability support Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 10/26] net/hinic3: add mbox message recording and debug dump Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 11/26] net/hinic3: add COS mask and COS map support Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 12/26] net/hinic3: add VF link state and promiscuous support Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 13/26] net/hinic3: convert cmdq ops to static global variables Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 14/26] net/hinic3: update RSS hash type configuration Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 15/26] net/hinic3: refactor flow rule parsing Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 16/26] net/hinic3: add SP560 NIC type identification and handling Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 17/26] net/hinic3: add device kvargs parameters support Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 18/26] net/hinic3: add compact CQE Rx path and ptype table Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 19/26] net/hinic3: expand TSO from 127 to 255 segments Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 20/26] net/hinic3: split Tx burst function for compact CQE support Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 21/26] net/hinic3: ensure queue depth and state consistency Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 22/26] net/hinic3: add SP230 VF software statistics Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 23/26] net/hinic3: add Tx burst mode get Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 24/26] net/hinic3: expose Tx queue copied-mbuf statistics Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 25/26] net/hinic3: add pseudo-header checksum calculation Jiacheng Ye
2026-10-14 15:09   ` [PATCH v2 26/26] net/hinic3: add per-tile prefetch/drop/CEQ cmdq ops Jiacheng Ye
2026-10-14 17:13   ` [PATCH v2 00/26] net/hinic3: add PMD features and fixes Stephen Hemminger
2026-10-19 15:19   ` [PATCH v3 00/27] " Jiacheng Ye
2026-10-19 15:19     ` [PATCH 01/27] net/hinic3: fix SP230 VF PCI device ID Jiacheng Ye
2026-10-19 15:19     ` [PATCH 02/27] net/hinic3: fix double removal in ethertype flow destroy Jiacheng Ye
2026-10-19 15:19     ` [PATCH 03/27] net/hinic3: fix TCAM index leak on ethertype flow set Jiacheng Ye
2026-10-19 15:19     ` [PATCH 04/27] net/hinic3: fix VXLAN VNI spec and mask write Jiacheng Ye
2026-10-19 15:19     ` [PATCH 05/27] net/hinic3: fix vport enable null dereference Jiacheng Ye
2026-10-19 15:19     ` [PATCH 06/27] net/hinic3: attach ethdev and set ops in secondary process Jiacheng Ye
2026-10-19 15:19     ` [PATCH 07/27] net/hinic3: add NIC type identification Jiacheng Ye
2026-10-19 15:19     ` [PATCH 08/27] net/hinic3: add SP230 Rx queue interrupt handling Jiacheng Ye
2026-10-19 15:19     ` [PATCH 09/27] net/hinic3: fix offload and cmdq/compact CQE config Jiacheng Ye
2026-10-19 15:19     ` [PATCH 10/27] net/hinic3: add CIR drop statistics and VF LAG support Jiacheng Ye
2026-10-19 15:19     ` [PATCH 11/27] net/hinic3: add FEC mode get/set and capability support Jiacheng Ye
2026-10-19 15:19     ` [PATCH 12/27] net/hinic3: add mbox message recording and debug dump Jiacheng Ye
2026-10-19 15:19     ` [PATCH 13/27] net/hinic3: add COS mask and COS map support Jiacheng Ye
2026-10-19 15:19     ` [PATCH 14/27] net/hinic3: add VF link state and promiscuous support Jiacheng Ye
2026-10-19 15:19     ` [PATCH 15/27] net/hinic3: convert cmdq ops to static global variables Jiacheng Ye
2026-10-19 15:19     ` [PATCH 16/27] net/hinic3: update RSS hash type configuration Jiacheng Ye
2026-10-19 15:19     ` [PATCH 17/27] net/hinic3: refactor flow rule parsing Jiacheng Ye
2026-10-19 15:19     ` [PATCH 18/27] net/hinic3: add SP560 NIC type identification and handling Jiacheng Ye
2026-10-19 15:19     ` [PATCH 19/27] net/hinic3: add device kvargs parameters support Jiacheng Ye
2026-10-19 15:19     ` [PATCH 20/27] net/hinic3: add compact CQE Rx path and ptype table Jiacheng Ye
2026-10-19 15:19     ` [PATCH 21/27] net/hinic3: expand TSO from 127 to 255 segments Jiacheng Ye
2026-10-19 15:19     ` [PATCH 22/27] net/hinic3: split Tx burst function for compact CQE support Jiacheng Ye
2026-10-19 15:19     ` [PATCH 23/27] net/hinic3: ensure queue depth and state consistency Jiacheng Ye
2026-10-19 15:19     ` [PATCH 24/27] net/hinic3: add SP230 VF software statistics Jiacheng Ye
2026-10-19 15:19     ` [PATCH 25/27] net/hinic3: add Tx burst mode get Jiacheng Ye
2026-10-19 15:19     ` [PATCH 26/27] net/hinic3: expose Tx queue copied-mbuf statistics Jiacheng Ye
2026-10-19 15:19     ` [PATCH 27/27] net/hinic3: add pseudo-header checksum calculation Jiacheng Ye
2026-10-19 16:52     ` [PATCH v3 00/27] net/hinic3: add PMD features and fixes Stephen Hemminger
2026-10-23 15:56       ` jiachengye_123
2026-10-23 15:57     ` [PATCH v4 " Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 01/27] net/hinic3: fix SP230 VF PCI device ID Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 02/27] net/hinic3: fix double removal in ethertype flow destroy Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 03/27] net/hinic3: fix TCAM index leak on ethertype flow set Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 04/27] net/hinic3: fix VXLAN VNI spec and mask write Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 05/27] net/hinic3: fix vport enable null dereference Jiacheng Ye
2026-10-23 15:57       ` Jiacheng Ye [this message]
2026-10-23 15:57       ` [PATCH v4 07/27] net/hinic3: add NIC type identification Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 08/27] net/hinic3: fix pseudo-header checksum calculation Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 09/27] net/hinic3: add SP230 Rx queue interrupt handling Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 10/27] net/hinic3: fix offload and cmdq/compact CQE config Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 11/27] net/hinic3: add CIR drop statistics and VF LAG support Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 12/27] net/hinic3: add FEC mode get/set and capability support Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 13/27] net/hinic3: add mbox message recording and debug dump Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 14/27] net/hinic3: add COS mask and COS map support Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 15/27] net/hinic3: add VF link state and promiscuous support Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 16/27] net/hinic3: convert cmdq ops to static global variables Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 17/27] net/hinic3: update RSS hash type configuration Jiacheng Ye
2026-10-23 15:57       ` [PATCH v4 18/27] net/hinic3: refactor flow rule parsing Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 19/27] net/hinic3: add SP560 NIC type identification and handling Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 20/27] net/hinic3: add device kvargs parameters support Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 21/27] net/hinic3: add compact CQE Rx path and ptype table Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 22/27] net/hinic3: ensure queue depth and state consistency Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 23/27] net/hinic3: expand TSO from 127 to 255 segments Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 24/27] net/hinic3: split Tx burst function for compact CQE support Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 25/27] net/hinic3: add SP230 VF software statistics Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 26/27] net/hinic3: add Tx burst mode get Jiacheng Ye
2026-10-23 15:58       ` [PATCH v4 27/27] net/hinic3: expose Tx queue copied-mbuf statistics Jiacheng Ye
2026-10-23 16:21       ` [PATCH v4 00/27] net/hinic3: add PMD features and fixes Stephen Hemminger

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20261023155809.855-7-yejiacheng4@h-partners.com \
    --to=yejiacheng4@h-partners.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=wangfeifei40@huawei.com \
    /path/to/YOUR_REPLY

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

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