* [PATCH 0/2] uapi: introduce compatibility define of old compilers
@ 2026-09-30 9:57 Maxime Coquelin
2026-09-30 9:57 ` [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers Maxime Coquelin
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Maxime Coquelin @ 2026-09-30 9:57 UTC (permalink / raw)
To: dev, eperezma, david.marchand, thomas, stephen; +Cc: Maxime Coquelin
This series introduces a compatibility define for __counted_by
attribute, which is not defined by old compilers. We define is
as empty if the compiler don't provide it.
The second patch updates the UAPI headers to v6.19, in which vfio.h
introduces the use of this attribute.
Maxime Coquelin (2):
config: add compatibility for old compilers with new UAPI headers
uapi: update headers to v6.19
config/rte_config.h | 9 ++++++++
kernel/linux/uapi/linux/vduse.h | 2 +-
kernel/linux/uapi/linux/vfio.h | 40 ++++++++++++++++++++++++++++++++-
kernel/linux/uapi/version | 2 +-
4 files changed, 50 insertions(+), 3 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
2026-09-30 9:57 [PATCH 0/2] uapi: introduce compatibility define of old compilers Maxime Coquelin
@ 2026-09-30 9:57 ` Maxime Coquelin
2026-09-30 15:26 ` Stephen Hemminger
2026-09-30 9:58 ` [PATCH 2/2] uapi: update headers to v6.19 Maxime Coquelin
2026-10-01 9:05 ` [PATCH v2] " David Marchand
2 siblings, 1 reply; 15+ messages in thread
From: Maxime Coquelin @ 2026-09-30 9:57 UTC (permalink / raw)
To: dev, eperezma, david.marchand, thomas, stephen; +Cc: Maxime Coquelin
This patch adds a compatibility define for __counted_by attribute,
which is not present in older compilers but required for recent UAPI
headers like vfio.h.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
config/rte_config.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/config/rte_config.h b/config/rte_config.h
index 0447cdf2ad..307e7dac62 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -25,6 +25,15 @@
#define RTE_TOOLCHAIN_MSVC 1
#endif
+/*
+ * Compatibility define for Linux kernel UAPI headers that may use __counted_by
+ * attribute for bounds checking. This attribute is not understood by userspace
+ * compilers, so define it as empty if not already provided.
+ */
+#ifndef __counted_by
+#define __counted_by(m)
+#endif
+
/* legacy defines */
#ifdef RTE_EXEC_ENV_LINUX
#define RTE_EXEC_ENV_LINUXAPP 1
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/2] uapi: update headers to v6.19
2026-09-30 9:57 [PATCH 0/2] uapi: introduce compatibility define of old compilers Maxime Coquelin
2026-09-30 9:57 ` [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers Maxime Coquelin
@ 2026-09-30 9:58 ` Maxime Coquelin
2026-09-30 15:27 ` Stephen Hemminger
2026-10-01 9:05 ` [PATCH v2] " David Marchand
2 siblings, 1 reply; 15+ messages in thread
From: Maxime Coquelin @ 2026-09-30 9:58 UTC (permalink / raw)
To: dev, eperezma, david.marchand, thomas, stephen; +Cc: Maxime Coquelin
This patch updates imported UAPI headers to v6.19, in order
to exercise the new compatibility define for __counted_by.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
kernel/linux/uapi/linux/vduse.h | 2 +-
kernel/linux/uapi/linux/vfio.h | 40 ++++++++++++++++++++++++++++++++-
kernel/linux/uapi/version | 2 +-
3 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/kernel/linux/uapi/linux/vduse.h b/kernel/linux/uapi/linux/vduse.h
index f46269af34..da6ac89af1 100644
--- a/kernel/linux/uapi/linux/vduse.h
+++ b/kernel/linux/uapi/linux/vduse.h
@@ -237,7 +237,7 @@ struct vduse_iova_umem {
* struct vduse_iova_info - information of one IOVA region
* @start: start of the IOVA region
* @last: last of the IOVA region
- * @capability: capability of the IOVA regsion
+ * @capability: capability of the IOVA region
* @reserved: for future use, needs to be initialized to zero
*
* Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
diff --git a/kernel/linux/uapi/linux/vfio.h b/kernel/linux/uapi/linux/vfio.h
index 79bf8c0cc5..720edfee7a 100644
--- a/kernel/linux/uapi/linux/vfio.h
+++ b/kernel/linux/uapi/linux/vfio.h
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/ioctl.h>
+#include <linux/stddef.h>
#define VFIO_API_VERSION 0
@@ -905,10 +906,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 +920,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)
@@ -1468,6 +1479,33 @@ struct vfio_device_feature_bus_master {
};
#define VFIO_DEVICE_FEATURE_BUS_MASTER 10
+/**
+ * Upon VFIO_DEVICE_FEATURE_GET create a dma_buf fd for the
+ * regions selected.
+ *
+ * open_flags are the typical flags passed to open(2), eg O_RDWR, O_CLOEXEC,
+ * etc. offset/length specify a slice of the region to create the dmabuf from.
+ * nr_ranges is the total number of (P2P DMA) ranges that comprise the dmabuf.
+ *
+ * flags should be 0.
+ *
+ * Return: The fd number on success, -1 and errno is set on failure.
+ */
+#define VFIO_DEVICE_FEATURE_DMA_BUF 11
+
+struct vfio_region_dma_range {
+ __u64 offset;
+ __u64 length;
+};
+
+struct vfio_device_feature_dma_buf {
+ __u32 region_index;
+ __u32 open_flags;
+ __u32 flags;
+ __u32 nr_ranges;
+ struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);
+};
+
/* -------- API for Type1 VFIO IOMMU -------- */
/**
diff --git a/kernel/linux/uapi/version b/kernel/linux/uapi/version
index 966a998301..69f29b2320 100644
--- a/kernel/linux/uapi/version
+++ b/kernel/linux/uapi/version
@@ -1 +1 @@
-v6.16
+v6.19
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
2026-09-30 9:57 ` [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers Maxime Coquelin
@ 2026-09-30 15:26 ` Stephen Hemminger
2026-09-30 15:37 ` Maxime Coquelin
0 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2026-09-30 15:26 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: dev, eperezma, david.marchand, thomas
On Wed, 30 Sep 2026 11:57:59 +0200
Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
> This patch adds a compatibility define for __counted_by attribute,
> which is not present in older compilers but required for recent UAPI
> headers like vfio.h.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> config/rte_config.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/config/rte_config.h b/config/rte_config.h
> index 0447cdf2ad..307e7dac62 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -25,6 +25,15 @@
> #define RTE_TOOLCHAIN_MSVC 1
> #endif
>
> +/*
> + * Compatibility define for Linux kernel UAPI headers that may use __counted_by
> + * attribute for bounds checking. This attribute is not understood by userspace
> + * compilers, so define it as empty if not already provided.
> + */
> +#ifndef __counted_by
> +#define __counted_by(m)
> +#endif
> +
> /* legacy defines */
> #ifdef RTE_EXEC_ENV_LINUX
> #define RTE_EXEC_ENV_LINUXAPP 1
NAK this is best done by keeping up to date stddef over in virtio headers.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] uapi: update headers to v6.19
2026-09-30 9:58 ` [PATCH 2/2] uapi: update headers to v6.19 Maxime Coquelin
@ 2026-09-30 15:27 ` Stephen Hemminger
2026-09-30 15:38 ` Maxime Coquelin
0 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2026-09-30 15:27 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: dev, eperezma, david.marchand, thomas
On Wed, 30 Sep 2026 11:58:00 +0200
Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
> diff --git a/kernel/linux/uapi/linux/vfio.h b/kernel/linux/uapi/linux/vfio.h
> index 79bf8c0cc5..720edfee7a 100644
> --- a/kernel/linux/uapi/linux/vfio.h
> +++ b/kernel/linux/uapi/linux/vfio.h
> @@ -14,6 +14,7 @@
>
> #include <linux/types.h>
> #include <linux/ioctl.h>
> +#include <linux/stddef.h>
>
Just add sanitized stddef.h into kernel/linux/uapi/linux
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
2026-09-30 15:26 ` Stephen Hemminger
@ 2026-09-30 15:37 ` Maxime Coquelin
2026-10-01 8:19 ` David Marchand
0 siblings, 1 reply; 15+ messages in thread
From: Maxime Coquelin @ 2026-09-30 15:37 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, eperezma, david.marchand, thomas
[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]
On Wed, Sep 30, 2026 at 5:26 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:
> On Wed, 30 Sep 2026 11:57:59 +0200
> Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
>
> > This patch adds a compatibility define for __counted_by attribute,
> > which is not present in older compilers but required for recent UAPI
> > headers like vfio.h.
> >
> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > ---
> > config/rte_config.h | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/config/rte_config.h b/config/rte_config.h
> > index 0447cdf2ad..307e7dac62 100644
> > --- a/config/rte_config.h
> > +++ b/config/rte_config.h
> > @@ -25,6 +25,15 @@
> > #define RTE_TOOLCHAIN_MSVC 1
> > #endif
> >
> > +/*
> > + * Compatibility define for Linux kernel UAPI headers that may use
> __counted_by
> > + * attribute for bounds checking. This attribute is not understood by
> userspace
> > + * compilers, so define it as empty if not already provided.
> > + */
> > +#ifndef __counted_by
> > +#define __counted_by(m)
> > +#endif
> > +
> > /* legacy defines */
> > #ifdef RTE_EXEC_ENV_LINUX
> > #define RTE_EXEC_ENV_LINUXAPP 1
>
> NAK this is best done by keeping up to date stddef over in virtio headers.
>
>
This is for VFIO, not Virtio but that does not change the issue.
Problem is importing stddef in UAPI as currently done, does not work,
because the system version is included first so the imported one is
discarded.
An alternative solution I tested would be to include the imported headers
first,
but it means imported headers get silently intermixed, which worked in my
test
but could lead to hard to debug issues.
While not ideal, the solution proposed in this patch is harmless, we are
talking
about an attribute defined as empty.
Thomas, David, what do you think?
Thanks,
Maxime
[-- Attachment #2: Type: text/html, Size: 2718 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] uapi: update headers to v6.19
2026-09-30 15:27 ` Stephen Hemminger
@ 2026-09-30 15:38 ` Maxime Coquelin
0 siblings, 0 replies; 15+ messages in thread
From: Maxime Coquelin @ 2026-09-30 15:38 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, eperezma, david.marchand, thomas
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
On Wed, Sep 30, 2026 at 5:27 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:
> On Wed, 30 Sep 2026 11:58:00 +0200
> Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
>
> > diff --git a/kernel/linux/uapi/linux/vfio.h
> b/kernel/linux/uapi/linux/vfio.h
> > index 79bf8c0cc5..720edfee7a 100644
> > --- a/kernel/linux/uapi/linux/vfio.h
> > +++ b/kernel/linux/uapi/linux/vfio.h
> > @@ -14,6 +14,7 @@
> >
> > #include <linux/types.h>
> > #include <linux/ioctl.h>
> > +#include <linux/stddef.h>
> >
>
> Just add sanitized stddef.h into kernel/linux/uapi/linux
>
>
See my reply on patch 1 where I explain why it does not work.
[-- Attachment #2: Type: text/html, Size: 1168 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
2026-09-30 15:37 ` Maxime Coquelin
@ 2026-10-01 8:19 ` David Marchand
2026-10-01 8:30 ` Maxime Coquelin
0 siblings, 1 reply; 15+ messages in thread
From: David Marchand @ 2026-10-01 8:19 UTC (permalink / raw)
To: Maxime Coquelin; +Cc: Stephen Hemminger, dev, eperezma, thomas
On Wed, 30 Sept 2026 at 17:37, Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
> On Wed, Sep 30, 2026 at 5:26 PM Stephen Hemminger <stephen@networkplumber.org> wrote:
>>
>> On Wed, 30 Sep 2026 11:57:59 +0200
>> Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
>>
>> > This patch adds a compatibility define for __counted_by attribute,
>> > which is not present in older compilers but required for recent UAPI
>> > headers like vfio.h.
>> >
>> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> > ---
>> > config/rte_config.h | 9 +++++++++
>> > 1 file changed, 9 insertions(+)
>> >
>> > diff --git a/config/rte_config.h b/config/rte_config.h
>> > index 0447cdf2ad..307e7dac62 100644
>> > --- a/config/rte_config.h
>> > +++ b/config/rte_config.h
>> > @@ -25,6 +25,15 @@
>> > #define RTE_TOOLCHAIN_MSVC 1
>> > #endif
>> >
>> > +/*
>> > + * Compatibility define for Linux kernel UAPI headers that may use __counted_by
>> > + * attribute for bounds checking. This attribute is not understood by userspace
>> > + * compilers, so define it as empty if not already provided.
>> > + */
>> > +#ifndef __counted_by
>> > +#define __counted_by(m)
>> > +#endif
>> > +
>> > /* legacy defines */
>> > #ifdef RTE_EXEC_ENV_LINUX
>> > #define RTE_EXEC_ENV_LINUXAPP 1
>>
>> NAK this is best done by keeping up to date stddef over in virtio headers.
>
> This is for VFIO, not Virtio but that does not change the issue.
>
> Problem is importing stddef in UAPI as currently done, does not work,
> because the system version is included first so the imported one is discarded.
>
> An alternative solution I tested would be to include the imported headers first,
> but it means imported headers get silently intermixed, which worked in my test
> but could lead to hard to debug issues.
I don't like the alternative, for the reason you listed, plus the fact
that this intermixing is invisible.
At the moment, using an imported uapi header is opt-in, and I prefer
it like this.
> While not ideal, the solution proposed in this patch is harmless, we are talking
> about an attribute defined as empty.
Your solution of wrapping __counted_by is simple.
On the other hand, fixing the existing import script would require
relying on an external tool (unifef), which could be acceptable.
I tried some:
diff --git a/devtools/linux-uapi.sh b/devtools/linux-uapi.sh
index dbf3163bc8..189164928c 100755
--- a/devtools/linux-uapi.sh
+++ b/devtools/linux-uapi.sh
@@ -13,6 +13,9 @@ file=""
check_headers=false
quiet=false
+# Require unifdef
+unifdef -h 2>&1 >/dev/null || { echo "This script requires unifdef."; exit 1; }
+
print_usage()
{
echo "Usage: $(basename $0) [-h] [-i FILE] [-u VERSION] [-c] [-q]"
@@ -85,6 +88,9 @@ fixup_includes()
sed -i 's|#\(define\)[[:space:]]*_UAPI|#\1 |' $path
sed -i 's|#\(endif[[:space:]]*/[*]\)[[:space:]]*_UAPI|#\1 |' $path
+ unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ -o ${path}.tmp
$path || [ $? -lt 2 ]
+ mv -f ${path}.tmp $path
+
# Prepend include path with "uapi/" if the header is imported
for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
if [ -f "$base_path$include" ]; then
diff --git a/doc/guides/contributing/linux_uapi.rst
b/doc/guides/contributing/linux_uapi.rst
index b8febfc420..a3490bfbb6 100644
--- a/doc/guides/contributing/linux_uapi.rst
+++ b/doc/guides/contributing/linux_uapi.rst
@@ -27,6 +27,8 @@ Importing or updating an uAPI header file
To ensure that imported uAPI headers are unmodified
and sourced from an official Linux kernel release,
a helper script is provided and must be used.
+This script requires the ``unifdef`` tool.
+
Below is an example to import ``linux/vduse.h`` file from Linux ``v6.10``:
.. code-block:: console
Then imported linux/types.h, linux/posix_types.h and linux/stddef.h.
And net/nbl needs some fixing... as it includes uapi/linux/vfio.h too late...
Only occurence in the whole DPDK tree:
$ git grep -l '# *include.*uapi' :^devtools/linux-uapi.sh
:^doc/guides/contributing/linux_uapi.rst | while read file; do [ $(git
grep -B100 '# *include.*uapi' $file | grep '# *include' | wc -l) = 1 ]
|| echo $file; done
drivers/net/nbl/nbl_common/nbl_userdev.c
--
David Marchand
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers
2026-10-01 8:19 ` David Marchand
@ 2026-10-01 8:30 ` Maxime Coquelin
0 siblings, 0 replies; 15+ messages in thread
From: Maxime Coquelin @ 2026-10-01 8:30 UTC (permalink / raw)
To: David Marchand; +Cc: Stephen Hemminger, dev, eperezma, thomas
[-- Attachment #1: Type: text/plain, Size: 4942 bytes --]
On Thu, Oct 1, 2026 at 10:19 AM David Marchand <david.marchand@redhat.com>
wrote:
> On Wed, 30 Sept 2026 at 17:37, Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
> > On Wed, Sep 30, 2026 at 5:26 PM Stephen Hemminger <
> stephen@networkplumber.org> wrote:
> >>
> >> On Wed, 30 Sep 2026 11:57:59 +0200
> >> Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
> >>
> >> > This patch adds a compatibility define for __counted_by attribute,
> >> > which is not present in older compilers but required for recent UAPI
> >> > headers like vfio.h.
> >> >
> >> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> > ---
> >> > config/rte_config.h | 9 +++++++++
> >> > 1 file changed, 9 insertions(+)
> >> >
> >> > diff --git a/config/rte_config.h b/config/rte_config.h
> >> > index 0447cdf2ad..307e7dac62 100644
> >> > --- a/config/rte_config.h
> >> > +++ b/config/rte_config.h
> >> > @@ -25,6 +25,15 @@
> >> > #define RTE_TOOLCHAIN_MSVC 1
> >> > #endif
> >> >
> >> > +/*
> >> > + * Compatibility define for Linux kernel UAPI headers that may use
> __counted_by
> >> > + * attribute for bounds checking. This attribute is not understood
> by userspace
> >> > + * compilers, so define it as empty if not already provided.
> >> > + */
> >> > +#ifndef __counted_by
> >> > +#define __counted_by(m)
> >> > +#endif
> >> > +
> >> > /* legacy defines */
> >> > #ifdef RTE_EXEC_ENV_LINUX
> >> > #define RTE_EXEC_ENV_LINUXAPP 1
> >>
> >> NAK this is best done by keeping up to date stddef over in virtio
> headers.
> >
> > This is for VFIO, not Virtio but that does not change the issue.
> >
> > Problem is importing stddef in UAPI as currently done, does not work,
> > because the system version is included first so the imported one is
> discarded.
> >
> > An alternative solution I tested would be to include the imported
> headers first,
> > but it means imported headers get silently intermixed, which worked in
> my test
> > but could lead to hard to debug issues.
>
> I don't like the alternative, for the reason you listed, plus the fact
> that this intermixing is invisible.
> At the moment, using an imported uapi header is opt-in, and I prefer
> it like this.
>
>
> > While not ideal, the solution proposed in this patch is harmless, we are
> talking
> > about an attribute defined as empty.
>
> Your solution of wrapping __counted_by is simple.
>
> On the other hand, fixing the existing import script would require
> relying on an external tool (unifef), which could be acceptable.
>
Your solution is certainly more future-proof.
If others agree, can you send a series that supersedes mine so that we can
get it merged early?
Eugenio will need to rebase his series on top of it.
Thanks,
Maxime
> I tried some:
>
> diff --git a/devtools/linux-uapi.sh b/devtools/linux-uapi.sh
> index dbf3163bc8..189164928c 100755
> --- a/devtools/linux-uapi.sh
> +++ b/devtools/linux-uapi.sh
> @@ -13,6 +13,9 @@ file=""
> check_headers=false
> quiet=false
>
> +# Require unifdef
> +unifdef -h 2>&1 >/dev/null || { echo "This script requires unifdef.";
> exit 1; }
> +
> print_usage()
> {
> echo "Usage: $(basename $0) [-h] [-i FILE] [-u VERSION] [-c] [-q]"
> @@ -85,6 +88,9 @@ fixup_includes()
> sed -i 's|#\(define\)[[:space:]]*_UAPI|#\1 |' $path
> sed -i 's|#\(endif[[:space:]]*/[*]\)[[:space:]]*_UAPI|#\1 |' $path
>
> + unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ -o ${path}.tmp
> $path || [ $? -lt 2 ]
> + mv -f ${path}.tmp $path
> +
> # Prepend include path with "uapi/" if the header is imported
> for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
> if [ -f "$base_path$include" ]; then
> diff --git a/doc/guides/contributing/linux_uapi.rst
> b/doc/guides/contributing/linux_uapi.rst
> index b8febfc420..a3490bfbb6 100644
> --- a/doc/guides/contributing/linux_uapi.rst
> +++ b/doc/guides/contributing/linux_uapi.rst
> @@ -27,6 +27,8 @@ Importing or updating an uAPI header file
> To ensure that imported uAPI headers are unmodified
> and sourced from an official Linux kernel release,
> a helper script is provided and must be used.
> +This script requires the ``unifdef`` tool.
> +
> Below is an example to import ``linux/vduse.h`` file from Linux ``v6.10``:
>
> .. code-block:: console
>
>
> Then imported linux/types.h, linux/posix_types.h and linux/stddef.h.
>
> And net/nbl needs some fixing... as it includes uapi/linux/vfio.h too
> late...
> Only occurence in the whole DPDK tree:
> $ git grep -l '# *include.*uapi' :^devtools/linux-uapi.sh
> :^doc/guides/contributing/linux_uapi.rst | while read file; do [ $(git
> grep -B100 '# *include.*uapi' $file | grep '# *include' | wc -l) = 1 ]
> || echo $file; done
> drivers/net/nbl/nbl_common/nbl_userdev.c
>
>
> --
> David Marchand
>
>
[-- Attachment #2: Type: text/html, Size: 6471 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2] uapi: update headers to v6.19
2026-09-30 9:57 [PATCH 0/2] uapi: introduce compatibility define of old compilers Maxime Coquelin
2026-09-30 9:57 ` [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers Maxime Coquelin
2026-09-30 9:58 ` [PATCH 2/2] uapi: update headers to v6.19 Maxime Coquelin
@ 2026-10-01 9:05 ` David Marchand
2026-10-01 14:12 ` Maxime Coquelin
` (3 more replies)
2 siblings, 4 replies; 15+ messages in thread
From: David Marchand @ 2026-10-01 9:05 UTC (permalink / raw)
To: dev; +Cc: eperezma, maxime.coquelin, thomas, stephen
From: Maxime Coquelin <maxime.coquelin@redhat.com>
This patch updates imported UAPI headers to v6.19, in order
to exercise the new compatibility define for __counted_by.
Since __counted_by is introduced by linux/stddef.h we need to import it,
and the headers, included by already imported headers, leading to its
inclusion.
One complication is that linux/types.h contains a guard that must be
sanitized using the same method as the Linux kernel.
For this, add a dependency on the unifdef tool.
We also need to fix net/nbl which does not include the VFIO uapi header
first.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- dropped wrapper on __counted_by,
- updated import process and added use of unidef,
- fixed net/nbl driver,
- imported needed uapi headers,
---
devtools/linux-uapi.sh | 6 ++
doc/guides/contributing/linux_uapi.rst | 2 +
drivers/net/nbl/nbl_common/nbl_userdev.c | 3 +-
kernel/linux/uapi/linux/posix_types.h | 38 ++++++++++++
kernel/linux/uapi/linux/stddef.h | 74 ++++++++++++++++++++++++
kernel/linux/uapi/linux/types.h | 58 +++++++++++++++++++
kernel/linux/uapi/linux/vduse.h | 4 +-
kernel/linux/uapi/linux/vfio.h | 42 +++++++++++++-
kernel/linux/uapi/version | 2 +-
9 files changed, 223 insertions(+), 6 deletions(-)
create mode 100644 kernel/linux/uapi/linux/posix_types.h
create mode 100644 kernel/linux/uapi/linux/stddef.h
create mode 100644 kernel/linux/uapi/linux/types.h
diff --git a/devtools/linux-uapi.sh b/devtools/linux-uapi.sh
index dbf3163bc8..f8b50cf8eb 100755
--- a/devtools/linux-uapi.sh
+++ b/devtools/linux-uapi.sh
@@ -13,6 +13,9 @@ file=""
check_headers=false
quiet=false
+# Require unifdef
+unifdef -h >/dev/null 2>&1 || { echo "This script requires unifdef."; exit 1; }
+
print_usage()
{
echo "Usage: $(basename $0) [-h] [-i FILE] [-u VERSION] [-c] [-q]"
@@ -85,6 +88,9 @@ fixup_includes()
sed -i 's|#\(define\)[[:space:]]*_UAPI|#\1 |' $path
sed -i 's|#\(endif[[:space:]]*/[*]\)[[:space:]]*_UAPI|#\1 |' $path
+ unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ -o ${path}.tmp $path || [ $? -lt 2 ]
+ mv -f ${path}.tmp $path
+
# Prepend include path with "uapi/" if the header is imported
for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
if [ -f "$base_path$include" ]; then
diff --git a/doc/guides/contributing/linux_uapi.rst b/doc/guides/contributing/linux_uapi.rst
index b8febfc420..a3490bfbb6 100644
--- a/doc/guides/contributing/linux_uapi.rst
+++ b/doc/guides/contributing/linux_uapi.rst
@@ -27,6 +27,8 @@ Importing or updating an uAPI header file
To ensure that imported uAPI headers are unmodified
and sourced from an official Linux kernel release,
a helper script is provided and must be used.
+This script requires the ``unifdef`` tool.
+
Below is an example to import ``linux/vduse.h`` file from Linux ``v6.10``:
.. code-block:: console
diff --git a/drivers/net/nbl/nbl_common/nbl_userdev.c b/drivers/net/nbl/nbl_common/nbl_userdev.c
index ec6840d60e..de7950c57a 100644
--- a/drivers/net/nbl/nbl_common/nbl_userdev.c
+++ b/drivers/net/nbl/nbl_common/nbl_userdev.c
@@ -2,8 +2,9 @@
* Copyright 2025 Nebulamatrix Technology Co., Ltd.
*/
-#include "nbl_userdev.h"
#include <uapi/linux/vfio.h>
+
+#include "nbl_userdev.h"
#include <rte_vfio.h>
#define NBL_USERDEV_EVENT_CLB_NAME "nbl_userspace_mem_event_clb"
diff --git a/kernel/linux/uapi/linux/posix_types.h b/kernel/linux/uapi/linux/posix_types.h
new file mode 100644
index 0000000000..6c55afdf80
--- /dev/null
+++ b/kernel/linux/uapi/linux/posix_types.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _LINUX_POSIX_TYPES_H
+#define _LINUX_POSIX_TYPES_H
+
+#include <uapi/linux/stddef.h>
+
+/*
+ * This allows for 1024 file descriptors: if NR_OPEN is ever grown
+ * beyond that you'll have to change this too. But 1024 fd's seem to be
+ * enough even for such "real" unices like OSF/1, so hopefully this is
+ * one limit that doesn't have to be changed [again].
+ *
+ * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
+ * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
+ * place for them. Solved by having dummy defines in <sys/time.h>.
+ */
+
+/*
+ * This macro may have been defined in <gnu/types.h>. But we always
+ * use the one here.
+ */
+#undef __FD_SETSIZE
+#define __FD_SETSIZE 1024
+
+typedef struct {
+ unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))];
+} __kernel_fd_set;
+
+/* Type of a signal handler. */
+typedef void (*__kernel_sighandler_t)(int);
+
+/* Type of a SYSV IPC key. */
+typedef int __kernel_key_t;
+typedef int __kernel_mqd_t;
+
+#include <asm/posix_types.h>
+
+#endif /* _LINUX_POSIX_TYPES_H */
diff --git a/kernel/linux/uapi/linux/stddef.h b/kernel/linux/uapi/linux/stddef.h
new file mode 100644
index 0000000000..8ecf96def4
--- /dev/null
+++ b/kernel/linux/uapi/linux/stddef.h
@@ -0,0 +1,74 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _LINUX_STDDEF_H
+#define _LINUX_STDDEF_H
+
+
+#ifndef __always_inline
+#define __always_inline inline
+#endif
+
+/* Not all C++ standards support type declarations inside an anonymous union */
+#ifndef __cplusplus
+#define __struct_group_tag(TAG) TAG
+#else
+#define __struct_group_tag(TAG)
+#endif
+
+/**
+ * __struct_group() - Create a mirrored named and anonyomous struct
+ *
+ * @TAG: The tag name for the named sub-struct (usually empty)
+ * @NAME: The identifier name of the mirrored sub-struct
+ * @ATTRS: Any struct attributes (usually empty)
+ * @MEMBERS: The member declarations for the mirrored structs
+ *
+ * Used to create an anonymous union of two structs with identical layout
+ * and size: one anonymous and one named. The former's members can be used
+ * normally without sub-struct naming, and the latter can be used to
+ * reason about the start, end, and size of the group of struct members.
+ * The named struct can also be explicitly tagged for layer reuse (C only),
+ * as well as both having struct attributes appended.
+ */
+#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
+ union { \
+ struct { MEMBERS } ATTRS; \
+ struct __struct_group_tag(TAG) { MEMBERS } ATTRS NAME; \
+ } ATTRS
+
+#ifdef __cplusplus
+/* sizeof(struct{}) is 1 in C++, not 0, can't use C version of the macro. */
+#define __DECLARE_FLEX_ARRAY(T, member) \
+ T member[0]
+#else
+/**
+ * __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
+ *
+ * @TYPE: The type of each flexible array element
+ * @NAME: The name of the flexible array member
+ *
+ * In order to have a flexible array member in a union or alone in a
+ * struct, it needs to be wrapped in an anonymous struct with at least 1
+ * named member, but that member can be empty.
+ */
+#define __DECLARE_FLEX_ARRAY(TYPE, NAME) \
+ struct { \
+ struct { } __empty_ ## NAME; \
+ TYPE NAME[]; \
+ }
+#endif
+
+#ifndef __counted_by
+#define __counted_by(m)
+#endif
+
+#ifndef __counted_by_le
+#define __counted_by_le(m)
+#endif
+
+#ifndef __counted_by_be
+#define __counted_by_be(m)
+#endif
+
+#define __kernel_nonstring
+
+#endif /* _LINUX_STDDEF_H */
diff --git a/kernel/linux/uapi/linux/types.h b/kernel/linux/uapi/linux/types.h
new file mode 100644
index 0000000000..912d458e3d
--- /dev/null
+++ b/kernel/linux/uapi/linux/types.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+
+#include <asm/types.h>
+
+#ifndef __ASSEMBLY__
+
+#include <uapi/linux/posix_types.h>
+
+#ifdef __SIZEOF_INT128__
+typedef __signed__ __int128 __s128 __attribute__((aligned(16)));
+typedef unsigned __int128 __u128 __attribute__((aligned(16)));
+#endif
+
+/*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
+ */
+
+/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
+#ifdef __CHECKER__
+#define __bitwise __attribute__((bitwise))
+#else
+#define __bitwise
+#endif
+
+/* The kernel doesn't use this legacy form, but user space does */
+#define __bitwise__ __bitwise
+
+typedef __u16 __bitwise __le16;
+typedef __u16 __bitwise __be16;
+typedef __u32 __bitwise __le32;
+typedef __u32 __bitwise __be32;
+typedef __u64 __bitwise __le64;
+typedef __u64 __bitwise __be64;
+
+typedef __u16 __bitwise __sum16;
+typedef __u32 __bitwise __wsum;
+
+/*
+ * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
+ * common 32/64-bit compat problems.
+ * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
+ * architectures) and to 8-byte boundaries on 64-bit architectures. The new
+ * aligned_64 type enforces 8-byte alignment so that structs containing
+ * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
+ * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
+ */
+#define __aligned_u64 __u64 __attribute__((aligned(8)))
+#define __aligned_s64 __s64 __attribute__((aligned(8)))
+#define __aligned_be64 __be64 __attribute__((aligned(8)))
+#define __aligned_le64 __le64 __attribute__((aligned(8)))
+
+typedef unsigned __bitwise __poll_t;
+
+#endif /* __ASSEMBLY__ */
+#endif /* _LINUX_TYPES_H */
diff --git a/kernel/linux/uapi/linux/vduse.h b/kernel/linux/uapi/linux/vduse.h
index f46269af34..6e4c67a00f 100644
--- a/kernel/linux/uapi/linux/vduse.h
+++ b/kernel/linux/uapi/linux/vduse.h
@@ -2,7 +2,7 @@
#ifndef _VDUSE_H_
#define _VDUSE_H_
-#include <linux/types.h>
+#include <uapi/linux/types.h>
#define VDUSE_BASE 0x81
@@ -237,7 +237,7 @@ struct vduse_iova_umem {
* struct vduse_iova_info - information of one IOVA region
* @start: start of the IOVA region
* @last: last of the IOVA region
- * @capability: capability of the IOVA regsion
+ * @capability: capability of the IOVA region
* @reserved: for future use, needs to be initialized to zero
*
* Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
diff --git a/kernel/linux/uapi/linux/vfio.h b/kernel/linux/uapi/linux/vfio.h
index 79bf8c0cc5..c2e4839f83 100644
--- a/kernel/linux/uapi/linux/vfio.h
+++ b/kernel/linux/uapi/linux/vfio.h
@@ -12,8 +12,9 @@
#ifndef VFIO_H
#define VFIO_H
-#include <linux/types.h>
+#include <uapi/linux/types.h>
#include <linux/ioctl.h>
+#include <uapi/linux/stddef.h>
#define VFIO_API_VERSION 0
@@ -905,10 +906,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 +920,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)
@@ -1468,6 +1479,33 @@ struct vfio_device_feature_bus_master {
};
#define VFIO_DEVICE_FEATURE_BUS_MASTER 10
+/**
+ * Upon VFIO_DEVICE_FEATURE_GET create a dma_buf fd for the
+ * regions selected.
+ *
+ * open_flags are the typical flags passed to open(2), eg O_RDWR, O_CLOEXEC,
+ * etc. offset/length specify a slice of the region to create the dmabuf from.
+ * nr_ranges is the total number of (P2P DMA) ranges that comprise the dmabuf.
+ *
+ * flags should be 0.
+ *
+ * Return: The fd number on success, -1 and errno is set on failure.
+ */
+#define VFIO_DEVICE_FEATURE_DMA_BUF 11
+
+struct vfio_region_dma_range {
+ __u64 offset;
+ __u64 length;
+};
+
+struct vfio_device_feature_dma_buf {
+ __u32 region_index;
+ __u32 open_flags;
+ __u32 flags;
+ __u32 nr_ranges;
+ struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);
+};
+
/* -------- API for Type1 VFIO IOMMU -------- */
/**
diff --git a/kernel/linux/uapi/version b/kernel/linux/uapi/version
index 966a998301..69f29b2320 100644
--- a/kernel/linux/uapi/version
+++ b/kernel/linux/uapi/version
@@ -1 +1 @@
-v6.16
+v6.19
--
2.54.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2] uapi: update headers to v6.19
2026-10-01 9:05 ` [PATCH v2] " David Marchand
@ 2026-10-01 14:12 ` Maxime Coquelin
2026-10-01 16:05 ` Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 0 replies; 15+ messages in thread
From: Maxime Coquelin @ 2026-10-01 14:12 UTC (permalink / raw)
To: David Marchand; +Cc: dev, eperezma, thomas, stephen
[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]
On Thu, Oct 1, 2026 at 11:06 AM David Marchand <david.marchand@redhat.com>
wrote:
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> This patch updates imported UAPI headers to v6.19, in order
> to exercise the new compatibility define for __counted_by.
>
> Since __counted_by is introduced by linux/stddef.h we need to import it,
> and the headers, included by already imported headers, leading to its
> inclusion.
>
> One complication is that linux/types.h contains a guard that must be
> sanitized using the same method as the Linux kernel.
> For this, add a dependency on the unifdef tool.
>
> We also need to fix net/nbl which does not include the VFIO uapi header
> first.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changes since v1:
> - dropped wrapper on __counted_by,
> - updated import process and added use of unidef,
> - fixed net/nbl driver,
> - imported needed uapi headers,
>
> ---
> devtools/linux-uapi.sh | 6 ++
> doc/guides/contributing/linux_uapi.rst | 2 +
> drivers/net/nbl/nbl_common/nbl_userdev.c | 3 +-
> kernel/linux/uapi/linux/posix_types.h | 38 ++++++++++++
> kernel/linux/uapi/linux/stddef.h | 74 ++++++++++++++++++++++++
> kernel/linux/uapi/linux/types.h | 58 +++++++++++++++++++
> kernel/linux/uapi/linux/vduse.h | 4 +-
> kernel/linux/uapi/linux/vfio.h | 42 +++++++++++++-
> kernel/linux/uapi/version | 2 +-
> 9 files changed, 223 insertions(+), 6 deletions(-)
> create mode 100644 kernel/linux/uapi/linux/posix_types.h
> create mode 100644 kernel/linux/uapi/linux/stddef.h
> create mode 100644 kernel/linux/uapi/linux/types.h
>
>
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks!
Maxime
[-- Attachment #2: Type: text/html, Size: 2670 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] uapi: update headers to v6.19
2026-10-01 9:05 ` [PATCH v2] " David Marchand
2026-10-01 14:12 ` Maxime Coquelin
@ 2026-10-01 16:05 ` Stephen Hemminger
2026-10-02 9:46 ` Thomas Monjalon
2026-10-03 9:45 ` David Marchand
3 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2026-10-01 16:05 UTC (permalink / raw)
To: David Marchand; +Cc: dev, eperezma, maxime.coquelin, thomas
On Thu, 1 Oct 2026 11:05:58 +0200
David Marchand <david.marchand@redhat.com> wrote:
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> This patch updates imported UAPI headers to v6.19, in order
> to exercise the new compatibility define for __counted_by.
>
> Since __counted_by is introduced by linux/stddef.h we need to import it,
> and the headers, included by already imported headers, leading to its
> inclusion.
>
> One complication is that linux/types.h contains a guard that must be
> sanitized using the same method as the Linux kernel.
> For this, add a dependency on the unifdef tool.
>
> We also need to fix net/nbl which does not include the VFIO uapi header
> first.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Can take it through next-net but makes more sense to go through next-virtio
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] uapi: update headers to v6.19
2026-10-01 9:05 ` [PATCH v2] " David Marchand
2026-10-01 14:12 ` Maxime Coquelin
2026-10-01 16:05 ` Stephen Hemminger
@ 2026-10-02 9:46 ` Thomas Monjalon
2026-10-02 9:59 ` David Marchand
2026-10-03 9:45 ` David Marchand
3 siblings, 1 reply; 15+ messages in thread
From: Thomas Monjalon @ 2026-10-02 9:46 UTC (permalink / raw)
To: David Marchand; +Cc: dev, eperezma, maxime.coquelin, stephen
01/10/2026 11:05, David Marchand:
> --- a/devtools/linux-uapi.sh
> +++ b/devtools/linux-uapi.sh
> @@ -13,6 +13,9 @@ file=""
> check_headers=false
> quiet=false
>
> +# Require unifdef
> +unifdef -h >/dev/null 2>&1 || { echo "This script requires unifdef."; exit 1; }
Do you need to send the message to stderr?
> --- a/drivers/net/nbl/nbl_common/nbl_userdev.c
> +++ b/drivers/net/nbl/nbl_common/nbl_userdev.c
> @@ -2,8 +2,9 @@
> * Copyright 2025 Nebulamatrix Technology Co., Ltd.
> */
>
> -#include "nbl_userdev.h"
> #include <uapi/linux/vfio.h>
> +
> +#include "nbl_userdev.h"
> #include <rte_vfio.h>
This is tricky.
Is it documented that uAPI headers should be included first?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] uapi: update headers to v6.19
2026-10-02 9:46 ` Thomas Monjalon
@ 2026-10-02 9:59 ` David Marchand
0 siblings, 0 replies; 15+ messages in thread
From: David Marchand @ 2026-10-02 9:59 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, eperezma, maxime.coquelin, stephen
On Fri, 2 Oct 2026 at 11:46, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 01/10/2026 11:05, David Marchand:
> > --- a/devtools/linux-uapi.sh
> > +++ b/devtools/linux-uapi.sh
> > @@ -13,6 +13,9 @@ file=""
> > check_headers=false
> > quiet=false
> >
> > +# Require unifdef
> > +unifdef -h >/dev/null 2>&1 || { echo "This script requires unifdef."; exit 1; }
>
> Do you need to send the message to stderr?
Yes.
> > --- a/drivers/net/nbl/nbl_common/nbl_userdev.c
> > +++ b/drivers/net/nbl/nbl_common/nbl_userdev.c
> > @@ -2,8 +2,9 @@
> > * Copyright 2025 Nebulamatrix Technology Co., Ltd.
> > */
> >
> > -#include "nbl_userdev.h"
> > #include <uapi/linux/vfio.h>
> > +
> > +#include "nbl_userdev.h"
> > #include <rte_vfio.h>
>
> This is tricky.
> Is it documented that uAPI headers should be included first?
https://doc.dpdk.org/guides/contributing/linux_uapi.html#header-inclusion-into-library-or-driver
"""
This inclusion must be done before any header external to DPDK is
included, to prevent inclusion of the system uAPI header in any of
those external headers.
"""
--
David Marchand
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] uapi: update headers to v6.19
2026-10-01 9:05 ` [PATCH v2] " David Marchand
` (2 preceding siblings ...)
2026-10-02 9:46 ` Thomas Monjalon
@ 2026-10-03 9:45 ` David Marchand
3 siblings, 0 replies; 15+ messages in thread
From: David Marchand @ 2026-10-03 9:45 UTC (permalink / raw)
To: maxime.coquelin; +Cc: dev, eperezma, thomas, stephen
On Thu, 1 Oct 2026 at 11:06, David Marchand <david.marchand@redhat.com> wrote:
>
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> This patch updates imported UAPI headers to v6.19, in order
> to exercise the new compatibility define for __counted_by.
>
> Since __counted_by is introduced by linux/stddef.h we need to import it,
> and the headers, included by already imported headers, leading to its
> inclusion.
>
> One complication is that linux/types.h contains a guard that must be
> sanitized using the same method as the Linux kernel.
> For this, add a dependency on the unifdef tool.
>
> We also need to fix net/nbl which does not include the VFIO uapi header
> first.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Moved error logging to stderr.
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-10-03 9:45 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30 9:57 [PATCH 0/2] uapi: introduce compatibility define of old compilers Maxime Coquelin
2026-09-30 9:57 ` [PATCH 1/2] config: add compatibility for old compilers with new UAPI headers Maxime Coquelin
2026-09-30 15:26 ` Stephen Hemminger
2026-09-30 15:37 ` Maxime Coquelin
2026-10-01 8:19 ` David Marchand
2026-10-01 8:30 ` Maxime Coquelin
2026-09-30 9:58 ` [PATCH 2/2] uapi: update headers to v6.19 Maxime Coquelin
2026-09-30 15:27 ` Stephen Hemminger
2026-09-30 15:38 ` Maxime Coquelin
2026-10-01 9:05 ` [PATCH v2] " David Marchand
2026-10-01 14:12 ` Maxime Coquelin
2026-10-01 16:05 ` Stephen Hemminger
2026-10-02 9:46 ` Thomas Monjalon
2026-10-02 9:59 ` David Marchand
2026-10-03 9:45 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox