DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal/linux: register mp hotplug callback after memory init
@ 2023-05-31  6:55 Zhihong Wang
  2023-06-01 12:26 ` Burakov, Anatoly
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Zhihong Wang @ 2023-05-31  6:55 UTC (permalink / raw)
  To: dev, anatoly.burakov, qi.z.zhang; +Cc: Zhihong Wang

Secondary would crash if it tries to handle mp requests before memory
init, since globals such as eth_dev_shared_data_lock are not accessible
to it at this moment.
---
 lib/eal/linux/eal.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index ae323cd492..a74d564597 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1058,12 +1058,6 @@ rte_eal_init(int argc, char **argv)
 		}
 	}
 
-	/* register multi-process action callbacks for hotplug */
-	if (eal_mp_dev_hotplug_init() < 0) {
-		rte_eal_init_alert("failed to register mp callback for hotplug");
-		return -1;
-	}
-
 	if (rte_bus_scan()) {
 		rte_eal_init_alert("Cannot scan the buses for devices");
 		rte_errno = ENODEV;
@@ -1221,6 +1215,12 @@ rte_eal_init(int argc, char **argv)
 		return -1;
 	}
 
+	/* register multi-process action callbacks for hotplug after memory init */
+	if (eal_mp_dev_hotplug_init() < 0) {
+		rte_eal_init_alert("failed to register mp callback for hotplug");
+		return -1;
+	}
+
 	if (rte_eal_tailqs_init() < 0) {
 		rte_eal_init_alert("Cannot init tail queues for objects");
 		rte_errno = EFAULT;
-- 
2.11.0


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

end of thread, other threads:[~2023-06-08  8:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31  6:55 [PATCH] eal/linux: register mp hotplug callback after memory init Zhihong Wang
2023-06-01 12:26 ` Burakov, Anatoly
2023-06-02  3:33   ` [External] " 王志宏
2023-06-02 13:10     ` Burakov, Anatoly
2023-06-02 13:10 ` Burakov, Anatoly
2023-06-07 20:21 ` David Marchand
2023-06-08  7:29   ` [External] " 王志宏
2023-06-08  7:25 ` [PATCH v2] " Zhihong Wang
2023-06-08  8:08   ` David Marchand

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).