]> git.droids-corp.org - dpdk.git/commitdiff
eal: cleanup multiprocess hotplug resources
authorStephen Hemminger <stephen@networkplumber.org>
Sat, 13 Nov 2021 17:22:56 +0000 (09:22 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 11 Feb 2022 18:49:22 +0000 (19:49 +0100)
When rte_eal_cleanup is called, hotplug should unregister the
resources associated with the multi-process server.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/eal/common/hotplug_mp.c
lib/eal/common/hotplug_mp.h
lib/eal/linux/eal.c

index bf55056f59c0136063ae2160aedbf4f4c5a6977d..bde0de196ef5c3ea6d1bae203754605026d66571 100644 (file)
@@ -462,3 +462,8 @@ int eal_mp_dev_hotplug_init(void)
 
        return 0;
 }
+
+void eal_mp_dev_hotplug_cleanup(void)
+{
+       rte_mp_action_unregister(EAL_DEV_MP_ACTION_REQUEST);
+}
index 8fcf9b52e24c19ad33a34397a9e760b305e9173a..4848446c852dfe6a5cc5a22f9722b337d43283ac 100644 (file)
@@ -37,6 +37,12 @@ struct eal_dev_mp_req {
 int
 eal_mp_dev_hotplug_init(void);
 
+/**
+ * Unregister all mp action callbacks for hotplug.
+ */
+void
+eal_mp_dev_hotplug_cleanup(void);
+
 /**
  * This is a synchronous wrapper for secondary process send
  * request to primary process, this is invoked when an attach
index d77cd871beed6557d91f7da17456a349eec64565..5583ba9f377388fc5741e46f69228ab5cf4f0b03 100644 (file)
@@ -1284,6 +1284,7 @@ rte_eal_cleanup(void)
        rte_mp_channel_cleanup();
        /* after this point, any DPDK pointers will become dangling */
        rte_eal_memory_detach();
+       eal_mp_dev_hotplug_cleanup();
        rte_eal_alarm_cleanup();
        rte_trace_save();
        eal_trace_fini();