Hi Dave, This is my first submission... how do I get the fixes reference?
Back porting it to 19.11 would be great. This issue shows up in SPDK 20.01, which uses 19.11. -- Michael -----Original Message----- From: David Marchand [mailto:[email protected]] Sent: Monday, April 6, 2020 7:25 AM To: Burakov, Anatoly <[email protected]>; Haeuptle, Michael <[email protected]> Cc: dev <[email protected]> Subject: Re: [dpdk-dev] [PATCH] eal: Fixes VFIO/sysfs race condition On Thu, Apr 2, 2020 at 12:11 PM Burakov, Anatoly <[email protected]> wrote: > > On 31-Mar-20 5:56 PM, Michael Haeuptle wrote: > > This fix treats a 0 return value from vfio_open_group_fd in > > vfio_get_group_fd as the intended error condition instead of putting > > an incorrect 0 file descriptor in the vfio_group table. > > > > Sometimes, the creation of device files in sysfs is not > > instantaneously causing vfio_open_groupfd to return 0. > > This has been observed when hot removing/adding multiple NVMe > > devices (>=4). > > > > Signed-off-by: Michael Haeuptle <[email protected]> > > --- > > lib/librte_eal/linux/eal_vfio.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/linux/eal_vfio.c > > b/lib/librte_eal/linux/eal_vfio.c index 4502aefed..1979f6fdd 100644 > > --- a/lib/librte_eal/linux/eal_vfio.c > > +++ b/lib/librte_eal/linux/eal_vfio.c > > @@ -379,7 +379,7 @@ vfio_get_group_fd(struct vfio_config *vfio_cfg, > > } > > > > vfio_group_fd = vfio_open_group_fd(iommu_group_num); > > - if (vfio_group_fd < 0) { > > + if (vfio_group_fd <= 0) { > > RTE_LOG(ERR, EAL, "Failed to open group %d\n", > > iommu_group_num); > > return -1; > > } > > > > If it's returning an invalid value, is that a kernel bug? > > I mean, looks fine to me, so > > Acked-by: Anatoly Burakov <[email protected]> We are missing a fixes line. Does this deserve a backport? -- David Marchand

