net/hinic: fix coredump when secondary process using the hinic port.

Message ID 19384408-c7b8-8140-2f92-a4fcc071715f@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/hinic: fix coredump when secondary process using the hinic port. |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS

Commit Message

Qingqing Li Nov. 2, 2020, 2:48 p.m. UTC
  the reason is that during the stage of secondary process port initialization,
it lacks the initialization of "eth_dev->dev_ops".

Signed-off-by: Qingqing Li <liqingqing3@huawei.com>
---
 drivers/net/hinic/hinic_pmd_ethdev.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
  

Comments

Ferruh Yigit Nov. 11, 2020, 1:07 p.m. UTC | #1
On 11/2/2020 2:48 PM, Qingqing Li wrote:
> the reason is that during the stage of secondary process port initialization,
> it lacks the initialization of "eth_dev->dev_ops".
> 
> Signed-off-by: Qingqing Li <liqingqing3@huawei.com>

Hi Ziyang, Guoyang, Xiaoyun,

The patch is around for a long time [1], can you please review the patch?

Review has been requested multiple times now, not sure why there is no response.

As 'hinic' driver maintainers, expectation is not just send patches to your 
driver, also review patches in the community, *at least* ones against your driver.

Thanks,
ferruh


[1]
https://patches.dpdk.org/patch/75318/
https://patches.dpdk.org/patch/75319/
[ There are a few more versions in between ]
https://patches.dpdk.org/patch/83174/
https://patches.dpdk.org/patch/83421/ [This one]
  
Ferruh Yigit Feb. 18, 2021, 5:54 p.m. UTC | #2
On 11/11/2020 1:07 PM, Ferruh Yigit wrote:
> On 11/2/2020 2:48 PM, Qingqing Li wrote:
>> the reason is that during the stage of secondary process port initialization,
>> it lacks the initialization of "eth_dev->dev_ops".
>>
>> Signed-off-by: Qingqing Li <liqingqing3@huawei.com>
> 
> Hi Ziyang, Guoyang, Xiaoyun,
> 
> The patch is around for a long time [1], can you please review the patch?
> 
> Review has been requested multiple times now, not sure why there is no response.
> 
> As 'hinic' driver maintainers, expectation is not just send patches to your 
> driver, also review patches in the community, *at least* ones against your driver.
> 
> Thanks,
> ferruh
> 
> 
> [1]
> https://patches.dpdk.org/patch/75318/
> https://patches.dpdk.org/patch/75319/
> [ There are a few more versions in between ]
> https://patches.dpdk.org/patch/83174/
> https://patches.dpdk.org/patch/83421/ [This one]


Hi Ziyang, Guoyang, Xiaoyun,

What is the latest status of this patch?
  

Patch

diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index b694fd83c..786095e9d 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -3100,14 +3100,6 @@  static int hinic_func_init(struct rte_eth_dev *eth_dev)

 	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;
-	}
-
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;

 	nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
@@ -3241,6 +3233,20 @@  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);
 }