From c0f8d50d1c3930c560f244b66c6820879be9297c Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 10 Jan 2019 16:33:39 +0000 Subject: [PATCH] vfio: do not unregister callback in secondary process Callbacks are only registered in the primary, so do not attempt to unregister callbacks in secondary processes. Fixes: 43e463137154 ("vfio: support memory event callbacks") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 0516b1597b..72cc65151e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -857,7 +857,8 @@ rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, /* if there are no active device groups, unregister the callback to * avoid spurious attempts to map/unmap memory from VFIO. */ - if (vfio_cfg == default_vfio_cfg && vfio_cfg->vfio_active_groups == 0) + if (vfio_cfg == default_vfio_cfg && vfio_cfg->vfio_active_groups == 0 && + rte_eal_process_type() != RTE_PROC_SECONDARY) rte_mem_event_callback_unregister(VFIO_MEM_EVENT_CLB_NAME, NULL); -- 2.20.1