netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>, netdev@vger.kernel.org
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Martin KaFai Lau <kafai@fb.com>,
	bpf@vger.kernel.org
Subject: Re: [PATCH net-next v3 5/5] bpf: update XDP selftests to not fail with generic XDP
Date: Wed, 23 Jun 2021 13:17:34 +0200	[thread overview]
Message-ID: <878s30omnl.fsf@toke.dk> (raw)
In-Reply-To: <20210622202835.1151230-6-memxor@gmail.com>

Kumar Kartikeya Dwivedi <memxor@gmail.com> writes:

> Generic XDP devmaps and cpumaps now allow setting value_size to 8 bytes
> (so that prog_fd can be specified) and XDP progs using them succeed in
> SKB mode now. Adjust the checks.
>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> ---
>  tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c | 4 ++--
>  tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c
> index 0176573fe4e7..42e46d2ae349 100644
> --- a/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c
> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c
> @@ -29,8 +29,8 @@ void test_xdp_with_cpumap_helpers(void)
>  	 */
>  	prog_fd = bpf_program__fd(skel->progs.xdp_redir_prog);
>  	err = bpf_set_link_xdp_fd(IFINDEX_LO, prog_fd, XDP_FLAGS_SKB_MODE);
> -	CHECK(err == 0, "Generic attach of program with 8-byte CPUMAP",
> -	      "should have failed\n");
> +	CHECK(err, "Generic attach of program with 8-byte CPUMAP",
> +	      "shouldn't have failed\n");

There's a comment right above this that is now wrong... Also, this
program is never being detached.

>  	prog_fd = bpf_program__fd(skel->progs.xdp_dummy_cm);
>  	map_fd = bpf_map__fd(skel->maps.cpu_map);
> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
> index 88ef3ec8ac4c..861db508ace2 100644
> --- a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
> @@ -31,8 +31,8 @@ void test_xdp_with_devmap_helpers(void)
>  	 */
>  	dm_fd = bpf_program__fd(skel->progs.xdp_redir_prog);
>  	err = bpf_set_link_xdp_fd(IFINDEX_LO, dm_fd, XDP_FLAGS_SKB_MODE);
> -	CHECK(err == 0, "Generic attach of program with 8-byte devmap",
> -	      "should have failed\n");
> +	CHECK(err, "Generic attach of program with 8-byte devmap",
> +	      "shouldn't have failed\n");

... same here


-Toke


      reply	other threads:[~2021-06-23 11:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 20:28 [PATCH net-next v3 0/5] Generic XDP improvements Kumar Kartikeya Dwivedi
2021-06-22 20:28 ` [PATCH net-next v3 1/5] net: core: split out code to run generic XDP prog Kumar Kartikeya Dwivedi
2021-06-22 20:28 ` [PATCH net-next v3 2/5] bitops: add non-atomic bitops for pointers Kumar Kartikeya Dwivedi
2021-06-22 21:52   ` Toke Høiland-Jørgensen
2021-06-22 22:10     ` Kumar Kartikeya Dwivedi
2021-06-22 22:33       ` Toke Høiland-Jørgensen
2021-06-22 23:16         ` Kumar Kartikeya Dwivedi
2021-06-23 11:09           ` Toke Høiland-Jørgensen
2021-06-24 13:08             ` David Laight
2021-06-22 20:28 ` [PATCH net-next v3 3/5] bpf: cpumap: implement generic cpumap Kumar Kartikeya Dwivedi
2021-06-22 20:28 ` [PATCH net-next v3 4/5] bpf: devmap: implement devmap prog execution for generic XDP Kumar Kartikeya Dwivedi
2021-06-22 20:28 ` [PATCH net-next v3 5/5] bpf: update XDP selftests to not fail with " Kumar Kartikeya Dwivedi
2021-06-23 11:17   ` Toke Høiland-Jørgensen [this message]

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=878s30omnl.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kuba@kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).