[PATCH 21.11] eal: cleanup alarm and hotplug before memory detach

Fengnan Chang changfengnan at bytedance.com
Thu Mar 16 12:48:18 CET 2023


Alarm and multiprocess hotplug still need access hugepage memory,
if alarm event processed after memory detach, it may cause SEGV.
So cleanup alarm and multiprocess hotplug before memory detach.

Signed-off-by: Fengnan Chang <changfengnan at bytedance.com>
---
 lib/eal/freebsd/eal.c | 2 +-
 lib/eal/linux/eal.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 414aad3dd3..717d1f0b9a 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -988,9 +988,9 @@ rte_eal_cleanup(void)
 	rte_mp_channel_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	return 0;
 }
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index e3d34f7b7c..84c42679bf 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1370,9 +1370,9 @@ rte_eal_cleanup(void)
 	rte_mp_channel_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	return 0;
 }
-- 
2.37.1 (Apple Git-137.1)



More information about the dev mailing list