mbox series

[0/3] add VFIO mdev support for DFL devices

Message ID 1599549212-24253-1-git-send-email-yilun.xu@intel.com (mailing list archive)
Headers show
Series add VFIO mdev support for DFL devices | expand

Message

Xu Yilun Sept. 8, 2020, 7:13 a.m. UTC
These patches depend on the patchset: "Modularization of DFL private
feature drivers" & "add dfl bus support to MODULE_DEVICE_TABLE()"

https://lore.kernel.org/linux-fpga/1599488581-16386-1-git-send-email-yilun.xu@intel.com/

This patchset provides an VFIO Mdev driver for dfl devices. It makes
possible for dfl devices be direct accessed from userspace.

Xu Yilun (3):
  fpga: dfl: add driver_override support
  fpga: dfl: VFIO mdev support for DFL devices
  Documentation: fpga: dfl: Add description for VFIO Mdev support

 Documentation/ABI/testing/sysfs-bus-dfl |  20 ++
 Documentation/fpga/dfl.rst              |  20 ++
 drivers/fpga/Kconfig                    |   9 +
 drivers/fpga/Makefile                   |   1 +
 drivers/fpga/dfl.c                      |  54 ++++-
 drivers/fpga/vfio-mdev-dfl.c            | 391 ++++++++++++++++++++++++++++++++
 include/linux/fpga/dfl-bus.h            |   2 +
 7 files changed, 496 insertions(+), 1 deletion(-)
 create mode 100644 drivers/fpga/vfio-mdev-dfl.c

Comments

Tom Rix Sept. 9, 2020, 9:13 p.m. UTC | #1
This is a new interface, the documentation needs to go

into greater detail. I am particularly interested in the user workflow.

This seems like it would work only for kernel modules. 

Please describe both in the documentation.

A sample of a user mode driver would be helpful.

Is putting driver_override using sysfs for each device scalable ? would a list sets of {feature id,files}'s the vfio driver respond to better ? 

To be consistent the mdev driver file name should be dfl-vfio-mdev.c

There should be an opt-in flag for drivers being overridden instead of blanket approval of all drivers.

Tom

On 9/8/20 12:13 AM, Xu Yilun wrote:
> These patches depend on the patchset: "Modularization of DFL private
> feature drivers" & "add dfl bus support to MODULE_DEVICE_TABLE()"
>
> https://lore.kernel.org/linux-fpga/1599488581-16386-1-git-send-email-yilun.xu@intel.com/
>
> This patchset provides an VFIO Mdev driver for dfl devices. It makes
> possible for dfl devices be direct accessed from userspace.
>
> Xu Yilun (3):
>   fpga: dfl: add driver_override support
>   fpga: dfl: VFIO mdev support for DFL devices
>   Documentation: fpga: dfl: Add description for VFIO Mdev support
>
>  Documentation/ABI/testing/sysfs-bus-dfl |  20 ++
>  Documentation/fpga/dfl.rst              |  20 ++
>  drivers/fpga/Kconfig                    |   9 +
>  drivers/fpga/Makefile                   |   1 +
>  drivers/fpga/dfl.c                      |  54 ++++-
>  drivers/fpga/vfio-mdev-dfl.c            | 391 ++++++++++++++++++++++++++++++++
>  include/linux/fpga/dfl-bus.h            |   2 +
>  7 files changed, 496 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/fpga/vfio-mdev-dfl.c
>
Xu Yilun Sept. 10, 2020, 9:08 a.m. UTC | #2
Hi tom:

The generic workflow of mdev is described in
Documentation/driver-api/vfio-mediated-device.rst, I could also share
some code offline.

But now I got the comments from Alex that it may not suitable we
implement the mdev for dfl devices. I think we need to first of all
reconsider the design.

Thanks,
Yilun 

On Wed, Sep 09, 2020 at 02:13:59PM -0700, Tom Rix wrote:
> This is a new interface, the documentation needs to go
> 
> into greater detail. I am particularly interested in the user workflow.
> 
> This seems like it would work only for kernel modules. 
> 
> Please describe both in the documentation.
> 
> A sample of a user mode driver would be helpful.
> 
> Is putting driver_override using sysfs for each device scalable ? would a list sets of {feature id,files}'s the vfio driver respond to better ? 
> 
> To be consistent the mdev driver file name should be dfl-vfio-mdev.c
> 
> There should be an opt-in flag for drivers being overridden instead of blanket approval of all drivers.
> 
> Tom
> 
> On 9/8/20 12:13 AM, Xu Yilun wrote:
> > These patches depend on the patchset: "Modularization of DFL private
> > feature drivers" & "add dfl bus support to MODULE_DEVICE_TABLE()"
> >
> > https://lore.kernel.org/linux-fpga/1599488581-16386-1-git-send-email-yilun.xu@intel.com/
> >
> > This patchset provides an VFIO Mdev driver for dfl devices. It makes
> > possible for dfl devices be direct accessed from userspace.
> >
> > Xu Yilun (3):
> >   fpga: dfl: add driver_override support
> >   fpga: dfl: VFIO mdev support for DFL devices
> >   Documentation: fpga: dfl: Add description for VFIO Mdev support
> >
> >  Documentation/ABI/testing/sysfs-bus-dfl |  20 ++
> >  Documentation/fpga/dfl.rst              |  20 ++
> >  drivers/fpga/Kconfig                    |   9 +
> >  drivers/fpga/Makefile                   |   1 +
> >  drivers/fpga/dfl.c                      |  54 ++++-
> >  drivers/fpga/vfio-mdev-dfl.c            | 391 ++++++++++++++++++++++++++++++++
> >  include/linux/fpga/dfl-bus.h            |   2 +
> >  7 files changed, 496 insertions(+), 1 deletion(-)
> >  create mode 100644 drivers/fpga/vfio-mdev-dfl.c
> >