[RFC,v2,0/5] Add mdev (Mediated device) support in DPDK
mbox series

Message ID 20190715075214.16616-1-tiwei.bie@intel.com
Headers show
Series
  • Add mdev (Mediated device) support in DPDK
Related show

Message

Tiwei Bie July 15, 2019, 7:52 a.m. UTC
Hi everyone,

This is a draft implementation of the mdev (Mediated device [1])
support in DPDK PCI bus driver. Mdev is a way to virtualize devices
in Linux kernel. Based on the device-api (mdev_type/device_api),
there could be different types of mdev devices (e.g. vfio-pci).
In this RFCv2, the PCI bus driver is extended to support scanning
and probing the mdev devices whose device-api is "vfio-pci".

                     +---------+
                     | PCI bus |
                     +----+----+
                          |
         +--------+-------+-------+--------+
         |        |               |        |
  Physical PCI devices ...   Mediated PCI devices ...

RFCv2:
- Let PCI bus scan mediated PCI devices directly
- Address Keith's comments
- Merge below patch into this series (David)
   http://patches.dpdk.org/patch/55927/
- Add internal representation of PCI device (David)
- Minor fixes and improvements

[1] https://github.com/torvalds/linux/blob/master/Documentation/vfio-mediated-device.txt

Thanks,
Tiwei

Tiwei Bie (5):
  bus/pci: introduce an internal representation of PCI device
  bus/pci: avoid depending on private value in kernel source
  bus/pci: introduce helper for MMIO read and write
  eal: add a helper for reading string from sysfs
  bus/pci: add mdev support

 drivers/bus/pci/bsd/pci.c               |  36 ++-
 drivers/bus/pci/linux/Makefile          |   1 +
 drivers/bus/pci/linux/pci.c             | 105 ++++++--
 drivers/bus/pci/linux/pci_init.h        |  29 ++-
 drivers/bus/pci/linux/pci_uio.c         |  22 ++
 drivers/bus/pci/linux/pci_vfio.c        | 314 ++++++++++++++++++++----
 drivers/bus/pci/linux/pci_vfio_mdev.c   | 236 ++++++++++++++++++
 drivers/bus/pci/meson.build             |   3 +-
 drivers/bus/pci/pci_common.c            |  31 +--
 drivers/bus/pci/private.h               |  22 ++
 drivers/bus/pci/rte_bus_pci.h           |  65 ++++-
 drivers/bus/pci/rte_bus_pci_version.map |   7 +
 lib/librte_eal/common/eal_filesystem.h  |  10 +
 lib/librte_eal/freebsd/eal/eal.c        |  22 ++
 lib/librte_eal/linux/eal/eal.c          |  39 ++-
 lib/librte_eal/rte_eal_version.map      |   1 +
 16 files changed, 838 insertions(+), 105 deletions(-)
 create mode 100644 drivers/bus/pci/linux/pci_vfio_mdev.c