All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Mykola Lysenko <mykolal@fb.com>, bpf <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v5 bpf-next] Small BPF verifier log improvements
Date: Wed, 2 Mar 2022 14:13:56 -0800	[thread overview]
Message-ID: <CAADnVQLEbDrKt-ehyR=FqMfxcWLL0Tg6i7cKY+jjybBJLn+E0w@mail.gmail.com> (raw)
In-Reply-To: <d4e589ac-db4d-b721-580c-120ee524084d@iogearbox.net>

On Wed, Mar 2, 2022 at 1:46 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 3/2/22 10:23 PM, Alexei Starovoitov wrote:
> > On Tue, Mar 01, 2022 at 02:27:45PM -0800, Mykola Lysenko wrote:
> >>              .prog_type = BPF_PROG_TYPE_SCHED_CLS,
> >>              .matches = {
> >> -                    {6, "R3_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
> >> -                    {7, "R4_w=inv(id=1,umax_value=255,var_off=(0x0; 0xff))"},
> >> -                    {8, "R4_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff))"},
> >> -                    {9, "R4_w=inv(id=1,umax_value=255,var_off=(0x0; 0xff))"},
> >> -                    {10, "R4_w=inv(id=0,umax_value=510,var_off=(0x0; 0x1fe))"},
> >> -                    {11, "R4_w=inv(id=1,umax_value=255,var_off=(0x0; 0xff))"},
> >> -                    {12, "R4_w=inv(id=0,umax_value=1020,var_off=(0x0; 0x3fc))"},
> >> -                    {13, "R4_w=inv(id=1,umax_value=255,var_off=(0x0; 0xff))"},
> >> -                    {14, "R4_w=inv(id=0,umax_value=2040,var_off=(0x0; 0x7f8))"},
> >> -                    {15, "R4_w=inv(id=0,umax_value=4080,var_off=(0x0; 0xff0))"},
> >> +                    {6, "R3_w=scalar(umax=255,var_off=(0x0; 0xff))"},
> >> +                    {7, "R4_w=scalar(id=1,umax=255,var_off=(0x0; 0xff))"},
> >> +                    {8, "R4_w=scalar(umax=255,var_off=(0x0; 0xff))"},
> >> +                    {9, "R4_w=scalar(id=1,umax=255,var_off=(0x0; 0xff))"},
> >> +                    {10, "R4_w=scalar(umax=510,var_off=(0x0; 0x1fe))"},
> >> +                    {11, "R4_w=scalar(id=1,umax=255,var_off=(0x0; 0xff))"},
> >> +                    {12, "R4_w=scalar(umax=1020,var_off=(0x0; 0x3fc))"},
> >> +                    {13, "R4_w=scalar(id=1,umax=255,var_off=(0x0; 0xff))"},
> >> +                    {14, "R4_w=scalar(umax=2040,var_off=(0x0; 0x7f8))"},
> >> +                    {15, "R4_w=scalar(umax=4080,var_off=(0x0; 0xff0))"},
> >
> > Sorry for the later review.
> > Would "int" be more precise and less verbose than "scalar"?
>
> Could work as well, although in many places today we make use of the term "scalar",
> so developers might be more familiar with it (and more consistent towards the
> verifier type internals).

I was focusing more on users who will see these logs and
would have to interpret them.
I suspect the ratio is 1 developer to 1000 users.
The users have to fight the verifier quite a bit to make the program pass.
I was thinking about "i64" too. That's what llvm is using,
but it's less clear than "int", which should be obvious
for users since they write progs in C.
It's also shorter.

I can live with "scalar" though.

  reply	other threads:[~2022-03-02 22:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 22:27 [PATCH v5 bpf-next] Small BPF verifier log improvements Mykola Lysenko
2022-03-02 21:23 ` Alexei Starovoitov
2022-03-02 21:46   ` Daniel Borkmann
2022-03-02 22:13     ` Alexei Starovoitov [this message]
2022-03-03 15:51       ` Daniel Borkmann

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='CAADnVQLEbDrKt-ehyR=FqMfxcWLL0Tg6i7cKY+jjybBJLn+E0w@mail.gmail.com' \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=mykolal@fb.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.