From: Jakub Sitnicki <jakub@cloudflare•com>
To: John Fastabend <john.fastabend@gmail•com>
Cc: bpf@vger•kernel.org, netdev@vger•kernel.org, andrii@kernel•org
Subject: Re: [PATCH bpf-next v2 1/4] bpf: sockmap, add test for sk_msg prog pop msg helper
Date: Fri, 26 Jan 2024 12:48:45 +0100 [thread overview]
Message-ID: <874jf0ffza.fsf@cloudflare.com> (raw)
In-Reply-To: <20240124185403.1104141-2-john.fastabend@gmail.com>
On Wed, Jan 24, 2024 at 10:54 AM -08, John Fastabend wrote:
> For msg_pop sk_msg helpers we only have older tests in test_sockmap, but
> these are showing their age. They don't use any of the newer style BPF
> and also require running test_sockmap. Lets use the prog_test framework
> and add a test for msg_pop.
>
> This is a much nicer test env using newer style BPF. We can
> extend this to support all the other helpers shortly.
>
> The bpf program is a template that lets us run through all the helpers
> so we can cover not just pop, but all the other helpers as well.
>
> Signed-off-by: John Fastabend <john.fastabend@gmail•com>
> ---
> .../bpf/prog_tests/sockmap_helpers.h | 10 +
> .../bpf/prog_tests/sockmap_msg_helpers.c | 210 ++++++++++++++++++
> .../bpf/progs/test_sockmap_msg_helpers.c | 52 +++++
> 3 files changed, 272 insertions(+)
> create mode 100644 tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
> create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c
>
[...]
> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c b/tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
> new file mode 100644
> index 000000000000..9ffe02f45808
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_msg_helpers.c
> @@ -0,0 +1,210 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2020 Cloudflare
Thanks, but we can't take the credit for this brand new file ;-)
> +#include <error.h>
> +#include <netinet/tcp.h>
> +#include <sys/epoll.h>
> +
> +#include "test_progs.h"
> +#include "test_sockmap_msg_helpers.skel.h"
> +#include "sockmap_helpers.h"
> +
> +#define TCP_REPAIR 19 /* TCP sock is under repair right now */
> +
> +#define TCP_REPAIR_ON 1
> +#define TCP_REPAIR_OFF_NO_WP -1 /* Turn off without window probes */
These defines are not unused by this module. Copy-pasted by mistake?
[...]
> diff --git a/tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c b/tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c
> new file mode 100644
> index 000000000000..c721a00b6001
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/test_sockmap_msg_helpers.c
> @@ -0,0 +1,52 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2020 Cloudflare
^ :-)
[...]
next prev parent reply other threads:[~2024-01-26 12:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 18:53 [PATCH bpf-next v2 0/4] transition sockmap testing to test_progs John Fastabend
2024-01-24 18:54 ` [PATCH bpf-next v2 1/4] bpf: sockmap, add test for sk_msg prog pop msg helper John Fastabend
2024-01-26 11:48 ` Jakub Sitnicki [this message]
2024-01-26 15:37 ` John Fastabend
2024-01-24 18:54 ` [PATCH bpf-next v2 2/4] bpf: sockmap, add a sendmsg test so we can check that path John Fastabend
2024-01-26 12:17 ` Jakub Sitnicki
2024-01-26 14:24 ` Jakub Sitnicki
2024-01-26 15:38 ` John Fastabend
2024-01-24 18:54 ` [PATCH bpf-next v2 3/4] bpf: sockmap, add a cork to force buffering of the scatterlist John Fastabend
2024-01-26 14:19 ` Jakub Sitnicki
2024-01-26 15:38 ` John Fastabend
2024-01-24 18:54 ` [PATCH bpf-next v2 4/4] bpf: sockmap test cork and pop combined John Fastabend
2024-01-24 22:58 ` [PATCH bpf-next v2 0/4] transition sockmap testing to test_progs John Fastabend
2024-01-26 14:39 ` Jakub Sitnicki
2024-01-26 15:40 ` John Fastabend
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=874jf0ffza.fsf@cloudflare.com \
--to=jakub@cloudflare$(echo .)com \
--cc=andrii@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=john.fastabend@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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