DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/hinic: fix coredump when secondary process using the hinic port.
@ 2020-08-08  7:20 liqingqing
  2020-08-08  7:45 ` [dpdk-dev] [PATCH v2] net/hinic: fix secondary process's using coredump liqingqing
  0 siblings, 1 reply; 6+ messages in thread
From: liqingqing @ 2020-08-08  7:20 UTC (permalink / raw)
  To: dev, xuanziyang2, cloud.wangxiaoyun, zhouguoyang
  Cc: Hushiyuan, wangshuo47, Liusirui

From 2eb6ad4d30af54f309f35f16a39a119aa26e7911 Mon Sep 17 00:00:00 2001
From: liqingqing <liqingqing3@huawei.com>
Date: Sat, 8 Aug 2020 00:03:25 -0400
Subject: [PATCH] fix coredump when secondary process using the hinic port. the
 reason is that during the stage of secondary process port initialization, it
 lack the initialization of "eth_dev->dev_ops".

Signed-off-by: liqingqing <liqingqing3@huawei.com>
---
 drivers/net/hinic/hinic_pmd_ethdev.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 67e6afcf7..26c6098d3 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -3060,15 +3060,6 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev)
 	int rc;

 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
-
-	/* EAL is SECONDARY and eth_dev is already created */
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
-		PMD_DRV_LOG(INFO, "Initialize %s in secondary process",
-			    eth_dev->data->name);
-
-		return 0;
-	}
-
 	nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
 	memset(nic_dev, 0, sizeof(*nic_dev));

@@ -3206,6 +3197,18 @@ static int hinic_dev_init(struct rte_eth_dev *eth_dev)
 	eth_dev->rx_pkt_burst = hinic_recv_pkts;
 	eth_dev->tx_pkt_burst = hinic_xmit_pkts;

+	/* EAL is SECONDARY and eth_dev is already created */
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+		PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name);
+
+		struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
+		if (HINIC_IS_VF(nic_dev->hwdev))
+			eth_dev->dev_ops = &hinic_pmd_vf_ops;
+		else
+			eth_dev->dev_ops = &hinic_pmd_ops;
+		return 0;
+	}
+
 	return hinic_func_init(eth_dev);
 }

-- 
2.19.1



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

end of thread, other threads:[~2020-10-13  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08  7:20 [dpdk-dev] [PATCH] net/hinic: fix coredump when secondary process using the hinic port liqingqing
2020-08-08  7:45 ` [dpdk-dev] [PATCH v2] net/hinic: fix secondary process's using coredump liqingqing
2020-09-01 11:44   ` Ferruh Yigit
2020-09-14 13:21     ` Ferruh Yigit
     [not found]   ` <12de74a8-9b1c-d664-0ea3-89c80f69b9e2@huawei.com>
     [not found]     ` <f3b34a16-9fca-e2e2-d11a-7f55c35268de@huawei.com>
2020-10-09  7:47       ` [dpdk-dev] [PATCH v3] " l00283554
2020-10-13  8:46         ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).