From: Anatoly Burakov Date: Tue, 10 Apr 2018 10:23:30 +0000 (+0100) Subject: vfio: fix device hotplug when several devices per group X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=08a20b3d37e4e648e1b57b6df2dd05558a987965;p=dpdk.git vfio: fix device hotplug when several devices per group We only need to perform DMA mapping for first device in first group. At the time of mapping, we haven't yet added the device into the group, so the count is expected to be zero. Fixes: 810bfa64c673 ("vfio: fix index for tracking devices in a group") Fixes: a9c349e3a100 ("vfio: fix device unplug when several devices per group") Fixes: 94c0776b1bad ("vfio: support hotplug") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 984b1a123a..16ee7302ae 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -615,7 +615,8 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, * functionality. */ if (internal_config.process_type == RTE_PROC_PRIMARY && - vfio_cfg.vfio_active_groups == 1) { + vfio_cfg.vfio_active_groups == 1 && + vfio_group_device_count(vfio_group_fd) == 0) { const struct vfio_iommu_type *t; /* select an IOMMU type which we will be using */