Re: Comments on new user events ABI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 29, 2022 at 9:17 AM Mathieu Desnoyers
<mathieu.desnoyers@xxxxxxxxxxxx> wrote:
>
> >
> >> include/uapi/linux/user_events.h:
> >>
> >> struct user_bpf_iter {
> >>
> >>         /* Offset of the data within the first iovec */
> >>         __u32 iov_offset;
> >>
> >>         /* Number of iovec structures */
> >>         __u32 nr_segs;
> >>
> >>         /* Pointer to iovec structures */
> >>         const struct iovec *iov;
> >>
> >>                            ^ a pointer in a uapi header is usually a no-go. This should be a u64.
> >> };
> >>
> >> include/uapi/linux/user_events.h:
> >>
> >> struct user_bpf_context {
> >>
> >>         /* Data type being passed (see union below) */
> >>         __u32 data_type;
> >>
> >>         /* Length of the data */
> >>         __u32 data_len;
> >>
> >>         /* Pointer to data, varies by data type */
> >>         union {
> >>                 /* Kernel data (data_type == USER_BPF_DATA_KERNEL) */
> >>                 void *kdata;
> >>
> >>                 /* User data (data_type == USER_BPF_DATA_USER) */
> >>                 void *udata;
> >>
> >>                 /* Direct iovec (data_type == USER_BPF_DATA_ITER) */
> >>                 struct user_bpf_iter *iter;
> >>
> >>                                ^ likewise for the 3 pointers above. Should be u64 in uapi headers.
> >>         };
> >> };
> >>
> >
> > The bpf structs are only used within a BPF program. At that point the pointer
> > sizes should all align, right?
>
> I must admit I do not know enough about the eBPF uapi practices to answer this.
> [CCing Alexei on this]

Mathieu,

Thanks for flagging.

Whoever added this user_bpf* stuff please remove it immediately.
It was never reviewed by bpf maintainers.

It's a hard Nack to add a bpf interface to user_events.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux