From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Yonghong Song <yhs@fb.com>
Cc: Andrii Nakryiko <andriin@fb.com>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Alexei Starovoitov <ast@fb.com>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"andrii.nakryiko@gmail.com" <andrii.nakryiko@gmail.com>,
Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH bpf-next] libbpf: simplify BPF_CORE_READ_BITFIELD_PROBED usage
Date: Wed, 6 Nov 2019 13:58:22 -0800 [thread overview]
Message-ID: <CAADnVQ+EHbJ950L93Wa4ZxJDQ_PvPwv-re9+95GighudmN3iDQ@mail.gmail.com> (raw)
In-Reply-To: <bdc51aac-6d39-13a6-f50e-8fca3d329b4b@fb.com>
On Wed, Nov 6, 2019 at 1:21 PM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 11/6/19 12:15 PM, Andrii Nakryiko wrote:
> > Streamline BPF_CORE_READ_BITFIELD_PROBED interface to follow
> > BPF_CORE_READ_BITFIELD (direct) and BPF_CORE_READ, in general, i.e., just
> > return read result or 0, if underlying bpf_probe_read() failed.
> >
> > In practice, real applications rarely check bpf_probe_read() result, because
> > it has to always work or otherwise it's a bug. So propagating internal
> > bpf_probe_read() error from this macro hurts usability without providing real
> > benefits in practice. This patch fixes the issue and simplifies usage,
> > noticeable even in selftest itself.
>
> Agreed. This will be consistent with direct read where
> returning value will be 0 if any fault happens.
>
> In really rare cases, if user want to distinguish good value 0 from
> bpf_probe_read() returning error, all building macros are in the header
> file, user can have a custom solution. But let us have API work
> for common use case with good usability.
>
> >
> > Cc: Yonghong Song <yhs@fb.com>
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
>
> Acked-by: Yonghong Song <yhs@fb.com>
Applied. Thanks
Yonghong, please trim your replies.
next prev parent reply other threads:[~2019-11-06 21:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 20:15 [PATCH bpf-next] libbpf: simplify BPF_CORE_READ_BITFIELD_PROBED usage Andrii Nakryiko
2019-11-06 21:18 ` Yonghong Song
2019-11-06 21:58 ` Alexei Starovoitov [this message]
2019-11-06 22:02 ` Yonghong Song
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=CAADnVQ+EHbJ950L93Wa4ZxJDQ_PvPwv-re9+95GighudmN3iDQ@mail.gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=Kernel-team@fb.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--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).