]> git.droids-corp.org - dpdk.git/commitdiff
vfio: cleanup the multiprocess sync handle
authorStephen Hemminger <stephen@networkplumber.org>
Sat, 13 Nov 2021 17:22:55 +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 the rte_mp_action for VFIO
should be freed.

Fixes: edf73dd33072 ("ipc: handle unsupported IPC in action register")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/eal/linux/eal.c
lib/eal/linux/eal_vfio.h
lib/eal/linux/eal_vfio_mp_sync.c

index fad062a2dd0e2b0b9c105fa0a3374cabc96b9667..d77cd871beed6557d91f7da17456a349eec64565 100644 (file)
@@ -1276,7 +1276,11 @@ rte_eal_cleanup(void)
        if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
                        internal_conf->hugepage_file.unlink_existing)
                rte_memseg_walk(mark_freeable, NULL);
+
        rte_service_finalize();
+#ifdef VFIO_PRESENT
+       vfio_mp_sync_cleanup();
+#endif
        rte_mp_channel_cleanup();
        /* after this point, any DPDK pointers will become dangling */
        rte_eal_memory_detach();
index c5d5f70548405920bfa1a82384ffed88f3d912fc..bba5c7afa59c4501b7591d1c680ec3fc26a78610 100644 (file)
@@ -133,6 +133,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"
 
index a2accfab3a3853c968208f7688b00b229002be30..d12bbaee648b6bcaa75f9b9ffb8e122e5e42abaa 100644 (file)
@@ -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