[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220329165718.GA10381@kbox>
Date: Tue, 29 Mar 2022 09:57:18 -0700
From: Beau Belgrave <beaub@...ux.microsoft.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
Beau Belgrave <beaub@...rosoft.com>,
linux-arch <linux-arch@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-trace-devel <linux-trace-devel@...r.kernel.org>,
rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Alexei Starovoitov <ast@...nel.org>
Subject: Re: Comments on new user events ABI
On Tue, Mar 29, 2022 at 09:25:52AM -0700, Alexei Starovoitov wrote:
> On Tue, Mar 29, 2022 at 9:17 AM Mathieu Desnoyers
> <mathieu.desnoyers@...icios.com> 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.
Sorry about that, I'm sending a patch to remove this.
I'll have another patch to add it back in out to bpf and trace-devel for
review.
Thanks,
-Beau
Powered by blists - more mailing lists