Skip to content

Commit

Permalink
vfio: cleanup the multiprocess sync handle
Browse files Browse the repository at this point in the history
[ upstream commit 6412941 ]

When rte_eal_cleanup is called the rte_mp_action for VFIO
should be freed.

Fixes: edf73dd ("ipc: handle unsupported IPC in action register")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
shemminger authored and bluca committed Feb 17, 2022
1 parent 184d1f7 commit 468cbff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/librte_eal/linux/eal.c
Expand Up @@ -1360,7 +1360,11 @@ rte_eal_cleanup(void)

if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_memseg_walk(mark_freeable, NULL);

rte_service_finalize();
#ifdef VFIO_PRESENT
vfio_mp_sync_cleanup();
#endif
rte_mp_channel_cleanup();
rte_trace_save();
eal_trace_fini();
Expand Down
1 change: 1 addition & 0 deletions lib/librte_eal/linux/eal_vfio.h
Expand Up @@ -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"

Expand Down
8 changes: 8 additions & 0 deletions lib/librte_eal/linux/eal_vfio_mp_sync.c
Expand Up @@ -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

0 comments on commit 468cbff

Please sign in to comment.