From: Stephen Hemminger <stephen@networkplumber.org>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v6 00/18] Support VFIO cdev API in DPDK
Date: Tue, 13 Jan 2026 15:16:30 -0800 [thread overview]
Message-ID: <20260113151630.5381bef2@phoenix.local> (raw)
In-Reply-To: <cover.1763719706.git.anatoly.burakov@intel.com>
On Fri, 21 Nov 2025 10:08:45 +0000
Anatoly Burakov <anatoly.burakov@intel.com> wrote:
> This patchset introduces a major refactor of the VFIO subsystem in DPDK to
> support character device (cdev) interface introduced in Linux kernel, as well as
> make the API more streamlined and useful. The goal is to simplify device
> management, improve compatibility, and clarify API responsibilities.
>
> The following sections outline the key issues addressed by this patchset and the
> corresponding changes introduced.
>
> 1. Only group mode is supported
> ===============================
>
> Since kernel version 4.14.327 (LTS), VFIO supports the new character device
> (cdev)-based way of working with VFIO devices (otherwise known as IOMMUFD). This
> is a device-centric mode and does away with all the complexity regarding groups
> and IOMMU types, delegating it all to the kernel, and exposes a much simpler
> interface to userspace.
>
> The old group interface is still around, and will need to be kept in DPDK both
> for compatibility reasons, as well as supporting special cases (FSLMC bus, NBL
> driver, etc.).
>
> To enable this, VFIO is heavily refactored, so that the code can support both
> modes while relying on (mostly) common infrastructure.
>
> Note that the existing `rte_vfio_device_setup/release` model is fundamentally
> incompatible with cdev mode, because for custom container cases, the expected
> flow is that the user binds the IOMMU group (and thus, implicitly, the device
> itself) to a specific container using `rte_vfio_container_group_bind`, whereas
> this step is not needed for cdev as the device fd is assigned to the container
> straight away.
>
> Therefore, what we do instead is introduce a new API for container device
> assignment which, semantically, will assign a device to specified container, so
> that when it is mapped using `rte_pci_map_device`, the appropriate container is
> selected. Under the hood though, we essentially transition to getting device fd
> straight away at assign stage, so that by the time the PCI bus attempts to map
> the device, it is already mapped and we just return an fd. There is no
> "unassign" API because `release_device` already performs that function.
>
> Additionally, a new `rte_vfio_get_mode` API is added for those cases that need
> some introspection into VFIO's internals, with three new modes: group
> (old-style), no-iommu (old-style but without IOMMU), and cdev (the new mode).
> Although no-IOMMU is technically a variant of group mode, the distinction is
> largely irrelevant to the user, as all usages of noiommu checks in our codebase
> are for deciding whether to use IOVA or PA, not anything to do with managing
> groups. The current plan for kernel community is to *not* introduce no-IOMMU
> cdev implementation, which is why this will be kept for compatibility for these
> use cases.
>
> There were other users of VFIO which relied on group API but only for convenience
> purposes; no actual VFIO functionality depended on those API's. Therefore, group
> API's are removed and, where appropriate, replaced with the new API's.
>
> List of removed API's:
>
> * `rte_vfio_get_group_fd`
> * `rte_vfio_clear_group`
> * `rte_vfio_container_group_bind` (replaced by container assign API)
> * `rte_vfio_container_group_unbind`
> * `rte_vfio_noiommu_is_enabled` (replaced by new mode API)
>
> 2. The API responsibilities aren't clear and bleed into each other
> ==================================================================
>
> Some API's do multiple things at once. In particular:
>
> * `rte_vfio_get_device_info` will setup the device
> * `rte_vfio_setup_device` will get device info
>
> These API's have been adjusted to do one thing only.
>
> v6:
> - Fixed missing header include in vfio cdev file
>
> v5:
> - Added back missing uapi patch
>
> v4:
> - Fixed issues with documenting rte_vfio_mode enum
> - Separated deprecation notices into a separate patchset
>
> v3:
> - Make API removal cleaner
> - Fix `get_group_num` usages to align with new API
> - Fix issues with function exports
> - Fix issues with `setup_device` returning old-style values in some cases
>
> v2:
> - Make the entire API internal
> - More aggressive API pruning, complete removal of group API
> - Fixed a bug in group mode where device could not be used
> - Better documentation and deprecation notice patches
> - Moved doc patches to beginning of patchset
>
> Anatoly Burakov (18):
> uapi: update to v6.17 and add iommufd.h
> vfio: make all functions internal
> vfio: split get device info from setup
> vfio: add container device assignment API
> net/nbl: do not use VFIO group bind API
> net/ntnic: use container device assignment API
> vdpa/ifc: use container device assignment API
> vdpa/nfp: use container device assignment API
> vdpa/sfc: use container device assignment API
> vhost: remove group-related API from drivers
> vfio: remove group-based API
> vfio: cleanup and refactor
> bus/pci: use the new VFIO mode API
> bus/fslmc: use the new VFIO mode API
> net/hinic3: use the new VFIO mode API
> net/ntnic: use the new VFIO mode API
> vfio: remove no-IOMMU check API
> vfio: introduce cdev mode
>
> config/arm/meson.build | 1 +
> config/meson.build | 1 +
> doc/guides/prog_guide/vhost_lib.rst | 4 -
> drivers/bus/cdx/cdx_vfio.c | 25 +-
> drivers/bus/fslmc/fslmc_bus.c | 10 +-
> drivers/bus/fslmc/fslmc_vfio.c | 6 +-
> drivers/bus/pci/linux/pci.c | 2 +-
> drivers/bus/pci/linux/pci_vfio.c | 33 +-
> drivers/bus/platform/platform.c | 9 +-
> drivers/crypto/bcmfs/bcmfs_vfio.c | 14 +-
> drivers/net/hinic3/base/hinic3_hwdev.c | 2 +-
> drivers/net/nbl/nbl_common/nbl_userdev.c | 20 +-
> drivers/net/nbl/nbl_include/nbl_include.h | 1 +
> drivers/net/ntnic/ntnic_ethdev.c | 2 +-
> drivers/net/ntnic/ntnic_vfio.c | 30 +-
> drivers/vdpa/ifc/ifcvf_vdpa.c | 34 +-
> drivers/vdpa/mlx5/mlx5_vdpa.c | 1 -
> drivers/vdpa/nfp/nfp_vdpa.c | 37 +-
> drivers/vdpa/sfc/sfc_vdpa.c | 39 +-
> drivers/vdpa/sfc/sfc_vdpa.h | 2 -
> kernel/linux/uapi/linux/iommufd.h | 1292 +++++++++++
> kernel/linux/uapi/linux/vduse.h | 2 +-
> kernel/linux/uapi/linux/vfio.h | 12 +-
> kernel/linux/uapi/version | 2 +-
> lib/eal/freebsd/eal.c | 98 +-
> lib/eal/include/rte_vfio.h | 387 ++--
> lib/eal/linux/eal_vfio.c | 2433 ++++++++-------------
> lib/eal/linux/eal_vfio.h | 167 +-
> lib/eal/linux/eal_vfio_cdev.c | 390 ++++
> lib/eal/linux/eal_vfio_group.c | 984 +++++++++
> lib/eal/linux/eal_vfio_mp_sync.c | 80 +-
> lib/eal/linux/meson.build | 2 +
> lib/eal/windows/eal.c | 4 +-
> lib/vhost/vdpa_driver.h | 3 -
> 34 files changed, 4261 insertions(+), 1868 deletions(-)
> create mode 100644 kernel/linux/uapi/linux/iommufd.h
> create mode 100644 lib/eal/linux/eal_vfio_cdev.c
> create mode 100644 lib/eal/linux/eal_vfio_group.c
>
Since this is a big patch and hard to see everything, ran the patch
series through AI with the current AGENTS.md guideline.
Agree that a release note is needed.
## DPDK Patch Review: VFIO cdev Mode Series (v6, 18 patches)
**Author:** Anatoly Burakov <anatoly.burakov@intel.com>
### Overview
This 18-patch series introduces VFIO cdev (IOMMUFD) mode support, refactors VFIO infrastructure, and makes VFIO APIs internal. The series is at v6 and has accumulated several Acked-by tags.
---
### ✅ PASSED Checks
| Check | Status |
|-------|--------|
| Subject lines ≤60 characters | ✓ All pass |
| Subject lowercase (except acronyms) | ✓ Correct |
| Component prefixes | ✓ Valid: `vfio:`, `bus/pci:`, `net/nbl:`, `vdpa/sfc:`, etc. |
| No trailing periods in subjects | ✓ None found |
| Body wrapped at 75 characters | ✓ All pass |
| Body does not start with "It" | ✓ Confirmed |
| `Signed-off-by:` present | ✓ All 18 patches |
| VF/PF capitalization | ✓ Correct usage |
| SPDX license in new files | ✓ BSD-3-Clause with copyright in `eal_vfio_group.c`, `eal_vfio_cdev.c` |
| `__rte_internal` placement | ✓ Alone on line, in header files only |
| Kernel UAPI headers | ✓ GPL-2.0 (appropriate for kernel headers) |
| Tag order | ✓ Correct (Signed-off-by before Acked-by) |
---
### ⚠️ WARNINGS (should fix)
#### 1. Missing Release Notes
**Severity:** Warning
**Location:** Series-wide
This series makes significant API changes that warrant release notes:
- **Patch 02/18:** Makes entire VFIO API internal-only (ABI change for applications)
- **Patch 12/18:** Changes return value semantics for `rte_vfio_setup_device()` and `rte_vfio_get_group_num()` (now return -1 with `rte_errno=ENODEV` instead of 1)
- **Patch 18/18:** Introduces new VFIO cdev mode (`RTE_VFIO_MODE_CDEV`)
**Recommendation:** Add entry to `doc/guides/rel_notes/release_25_XX.rst` documenting:
- VFIO API is now internal (drivers only)
- Return value changes for affected functions
- New cdev/IOMMUFD mode support
#### 2. Implicit Integer Comparison
**Severity:** Warning
**Location:** Patch 12/18, `eal_vfio_group.c`
```c
// Line ~8360 in mbox (in vfio_has_supported_extensions function)
if (!n_extensions) // n_extensions is unsigned int
```
**Should be:**
```c
if (n_extensions == 0)
```
Per AGENTS.md: "Integers - compare explicitly with zero"
---
### ℹ️ INFO (observations)
1. **Good commit message structure:** The series has well-written commit messages, particularly patch 12/18 which clearly documents the behavioral changes.
2. **Proper API tagging:** All new internal APIs use `__rte_internal` correctly positioned.
3. **Kernel header long line:** Line 613 in `iommufd.h` exceeds 100 chars, but this is a verbatim kernel UAPI header import - acceptable.
4. **Acks accumulated:** Patches 01, 12, and 14 have maintainer Acks (Stephen Hemminger, Hemant Agrawal).
---
### Summary
| Category | Count |
|----------|-------|
| Errors | 0 |
| Warnings | 2 |
| Info | 4 |
**Verdict:** The series is in good shape for this stage (v6). The two warnings should be addressed before merging:
1. Add release notes for the API changes
2. Fix the implicit integer comparison in `vfio_has_supported_extensions()`
next prev parent reply other threads:[~2026-01-13 23:16 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 16:43 [PATCH v1 0/8] Support VFIO cdev API in DPDK Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 1/8] uapi: update to v6.17 and add iommufd.h Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 2/8] vfio: add container device assignment API Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 3/8] vhost: remove group-related API from drivers Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 4/8] vfio: do not setup the device on get device info Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 5/8] vfio: cleanup and refactor Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 6/8] vfio: introduce cdev mode Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 7/8] doc: deprecate VFIO group-based APIs Anatoly Burakov
2025-10-28 16:43 ` [PATCH v1 8/8] vfio: deprecate group-based API Anatoly Burakov
2025-10-29 9:50 ` 回复:[PATCH v1 0/8] Support VFIO cdev API in DPDK Dimon
2025-10-29 12:03 ` Burakov, Anatoly
2025-10-30 9:21 ` [PATCH " David Marchand
2025-10-30 10:11 ` Burakov, Anatoly
2025-11-14 17:40 ` [PATCH v2 00/19] " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 01/19] doc: add deprecation notice for VFIO API Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 02/19] doc: add deprecation notice for vDPA driver API Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 03/19] uapi: update to v6.17 and add iommufd.h Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 04/19] vfio: make all functions internal Anatoly Burakov
2025-11-14 18:18 ` Stephen Hemminger
2025-11-18 10:37 ` Burakov, Anatoly
2025-11-14 17:40 ` [PATCH v2 05/19] vfio: add container device assignment API Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 06/19] vfio: split get device info from setup Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 07/19] net/nbl: do not use VFIO group bind API Anatoly Burakov
2025-11-15 8:31 ` 回复:[PATCH " Dimon
2025-11-18 10:39 ` Burakov, Anatoly
2025-11-14 17:40 ` [PATCH v2 08/19] net/ntnic: use container device assignment API Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 09/19] vdpa/ifc: " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 10/19] vdpa/nfp: " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 11/19] vdpa/sfc: " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 12/19] vhost: remove group-related API from drivers Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 13/19] vfio: cleanup and refactor Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 14/19] bus/pci: use the new VFIO mode API Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 15/19] bus/fslmc: " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 16/19] net/hinic3: " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 17/19] net/ntnic: " Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 18/19] vfio: remove group API functions Anatoly Burakov
2025-11-14 17:40 ` [PATCH v2 19/19] vfio: introduce cdev mode Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 00/17] Support VFIO cdev API in DPDK Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 01/17] vfio: make all functions internal Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 02/17] vfio: split get device info from setup Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 03/17] vfio: add container device assignment API Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 04/17] net/nbl: do not use VFIO group bind API Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 05/17] net/ntnic: use container device assignment API Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 06/17] vdpa/ifc: " Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 07/17] vdpa/nfp: " Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 08/17] vdpa/sfc: " Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 09/17] vhost: remove group-related API from drivers Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 10/17] vfio: remove group-based API Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 11/17] vfio: cleanup and refactor Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 12/17] bus/pci: use the new VFIO mode API Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 13/17] bus/fslmc: " Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 14/17] net/hinic3: " Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 15/17] net/ntnic: " Anatoly Burakov
2025-11-19 11:01 ` [PATCH v4 16/17] vfio: remove no-IOMMU check API Anatoly Burakov
2025-11-19 11:02 ` [PATCH v4 17/17] vfio: introduce cdev mode Anatoly Burakov
2025-11-19 11:06 ` [PATCH v4 00/17] Support VFIO cdev API in DPDK Burakov, Anatoly
2025-11-19 11:07 ` [PATCH v5 00/18] " Anatoly Burakov
2025-11-19 11:07 ` [PATCH v5 01/18] uapi: update to v6.17 and add iommufd.h Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 02/18] vfio: make all functions internal Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 03/18] vfio: split get device info from setup Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 04/18] vfio: add container device assignment API Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 05/18] net/nbl: do not use VFIO group bind API Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 06/18] net/ntnic: use container device assignment API Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 07/18] vdpa/ifc: " Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 08/18] vdpa/nfp: " Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 09/18] vdpa/sfc: " Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 10/18] vhost: remove group-related API from drivers Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 11/18] vfio: remove group-based API Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 12/18] vfio: cleanup and refactor Anatoly Burakov
2025-11-20 7:04 ` Hemant Agrawal
2025-11-19 11:08 ` [PATCH v5 13/18] bus/pci: use the new VFIO mode API Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 14/18] bus/fslmc: " Anatoly Burakov
2025-11-20 7:03 ` Hemant Agrawal
2025-11-19 11:08 ` [PATCH v5 15/18] net/hinic3: " Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 16/18] net/ntnic: " Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 17/18] vfio: remove no-IOMMU check API Anatoly Burakov
2025-11-19 11:08 ` [PATCH v5 18/18] vfio: introduce cdev mode Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 00/18] Support VFIO cdev API in DPDK Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 01/18] uapi: update to v6.17 and add iommufd.h Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 02/18] vfio: make all functions internal Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 03/18] vfio: split get device info from setup Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 04/18] vfio: add container device assignment API Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 05/18] net/nbl: do not use VFIO group bind API Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 06/18] net/ntnic: use container device assignment API Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 07/18] vdpa/ifc: " Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 08/18] vdpa/nfp: " Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 09/18] vdpa/sfc: " Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 10/18] vhost: remove group-related API from drivers Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 11/18] vfio: remove group-based API Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 12/18] vfio: cleanup and refactor Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 13/18] bus/pci: use the new VFIO mode API Anatoly Burakov
2025-11-21 10:08 ` [PATCH v6 14/18] bus/fslmc: " Anatoly Burakov
2025-11-21 10:09 ` [PATCH v6 15/18] net/hinic3: " Anatoly Burakov
2025-11-21 10:09 ` [PATCH v6 16/18] net/ntnic: " Anatoly Burakov
2025-11-21 10:09 ` [PATCH v6 17/18] vfio: remove no-IOMMU check API Anatoly Burakov
2025-11-21 10:09 ` [PATCH v6 18/18] vfio: introduce cdev mode Anatoly Burakov
2026-01-13 23:16 ` Stephen Hemminger [this message]
2026-02-26 13:50 ` [PATCH v6 00/18] Support VFIO cdev API in DPDK Burakov, Anatoly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260113151630.5381bef2@phoenix.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.