BPF List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Felix Maurer <fmaurer@redhat.com>, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org,
	davemarchevsky@fb.com
Subject: RE: [PATCH bpf-next] selftests: bpf: Check bpf_msg_push_data return value
Date: Mon, 14 Feb 2022 09:19:47 -0800	[thread overview]
Message-ID: <620a8f3381929_2bedb20899@john.notmuch> (raw)
In-Reply-To: <89f767bb44005d6b4dd1f42038c438f76b3ebfad.1644601294.git.fmaurer@redhat.com>

Felix Maurer wrote:
> bpf_msg_push_data may return a non-zero value to indicate an error. The
> return value should be checked to prevent undetected errors.
> 
> To indicate an error, the BPF programs now perform a different action
> than their intended one to make the userspace test program notice the
> error, i.e., the programs supposed to pass/redirect drop, the program
> supposed to drop passes.
> 
> Fixes: 84fbfe026acaa ("bpf: test_sockmap add options to use msg_push_data")
> Signed-off-by: Felix Maurer <fmaurer@redhat.com>
> ---
>  .../selftests/bpf/progs/test_sockmap_kern.h   | 26 +++++++++++++------
>  1 file changed, 18 insertions(+), 8 deletions(-)

LGTM. As a general comment we should be looking to convert test_sockmap
over to the modern globals method to detect errors like used in all the
other tests. Also I've been considering porting the tests we need into
the more generally used test_progs framework. Or go the other way and
take some of the general functions used in test_prog and use them in
test_sockmap.

Right now code wise test_sockmap is a bit of an island. But, this patch
is good we shouldn't block small useful fixes because we are waiting for
me to conjure up some time to do a bigger overhaul. I mention in case
someone else is able to pick it up. Feel free to ping me if its
interesting. Otherwise I'll get to it when I can.

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2022-02-14 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 17:43 [PATCH bpf-next] selftests: bpf: Check bpf_msg_push_data return value Felix Maurer
2022-02-14 17:19 ` John Fastabend [this message]
2022-02-15 18:20 ` patchwork-bot+netdevbpf

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=620a8f3381929_2bedb20899@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davemarchevsky@fb.com \
    --cc=fmaurer@redhat.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=songliubraving@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