Skip to content

Cleanup VFIO API and import Linux uAPI header

David Marchand dpdk-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 2 repliesIn review
  2. v2 RFC posting 2/29 patches 13 repliesSuperseded
  3. v2 RFC posting 1/26 of 9 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC8 patches7 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10uapi: fix include guards in VDUSE imported headerdevtools/linux-uapi.sh doc/guides/contributing/linux_uapi.rst kernel/linux/uapi/linux/vduse.h +1 more+14 -51 reply
2/10drivers: remove unneeded VFIO header inclusiondrivers/common/qat/dev/qat_dev_gen_lce.c drivers/net/hns3/hns3_ethdev_vf.c drivers/raw/ifpga/afu_pmd_he_hssi.c +2 more+0 -80 replies
3/10vfio: remove confusing check on VFIO presencedoc/api/doxy-api.conf.in doc/guides/cryptodevs/bcmfs.rst drivers/bus/fslmc/fslmc_bus.c +13 more+16 -1540 replies
4/10vfio: assume VFIO is always and only present on Linuxconfig/meson.build drivers/crypto/bcmfs/bcmfs_vfio.c drivers/crypto/bcmfs/meson.build +1 more+7 -240 replies
5/10vfio: remove public wrappersdrivers/bus/cdx/cdx_vfio.c drivers/bus/fslmc/fslmc_vfio.c drivers/bus/pci/linux/pci_vfio.c +4 more+54 -1200 replies
6/10eal/linux: remove more internal VFIO macroslib/eal/linux/eal_vfio.c lib/eal/linux/eal_vfio.h+49 -510 replies
7/10eal/linux: remove internal VFIO wrappers for old Linuxdrivers/bus/fslmc/fslmc_vfio.c lib/eal/linux/eal_vfio.c lib/eal/linux/eal_vfio.h+3 -630 replies
8/10vfio: stop including Linux kernel header in public and driver APIdrivers/bus/cdx/cdx_vfio.c drivers/bus/fslmc/bus_fslmc_driver.h drivers/bus/fslmc/fslmc_bus.c +14 more+28 -110 replies
9/10uapi: import VFIO headerkernel/linux/uapi/linux/vfio.h kernel/linux/uapi/version+1837 -10 replies
10/10vfio: use imported uAPI headerdrivers/bus/cdx/cdx_vfio.c drivers/bus/fslmc/fslmc_vfio.c drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +12 more+38 -590 replies

Reviews trailers per patch

7 of 10 patches have a Reviewed-by or Acked-by.

PatchAnatoly BurakovRosen XuMaxime Coquelin
1/10R-b
2/10A-b
3/10R-b
4/10A-b
5/10
6/10A-b
7/10
8/10A-b R-b
9/10
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/10] Cleanup VFIO API and import Linux uAPI header

The VFIO headers have a number of issues:
- showing to the world a lot of internal considerations,
- defining macros with the VFIO_ namespace (confusing, and a source of conflicts with the VFIO official uAPI),
- wrapping around VFIO uAPI in case the kernel headers do not contain the expected API (putting the burden on DPDK developers to find the right way to detect the presence of a VFIO feature),
- (somehow related to the previous point) supporting old version of the Linux kernel while DPDK now requires a v5.4 Linux kernel at least,

This series proposes to cleanup those headers by hiding as much as possible internal macros and structures, then removing the explicit inclusion of linux/vfio.h from rte_vfio.h (pushing this inclusion to the application which may want to do some funny stuff with VFIO and should already include this header on its own) and finally importing the VFIO uAPI header from Linux v6.15 for internal consumption by DPDK components.

Signature · 72 lines
David Marchand

Changes since RFC v2:
- fixed include guard for VDUSE and updated documentation,
- kept but renamed some local macros for /dev/vfio and vfio kmod,
- reimported VFIO header,
- converted net/xsc,
- fixed header inclusion order,

Changes since RFC v1:
- fixed FreeBSD compilation,
- fixed some inclusion of linux/vfio.h in common/cnxk and raw/ifpga,

David Marchand (10):
  uapi: fix include guards in VDUSE imported header
  drivers: remove unneeded VFIO header inclusion
  vfio: remove confusing check on VFIO presence
  vfio: assume VFIO is always and only present on Linux
  vfio: remove public wrappers
  eal/linux: remove more internal VFIO macros
  eal/linux: remove internal VFIO wrappers for old Linux
  vfio: stop including Linux kernel header in public and driver API
  uapi: import VFIO header
  vfio: use imported uAPI header

 config/meson.build                         |    3 -
 devtools/linux-uapi.sh                     |    3 +
 doc/api/doxy-api.conf.in                   |    1 -
 doc/guides/contributing/linux_uapi.rst     |    6 +
 doc/guides/cryptodevs/bcmfs.rst            |    4 -
 drivers/bus/cdx/cdx_vfio.c                 |   19 +-
 drivers/bus/fslmc/bus_fslmc_driver.h       |    3 +-
 drivers/bus/fslmc/fslmc_bus.c              |   13 +-
 drivers/bus/fslmc/fslmc_vfio.c             |   20 +-
 drivers/bus/fslmc/fslmc_vfio.h             |    1 -
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c   |    2 +
 drivers/bus/pci/linux/pci.c                |   22 -
 drivers/bus/pci/linux/pci_init.h           |    6 -
 drivers/bus/pci/linux/pci_vfio.c           |   37 +-
 drivers/bus/pci/pci_common.c               |    2 -
 drivers/bus/platform/bus_platform_driver.h |   20 +-
 drivers/bus/platform/platform.c            |    6 +-
 drivers/bus/platform/platform_params.c     |    5 -
 drivers/common/cnxk/roc_platform.c         |    3 +-
 drivers/common/qat/dev/qat_dev_gen_lce.c   |    4 -
 drivers/crypto/bcmfs/bcmfs_vfio.c          |   15 +-
 drivers/crypto/bcmfs/meson.build           |    4 +-
 drivers/net/hns3/hns3_ethdev_vf.c          |    1 -
 drivers/net/xsc/xsc_vfio.c                 |    3 +-
 drivers/raw/ifpga/afu_pmd_he_hssi.c        |    1 -
 drivers/raw/ifpga/afu_pmd_he_lpbk.c        |    1 -
 drivers/raw/ifpga/afu_pmd_he_mem.c         |    1 -
 drivers/raw/ifpga/afu_pmd_n3000.c          |    7 +-
 drivers/raw/ifpga/base/ifpga_feature_dev.c |    3 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c              |    2 +
 drivers/vdpa/nfp/nfp_vdpa.c                |    2 +
 drivers/vdpa/sfc/sfc_vdpa_ops.c            |    3 +-
 kernel/linux/uapi/linux/vduse.h            |    6 +-
 kernel/linux/uapi/linux/vfio.h             | 1836 ++++++++++++++++++++
 kernel/linux/uapi/version                  |    2 +-
 lib/eal/include/rte_vfio.h                 |   90 +-
 lib/eal/linux/eal.c                        |    4 -
 lib/eal/linux/eal_interrupts.c             |   28 +-
 lib/eal/linux/eal_vfio.c                   |  126 +-
 lib/eal/linux/eal_vfio.h                   |   79 -
 lib/eal/linux/eal_vfio_mp_sync.c           |   10 -
 lib/vhost/vduse.c                          |    4 +-
 42 files changed, 1979 insertions(+), 429 deletions(-)
 create mode 100644 kernel/linux/uapi/linux/vfio.h

-- 
2.51.0