[v2,6/8] eal: vfio: cleanup the mp sync handle
Checks
Commit Message
When rte_eal_cleanup is called the rte_mp_action for VFIO
should be freed.
Fixes: edf73dd33072 ("ipc: handle unsupported IPC in action register")
Cc: anatoly.burakov@intel.com
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/librte_eal/linux/eal.c | 3 +++
lib/librte_eal/linux/eal_vfio.h | 1 +
lib/librte_eal/linux/eal_vfio_mp_sync.c | 8 ++++++++
3 files changed, 12 insertions(+)
@@ -1346,6 +1346,9 @@ rte_eal_cleanup(void)
}
rte_service_finalize();
+#ifdef VFIO_PRESENT
+ vfio_mp_sync_cleanup();
+#endif
rte_eal_alarm_cleanup();
rte_mp_channel_cleanup();
rte_trace_save();
@@ -132,6 +132,7 @@ int
vfio_has_supported_extensions(int vfio_container_fd);
int vfio_mp_sync_setup(void);
+void vfio_mp_sync_cleanup(void);
#define EAL_VFIO_MP "eal_vfio_mp_sync"
@@ -120,4 +120,12 @@ vfio_mp_sync_setup(void)
return 0;
}
+void
+vfio_mp_sync_cleanup(void)
+{
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return;
+
+ rte_mp_action_unregister(EAL_VFIO_MP);
+}
#endif