* Re: Comments on new user events ABI
[not found] ` <1014535694.197402.1648570634323.JavaMail.zimbra@efficios.com>
@ 2022-03-29 16:25 ` Alexei Starovoitov
2022-03-29 16:57 ` Beau Belgrave
2022-03-29 19:45 ` Steven Rostedt
0 siblings, 2 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2022-03-29 16:25 UTC (permalink / raw)
To: Mathieu Desnoyers, Linus Torvalds, bpf, Network Development
Cc: Beau Belgrave, Beau Belgrave, linux-arch, linux-kernel,
linux-trace-devel, rostedt, Masami Hiramatsu, Alexei Starovoitov
On Tue, Mar 29, 2022 at 9:17 AM Mathieu Desnoyers
<mathieu.desnoyers@efficios.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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Comments on new user events ABI
2022-03-29 16:25 ` Comments on new user events ABI Alexei Starovoitov
@ 2022-03-29 16:57 ` Beau Belgrave
2022-03-29 19:45 ` Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Beau Belgrave @ 2022-03-29 16:57 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Mathieu Desnoyers, Linus Torvalds, bpf, Network Development,
Beau Belgrave, linux-arch, linux-kernel, linux-trace-devel,
rostedt, Masami Hiramatsu, Alexei Starovoitov
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@efficios.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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Comments on new user events ABI
2022-03-29 16:25 ` Comments on new user events ABI Alexei Starovoitov
2022-03-29 16:57 ` Beau Belgrave
@ 2022-03-29 19:45 ` Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2022-03-29 19:45 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Mathieu Desnoyers, Linus Torvalds, bpf, Network Development,
Beau Belgrave, Beau Belgrave, linux-arch, linux-kernel,
linux-trace-devel, Masami Hiramatsu, Alexei Starovoitov
On Tue, 29 Mar 2022 09:25:52 -0700
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> Thanks for flagging.
>
> Whoever added this user_bpf* stuff please remove it immediately.
> It was never reviewed by bpf maintainers.
Heh, now you know how the x86 maintainers feel ;-)
>
> It's a hard Nack to add a bpf interface to user_events.
Agreed, I'm thinking of marking the entire thing as broken such that it can
be worked on a bit more without a total revert (but still remove the BPF
portion on your request).
Beau, I agree with Mathieu, I don't think it's a good idea to expose the
"ftrace/perf/etc" users. The only thing that the application needs is a bit
to say "call the write now". And let the work be done within the kernel.
I think a single bit may be better, that way you can have many more events
on a page, and since they do not get modified often, it will be in hot
cache and fast.
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-29 19:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com>
[not found] ` <20220329002935.2869-1-beaub@linux.microsoft.com>
[not found] ` <1014535694.197402.1648570634323.JavaMail.zimbra@efficios.com>
2022-03-29 16:25 ` Comments on new user events ABI Alexei Starovoitov
2022-03-29 16:57 ` Beau Belgrave
2022-03-29 19:45 ` Steven Rostedt
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).