From: Stephen Hemminger <stephen@networkplumber.org>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, thomas@monjalon.net, maxime.coquelin@redhat.com,
anatoly.burakov@intel.com
Subject: Re: [RFC v2 8/9] uapi: import VFIO header
Date: Fri, 5 Sep 2025 21:11:57 -0700 [thread overview]
Message-ID: <20250905211157.00ab0e5a@hermes.local> (raw)
In-Reply-To: <20250903151800.1965006-9-david.marchand@redhat.com>
On Wed, 3 Sep 2025 17:17:58 +0200
David Marchand <david.marchand@redhat.com> wrote:
> Import VFIO header (from v6.16) to be included in many parts of DPDK.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> kernel/linux/uapi/linux/vfio.h | 1836 ++++++++++++++++++++++++++++++++
> kernel/linux/uapi/version | 2 +-
> 2 files changed, 1837 insertions(+), 1 deletion(-)
> create mode 100644 kernel/linux/uapi/linux/vfio.h
The linux kernel source tree has a well defined method for making exported
uapi headers:
make headers_install
DPDK should not be inventing its own method for this.
If you use this on current released kernel (6.16) you will get slightly different file.
The point of having DPDK vfio.h was to workaround case where distro was too old;
not to be different.
diff --git a/kernel/linux/uapi/linux/vfio.h b/kernel/linux/uapi/linux/vfio.h
index 4413783940..4d96d1fc12 100644
--- a/kernel/linux/uapi/linux/vfio.h
+++ b/kernel/linux/uapi/linux/vfio.h
@@ -9,8 +9,8 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#ifndef _UAPIVFIO_H
-#define _UAPIVFIO_H
+#ifndef VFIO_H
+#define VFIO_H
#include <linux/types.h>
#include <linux/ioctl.h>
@@ -905,10 +905,12 @@ struct vfio_device_feature {
* VFIO_DEVICE_BIND_IOMMUFD - _IOR(VFIO_TYPE, VFIO_BASE + 18,
* struct vfio_device_bind_iommufd)
* @argsz: User filled size of this data.
- * @flags: Must be 0.
+ * @flags: Must be 0 or a bit flags of VFIO_DEVICE_BIND_*
* @iommufd: iommufd to bind.
* @out_devid: The device id generated by this bind. devid is a handle for
* this device/iommufd bond and can be used in IOMMUFD commands.
+ * @token_uuid_ptr: Valid if VFIO_DEVICE_BIND_FLAG_TOKEN. Points to a 16 byte
+ * UUID in the same format as VFIO_DEVICE_FEATURE_PCI_VF_TOKEN.
*
* Bind a vfio_device to the specified iommufd.
*
@@ -917,13 +919,21 @@ struct vfio_device_feature {
*
* Unbind is automatically conducted when device fd is closed.
*
+ * A token is sometimes required to open the device, unless this is known to be
+ * needed VFIO_DEVICE_BIND_FLAG_TOKEN should not be set and token_uuid_ptr is
+ * ignored. The only case today is a PF/VF relationship where the VF bind must
+ * be provided the same token as VFIO_DEVICE_FEATURE_PCI_VF_TOKEN provided to
+ * the PF.
+ *
* Return: 0 on success, -errno on failure.
*/
struct vfio_device_bind_iommufd {
__u32 argsz;
__u32 flags;
+#define VFIO_DEVICE_BIND_FLAG_TOKEN (1 << 0)
__s32 iommufd;
__u32 out_devid;
+ __aligned_u64 token_uuid_ptr;
};
#define VFIO_DEVICE_BIND_IOMMUFD _IO(VFIO_TYPE, VFIO_BASE + 18)
@@ -1833,4 +1843,4 @@ struct vfio_iommu_spapr_tce_remove {
/* ***************************************************************** */
-#endif /* _UAPIVFIO_H */
+#endif /* VFIO_H */
next prev parent reply other threads:[~2025-09-06 4:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 7:28 [RFC 0/8] Cleanup VFIO API and import Linux uAPI header David Marchand
2025-09-03 7:28 ` [RFC 1/8] vfio: remove confusing check on VFIO presence David Marchand
2025-09-03 9:38 ` Xu, Rosen
2025-09-03 7:28 ` [RFC 2/8] vfio: assume VFIO is always and only present on Linux David Marchand
2025-09-03 7:28 ` [RFC 3/8] vfio: remove public wrappers David Marchand
2025-09-03 7:28 ` [RFC 4/8] eal/linux: remove more internal VFIO macros David Marchand
2025-09-03 7:28 ` [RFC 5/8] eal/linux: remove internal VFIO wrappers for old Linux David Marchand
2025-09-03 7:28 ` [RFC 6/8] vfio: stop including Linux kernel header in public and driver API David Marchand
2025-09-03 9:38 ` Xu, Rosen
2025-09-03 7:28 ` [RFC 7/8] uapi: import VFIO header David Marchand
2025-09-03 7:28 ` [RFC 8/8] vfio: use imported uAPI header David Marchand
2025-09-03 9:38 ` Xu, Rosen
2025-09-03 7:50 ` [RFC 0/8] Cleanup VFIO API and import Linux " David Marchand
2025-09-03 9:29 ` Burakov, Anatoly
2025-09-03 9:52 ` David Marchand
2025-09-03 14:25 ` Burakov, Anatoly
2025-09-03 15:13 ` [RFC v2 0/9] " David Marchand
2025-09-03 15:13 ` [RFC v2 1/9] drivers: remove unneeded VFIO header inclusion David Marchand
2025-09-03 15:13 ` [RFC v2 2/9] vfio: remove confusing check on VFIO presence David Marchand
2025-09-03 15:13 ` [RFC v2 3/9] vfio: assume VFIO is always and only present on Linux David Marchand
2025-09-03 15:13 ` [RFC v2 4/9] vfio: remove public wrappers David Marchand
2025-09-03 15:13 ` [RFC v2 5/9] eal/linux: remove more internal VFIO macros David Marchand
2025-09-03 15:13 ` [RFC v2 6/9] eal/linux: remove internal VFIO wrappers for old Linux David Marchand
2025-09-03 15:22 ` [RFC v2 0/9] Cleanup VFIO API and import Linux uAPI header David Marchand
2025-09-03 15:17 ` David Marchand
2025-09-03 15:17 ` [RFC v2 1/9] drivers: remove unneeded VFIO header inclusion David Marchand
2025-09-03 15:17 ` [RFC v2 2/9] vfio: remove confusing check on VFIO presence David Marchand
2025-09-03 15:17 ` [RFC v2 3/9] vfio: assume VFIO is always and only present on Linux David Marchand
2025-09-03 15:17 ` [RFC v2 4/9] vfio: remove public wrappers David Marchand
2025-09-03 15:17 ` [RFC v2 5/9] eal/linux: remove more internal VFIO macros David Marchand
2025-09-03 15:17 ` [RFC v2 6/9] eal/linux: remove internal VFIO wrappers for old Linux David Marchand
2025-09-03 15:17 ` [RFC v2 7/9] vfio: stop including Linux kernel header in public and driver API David Marchand
2025-09-03 15:17 ` [RFC v2 8/9] uapi: import VFIO header David Marchand
2025-09-06 4:11 ` Stephen Hemminger [this message]
2025-09-03 15:17 ` [RFC v2 9/9] vfio: use imported uAPI header David Marchand
2025-09-04 7:08 ` [RFC v2 0/9] Cleanup VFIO API and import Linux " David Marchand
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=20250905211157.00ab0e5a@hermes.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=thomas@monjalon.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).