DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fengnan Chang <changfengnan@bytedance.com>
To: thomas@monjalon.net, david.marchand@redhat.com
Cc: dev@dpdk.org, Fengnan Chang <changfengnan@bytedance.com>
Subject: [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach
Date: Wed, 21 Dec 2022 11:41:52 +0800	[thread overview]
Message-ID: <20221221034152.30628-1-changfengnan@bytedance.com> (raw)

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.

Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle")
Fixes: a0cc7be20dd1 ("mem: cleanup multiprocess resources")

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

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 1b58cd3da6..83b99c601f 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -897,9 +897,9 @@ rte_eal_cleanup(void)
 	eal_bus_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 8c118d0d9f..c76f026023 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1372,11 +1372,11 @@ rte_eal_cleanup(void)
 	eal_bus_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	eal_mp_dev_hotplug_cleanup();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	eal_mp_dev_hotplug_cleanup();
 	rte_eal_malloc_heap_cleanup();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	rte_eal_log_cleanup();
 	return 0;
-- 
2.37.0 (Apple Git-136)


             reply	other threads:[~2022-12-21 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  3:41 Fengnan Chang [this message]
2023-01-06  3:00 ` Fengnan Chang
2023-01-29  9:58   ` Fengnan Chang
2023-02-15 15:08 ` Thomas Monjalon
  -- strict thread matches above, loose matches on Subject: below --
2022-12-13  7:59 [PATCH] " Fengnan Chang
2023-02-09 12:03 ` [PATCH v2] " Fengnan Chang
2023-02-09 12:09 ` Fengnan Chang
2023-02-09 12:45 ` Fengnan Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221221034152.30628-1-changfengnan@bytedance.com \
    --to=changfengnan@bytedance.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).