From f3b783281de8752bf41958121ed15ea71473661a Mon Sep 17 00:00:00 2001 From: jiangheng12 Date: Tue, 7 Feb 2023 21:41:40 +0800 Subject: [PATCH] hinic fix crash in secondary process --- dpdk.spec | 6 ++- ...hinic-fix-crash-in-secondary-process.patch | 46 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 net-hinic-fix-crash-in-secondary-process.patch diff --git a/dpdk.spec b/dpdk.spec index 8dfd5ac..5f30b0f 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 19.11 -Release: 25 +Release: 26 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 19.11 @@ -54,6 +54,7 @@ Patch6005: backport-gro-trim-tail-padding-bytes.patch Patch6006: backport-gro-check-payload-length-after-trim.patch Patch6007: backport-net-hinic-fix-crash-in-secondary-process.patch Patch6008: fix-virtio-hardthrough-scenes-device-init-bug.patch +Patch6009: net-hinic-fix-crash-in-secondary-process.patch Summary: Data Plane Development Kit core Group: System Environment/Libraries @@ -223,6 +224,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko /usr/sbin/depmod %changelog +* Tue Feb 7 2023 jiangheng - 19.11-26 +- fix hinic crash in secondary process + * Sat Dec 3 2022 wangzongchao - 19.11-25 - fix the virtio hardthrough scenes device init bug diff --git a/net-hinic-fix-crash-in-secondary-process.patch b/net-hinic-fix-crash-in-secondary-process.patch new file mode 100644 index 0000000..45cab49 --- /dev/null +++ b/net-hinic-fix-crash-in-secondary-process.patch @@ -0,0 +1,46 @@ +From 4c670dfaa417bc5604c9c58b505a74e2725acdb2 Mon Sep 17 00:00:00 2001 +From: Guoyang Zhou +Date: Tue, 23 Mar 2021 21:17:51 +0800 +Subject: [PATCH] net/hinic: fix crash in secondary process + +Some apps, such as fstack, will use secondary process to access the +memory of eth_dev_ops, and they want to get the info of dev, but hinic +driver does not initialized it when in secondary process. + +Fixes: 66f64dd6dc86 ("net/hinic: fix secondary process") +Cc: stable@dpdk.org + +Signed-off-by: Guoyang Zhou + +Conflict: remove mutex timeout modify +Reference: https://github.com/DPDK/dpdk/commit/4c670dfaa +--- + drivers/net/hinic/hinic_pmd_ethdev.c | 5 +++++ + 2 files changed, 13 insertions(+), 17 deletions(-) + +diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c +index 2352dd1615..b5a36a863b 100644 +--- a/drivers/net/hinic/hinic_pmd_ethdev.c ++++ b/drivers/net/hinic/hinic_pmd_ethdev.c +@@ -3063,6 +3063,10 @@ static const struct eth_dev_ops hinic_pmd_vf_ops = { + .flow_ops_get = hinic_dev_flow_ops_get, + }; + ++static const struct eth_dev_ops hinic_dev_sec_ops = { ++ .dev_infos_get = hinic_dev_infos_get, ++}; ++ + static int hinic_func_init(struct rte_eth_dev *eth_dev) + { + struct rte_pci_device *pci_dev; +@@ -3077,6 +3081,7 @@ static int hinic_func_init(struct rte_eth_dev *eth_dev) + + /* EAL is SECONDARY and eth_dev is already created */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { ++ eth_dev->dev_ops = &hinic_dev_sec_ops; + PMD_DRV_LOG(INFO, "Initialize %s in secondary process", + eth_dev->data->name); + +-- +2.23.0 + -- Gitee