From: Martin KaFai Lau <kafai@fb.com>
To: Okash Khawaja <osk@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
Jakub Kicinski <jakub.kicinski@netronome.com>,
"David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
<kernel-team@fb.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf v2 1/1] bpf: btf: Fix bitfield extraction for big endian
Date: Tue, 10 Jul 2018 16:46:16 -0700 [thread overview]
Message-ID: <20180710234528.2kj2kv7gjmigvvgp@kafai-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20180710214522.339195416@fb.com>
On Tue, Jul 10, 2018 at 02:33:07PM -0700, Okash Khawaja wrote:
> When extracting bitfield from a number, btf_int_bits_seq_show() builds
> a mask and accesses least significant byte of the number in a way
> specific to little-endian. This patch fixes that by checking endianness
> of the machine and then shifting left and right the unneeded bits.
>
> Thanks to Martin Lau for the help in navigating potential pitfalls when
> dealing with endianess and for the final solution.
>
> Fixes: b00b8daec828 ("bpf: btf: Add pretty print capability for data with BTF type info")
> Signed-off-by: Okash Khawaja <osk@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
next prev parent reply other threads:[~2018-07-10 23:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 21:33 [PATCH bpf v2 0/1] bpf: btf: Fix endianness of bitfields Okash Khawaja
2018-07-10 21:33 ` [PATCH bpf v2 1/1] bpf: btf: Fix bitfield extraction for big endian Okash Khawaja
2018-07-10 23:46 ` Martin KaFai Lau [this message]
2018-07-11 22:12 ` 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=20180710234528.2kj2kv7gjmigvvgp@kafai-mbp.dhcp.thefacebook.com \
--to=kafai@fb.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=osk@fb.com \
--cc=yhs@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 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).