Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrii Nakryiko <firstname.lastname@example.org>
To: Alan Maguire <email@example.com>
Cc: Alexei Starovoitov <firstname.lastname@example.org>,
Daniel Borkmann <email@example.com>,
Andrii Nakryiko <firstname.lastname@example.org>, Martin Lau <email@example.com>,
Song Liu <firstname.lastname@example.org>, Yonghong Song <email@example.com>,
john fastabend <firstname.lastname@example.org>,
KP Singh <email@example.com>, Bill Wendling <firstname.lastname@example.org>,
Shuah Khan <email@example.com>, bpf <firstname.lastname@example.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
open list <email@example.com>
Subject: Re: [PATCH bpf-next 1/3] libbpf: avoid use of __int128 in typed dump display
Date: Tue, 20 Jul 2021 13:51:10 -0700 [thread overview]
Message-ID: <CAEf4BzY+c8WMJAPTELOikxDLJvC4S0w532bZGGNMjWGeA2WpVg@mail.gmail.com> (raw)
On Tue, Jul 20, 2021 at 2:14 AM Alan Maguire <firstname.lastname@example.org> wrote:
> On Mon, 19 Jul 2021, Andrii Nakryiko wrote:
> > On Mon, Jul 19, 2021 at 2:41 PM Alan Maguire <email@example.com> wrote:
> > >
> > > __int128 is not supported for some 32-bit platforms (arm and i386).
> > > __int128 was used in carrying out computations on bitfields which
> > > aid display, but the same calculations could be done with __u64
> > > with the small effect of not supporting 128-bit bitfields.
> > >
> > > With these changes, a big-endian issue with casting 128-bit integers
> > > to 64-bit for enum bitfields is solved also, as we now use 64-bit
> > > integers for bitfield calculations.
> > >
> > > Reported-by: Naresh Kamboju <firstname.lastname@example.org>
> > > Reported-by: Linux Kernel Functional Testing <email@example.com>
> > > Signed-off-by: Alan Maguire <firstname.lastname@example.org>
> > > ---
> > Changes look good to me, thanks. But they didn't appear in patchworks
> > yet so I can't easily test and apply them. It might be because of
> > patchworks delay or due to a very long CC list. Try trimming the cc
> > list down and re-submit?
> Done, looks like the v2 with the trimmed cc list made it into patchwork
> this time.
v1 also made it to the list right after I wrote the email :)
> > Also, while I agree that supporting 128-bit bitfields isn't important,
> > I wonder if we should warn/error on that (instead of shifting by
> > negative amount and reporting some garbage value), what do you think?
> > Is there one place in the code where we can error out early if the
> > type actually has bitfield with > 64 bits? I'd prefer to keep
> > btf_dump_bitfield_get_data() itself non-failing though.
> Sorry, I missed the last part and made that function fail since
> it's probably the easiest place to capture too-large bitfields.
> I renamed it to btf_dump_get_bitfield_value() to match
> btf_dump_get_enum_value() which as a similar function signature
> (return int, pass in a pointer to the value we want to retrieve).
> We can't localize bitfield size checking to
> btf_dump_type_data_check_zero() because - depending on flags -
> the associated checks might not be carried out. So duplication
> of bitfield size checks between the zero checking and bitfield/enum
> bitfield display seems inevitable, and that being the case, the
> extra error checking required around btf_dump_get_bitfield_value()
> seems to be required.
> I might be missing a better approach here of course; let me know what you
> think. Thanks again!
Nah, that's fine. Looks good. Testing and pushing in a few minutes. Thanks.
next prev parent reply other threads:[~2021-07-20 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-19 21:41 [PATCH bpf-next 0/3] libbpf: btf typed data dumping fixes (__int128 usage, error propagation) Alan Maguire
2021-07-19 21:41 ` [PATCH bpf-next 1/3] libbpf: avoid use of __int128 in typed dump display Alan Maguire
2021-07-19 22:38 ` Andrii Nakryiko
2021-07-20 9:13 ` Alan Maguire
2021-07-20 20:51 ` Andrii Nakryiko [this message]
2021-07-19 21:41 ` [PATCH bpf-next 2/3] selftests/bpf: add __int128-specific tests for typed data dump Alan Maguire
2021-07-19 21:41 ` [PATCH bpf-next 3/3] libbpf: propagate errors when retrieving enum value for typed data display Alan Maguire
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--subject='Re: [PATCH bpf-next 1/3] libbpf: avoid use of __int128 in typed dump display' \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).