mbox

[v1,0/4] Support VFIO sparse mmap in PCI bus

Message ID 20230515064700.624054-1-miao.li@intel.com (mailing list archive)
Headers

Message

Li, Miao May 15, 2023, 6:46 a.m. UTC
  This series introduces a VFIO standard capability, called sparse
mmap to PCI bus. In linux kernel, it's defined as
VFIO_REGION_INFO_CAP_SPARSE_MMAP. Sparse mmap means instead of
mmap whole BAR region into DPDK process, only mmap part of the
BAR region after getting sparse mmap information from kernel.
For the rest of BAR region that is not mmap-ed, DPDK process
can use pread/pwrite system calls to access. Sparse mmap is
useful when kernel does not want userspace to mmap whole BAR
region, or kernel wants to control over access to specific BAR
region. Vendors can choose to enable this feature or not for
their devices in their specific kernel modules.

In this patchset:

Patch 1-3 is mainly for introducing BAR access APIs so that
driver could use them to access specific BAR using pread/pwrite
system calls when part of the BAR is not mmap-able. Patch 4
adds the VFIO sparse mmap support finally.

Chenbo Xia (3):
  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

Miao Li (1):
  bus/pci: add VFIO sparse mmap support

 drivers/bus/pci/bsd/pci.c        |  35 +++-
 drivers/bus/pci/linux/pci.c      |  78 +++++--
 drivers/bus/pci/linux/pci_init.h |  14 +-
 drivers/bus/pci/linux/pci_uio.c  |  22 ++
 drivers/bus/pci/linux/pci_vfio.c | 335 +++++++++++++++++++++++++------
 drivers/bus/pci/pci_common.c     |  12 +-
 drivers/bus/pci/private.h        |  25 ++-
 drivers/bus/pci/rte_bus_pci.h    |  48 +++++
 drivers/bus/pci/version.map      |   3 +
 lib/eal/include/rte_vfio.h       |   1 -
 10 files changed, 482 insertions(+), 91 deletions(-)