On Thu, 24 Sept 2026 at 14:33, Eugenio Perez Martin <[email protected]> wrote:
> > diff --git a/kernel/linux/uapi/linux/vfio.h b/kernel/linux/uapi/linux/vfio.h
> > index 79bf8c0cc5e4..c85dcbfe302b 100644
> > --- a/kernel/linux/uapi/linux/vfio.h
> > +++ b/kernel/linux/uapi/linux/vfio.h

[...]

> > @@ -1468,6 +1497,64 @@ 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);
>
> Not all gcc versions of CI like the __counted_by argument. Should I
> not import this header?
>

We import and update all uapi headers or none in DPDK, for a given
kernel version.
And the CI checks that the imported headers are aligned with the
announced kernel version (meaning that we can't update our local copy
of the header).

We could import linux/stddef.h but it may become a problem in the future.
Or pass a -D'__counted_by(a)=' option in the DPDK project CFLAGS if
the compiler does not support __counted_by...
Or another option would be to update all users of linux/vfio.h in DPDK... :-(

Other ideas?

-- 
David Marchand

Reply via email to