Skip to content

Commit

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

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 cpaelzer committed Feb 25, 2022
1 parent e24d07f commit dcae278
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/eal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,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();
eal_cleanup_config(&internal_config);
return 0;
Expand Down
1 change: 1 addition & 0 deletions lib/librte_eal/linux/eal/eal_vfio.h
Original file line number Diff line number Diff line change
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/eal_vfio_mp_sync.c
Original file line number Diff line number Diff line change
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 dcae278

Please sign in to comment.