Re: [PATCH] vfio/mtty: Enforce available_instances

From: Alex Williamson
Date: Mon Jun 28 2021 - 16:10:05 EST


On Tue, 29 Jun 2021 01:22:00 +0530
Kirti Wankhede <kwankhede@xxxxxxxxxx> wrote:

> On 6/29/2021 12:26 AM, Alex Williamson wrote:
> > On Mon, 28 Jun 2021 23:19:54 +0530
> > Kirti Wankhede <kwankhede@xxxxxxxxxx> wrote:
> >
> >> On 6/26/2021 2:56 AM, Alex Williamson wrote:
> >>> The sample mtty mdev driver doesn't actually enforce the number of
> >>> device instances it claims are available. Implement this properly.
> >>>
> >>> Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
> >>> ---
> >>>
> >>> Applies to vfio next branch + Jason's atomic conversion
> >>>
> >>
> >>
> >> Does this need to be on top of Jason's patch?
> >
> > Yes, see immediately above.
> >
> >> Patch to use mdev_used_ports is reverted here, can it be changed from
> >> mdev_devices_list to mdev_avail_ports atomic variable?
> >
> > It doesn't revert Jason's change, it builds on it. The patches could
> > we squashed, but there's no bug in Jason's patch that we're trying to
> > avoid exposing, so I don't see why we'd do that.
> >
>
> 'Squashed' is the correct word that 'revert', my bad.
>
> >> Change here to use atomic variable looks good to me.
> >>
> >> Reviewed by: Kirti Wankhede <kwankhede@xxxxxxxxxx>
> >
> > Thanks! It was Jason's patch[1] that converted to use an atomic
> > though, so I'm slightly confused if this R-b is for the patch below,
> > Jason's patch, or both. Thanks,
>
> I liked 'mdev_avail_ports' approach than 'mdev_used_ports' approach
> here. This R-b is for below patch.

Got it, added. Thanks Kirti!