From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
bpf <bpf@vger.kernel.org>,
Network Development <netdev@vger.kernel.org>
Cc: Beau Belgrave <beaub@linux.microsoft.com>,
Beau Belgrave <beaub@microsoft.com>,
linux-arch <linux-arch@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-trace-devel <linux-trace-devel@vger.kernel.org>,
rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Alexei Starovoitov <ast@kernel.org>
Subject: Re: Comments on new user events ABI
Date: Tue, 29 Mar 2022 09:25:52 -0700 [thread overview]
Message-ID: <CAADnVQK=GCuhTHz=iwv0r7Y37gYvt_UBzkfFJmNT+uR0z+7Myw@mail.gmail.com> (raw)
In-Reply-To: <1014535694.197402.1648570634323.JavaMail.zimbra@efficios.com>
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.
next prev parent reply other threads:[~2022-03-29 16:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 20:24 Comments on new user events ABI Mathieu Desnoyers
2022-03-28 20:35 ` Mathieu Desnoyers
2022-03-28 23:30 ` Beau Belgrave
2022-03-29 0:29 ` Beau Belgrave
2022-03-29 16:17 ` Mathieu Desnoyers
2022-03-29 16:25 ` Alexei Starovoitov [this message]
2022-03-29 16:57 ` Beau Belgrave
2022-03-29 19:45 ` Steven Rostedt
2022-03-29 21:54 ` Beau Belgrave
2022-03-30 6:31 ` Masami Hiramatsu
2022-03-31 19:05 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAADnVQK=GCuhTHz=iwv0r7Y37gYvt_UBzkfFJmNT+uR0z+7Myw@mail.gmail.com' \
--to=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=beaub@linux.microsoft.com \
--cc=beaub@microsoft.com \
--cc=bpf@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).