[PATCH v3 0/4] Support VFIO sparse mmap in PCI bus
Miao Li
miao.li at intel.com
Thu May 25 18:31:12 CEST 2023
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.
v3:
fix variable 'pdev' and 'info' uninitialized error
v2:
1. add PCI device internal structure in bus/pci/windows/pci.c
2. fix parameter type error
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 | 337 +++++++++++++++++++++++++------
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 +
drivers/bus/pci/windows/pci.c | 14 +-
lib/eal/include/rte_vfio.h | 1 -
11 files changed, 492 insertions(+), 97 deletions(-)
--
2.25.1
More information about the dev
mailing list