Re: [PATCH RFC v2 0/3] Add set_dev_data and unset_dev_data support

From: Nicolin Chen
Date: Fri Apr 21 2023 - 03:57:25 EST


On Fri, Apr 21, 2023 at 07:47:13AM +0000, Tian, Kevin wrote:

> > It is in the commit message of the cover-letter though:
> > https://github.com/nicolinc/iommufd/commit/5e17d270bfca2a5e3e7401d4b
> > f58ae53eb7a8a55
> > --------------------------------------------------------
> > Changelog
> > v2:
> > * Integrated the uAPI into VFIO_DEVICE_BIND_IOMMUFD call
> > * Renamed the previous set_rid_user to set_dev_data, to decouple from
> > the PCI regime.
> > v1:
> > https://lore.kernel.org/all/cover.1680762112.git.nicolinc@xxxxxxxxxx/
> > --------------------------------------------------------
> >
> > > Could you add some words why changing from passing the information
> > > in an iommufd ioctl to bind_iommufd? My gut-feeling leans toward
> > > the latter option...
> >
> > Yea. Jason told me to decouple it from PCI. And merge it into
> > a general uAPI. So I picked the BIND ioctl.
> >
>
> 'decouple it from PCI' is kind of covered by renaming set_rid
> to set_data. but I didn't get why this has to be merged with another
> uAPI. Once iommufd_device is created we could have separate
> ioctls to poke its attributes individually. What'd be broken if this
> is not done at BIND time?

Oh, sorry. He didn't literally told me to merge, but commented
"make sense" at my proposal of reusing BIND. So, I don't think
adding to the BIND is a must here.

The BIND is done in vfio_realize() where the RID (dev_data) is
available also. And the new uAPI in my v1 actually gets called
near the BIND. So, I feel we may just do it once? I am open to
a better idea.

Thanks
Nic