[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3520b43d-ae3a-5c22-232a-5feedd7576e9@amd.com>
Date: Fri, 2 Jun 2023 15:05:51 -0700
From: Brett Creeley <bcreeley@....com>
To: Jason Gunthorpe <jgg@...dia.com>, Brett Creeley <brett.creeley@....com>
Cc: kvm@...r.kernel.org, netdev@...r.kernel.org, alex.williamson@...hat.com,
yishaih@...dia.com, shameerali.kolothum.thodi@...wei.com,
kevin.tian@...el.com, shannon.nelson@....com, drivers@...sando.io
Subject: Re: [PATCH v9 vfio 2/7] vfio/pds: Initial support for pds_vfio VFIO
driver
On 5/4/2023 10:31 AM, Jason Gunthorpe wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> On Fri, Apr 21, 2023 at 06:06:37PM -0700, Brett Creeley wrote:
>
>> +static const struct vfio_device_ops
>> +pds_vfio_ops = {
>> + .name = "pds-vfio",
>> + .init = pds_vfio_init_device,
>> + .release = vfio_pci_core_release_dev,
>> + .open_device = pds_vfio_open_device,
>> + .close_device = vfio_pci_core_close_device,
>> + .ioctl = vfio_pci_core_ioctl,
>> + .device_feature = vfio_pci_core_ioctl_feature,
>> + .read = vfio_pci_core_read,
>> + .write = vfio_pci_core_write,
>> + .mmap = vfio_pci_core_mmap,
>> + .request = vfio_pci_core_request,
>> + .match = vfio_pci_core_match,
>> + .bind_iommufd = vfio_iommufd_physical_bind,
>> + .unbind_iommufd = vfio_iommufd_physical_unbind,
>> + .attach_ioas = vfio_iommufd_physical_attach_ioas,
>> +};
>> +
>> +const struct vfio_device_ops *
>> +pds_vfio_ops_info(void)
>> +{
>> + return &pds_vfio_ops;
>> +}
>
> No reason for a function like this
>
> It is a bit strange to split up the driver files so the registration is in a
> different file than the ops implementation.
The reason I did this was to separate the pci functionality from the
vfio device functionality. There are other similar examples of uses like
this. I ended up not changing this for v10 because it was intentional
due to the reason I stated above.
>
> Jason
Powered by blists - more mailing lists