> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Monday, April 24, 2023 9:41 PM
> To: David Marchand <david.march...@redhat.com>
> Cc: Burakov, Anatoly <anatoly.bura...@intel.com>; Gupta, Nipun
> <nipun.gu...@amd.com>; dev@dpdk.org; tho...@monjalon.net; Yigit, Ferruh
> <ferruh.yi...@amd.com>; Agarwal, Nikhil <nikhil.agar...@amd.com>
> Subject: Re: [PATCH v2] vfio: do not coalesce DMA mappings
>
>
> On Mon, 24 Apr 2023 17:22:46 +0200
> David Marchand <david.march...@redhat.com> wrote:
>
> > > >
> > >
> > > Thanks, I can reproduce this issue with regular devices too (run testpmd
> > > with no devices, bind a NIC to VFIO, attach it, then quit). You're
> > > correct in that since the initial mapping was done with mapping large
> > > contiguous zones (such as when mempools are created before attach), any
> > > subsequent freeing of memory will cause these errors to happen.
> > >
> > > I don't think this can be fixed by anything other than not doing the
> > > contiguous mapping thing, so provisionally, I think this patch should be
> > > accepted. I'll play around with it some more and get back to you :)
> >
> > Can we conclude on this topic?
> > It is best we merge this kind of change the sooner possible for a release.
> >
> > Thanks.
>
> Shouldn't the coalesced mappings be able to have correct datastructure
> (accounting) so that on shutdown the unmap's are done for the right size?
This issue occurs only on the hotplug case. Other devices which are not hot
plugged
and are existing from the start of the application need to have individual (non-
coalesced) mappings. So individual (non-coalesced) mappings are definitely
required. IMO we should not maintain separate mapping for each hot-plugged
device as it would be unrequired overhead.
Regards,
Nipun