[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGLYoSIEWtmWieLM@mini-arch>
Date: Mon, 30 Jun 2025 11:34:09 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Jordan Rife <jordan@...fe.io>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: Re: [PATCH v3 bpf-next 08/12] selftests/bpf: Allow for iteration
over multiple states
On 06/30, Jordan Rife wrote:
> Add parentheses around loopback address check to fix up logic and make
> the socket state filter configurable for the TCP socket iterators.
> Iterators can skip the socket state check by setting ss to 0.
>
> Signed-off-by: Jordan Rife <jordan@...fe.io>
> ---
> .../selftests/bpf/prog_tests/sock_iter_batch.c | 2 ++
> tools/testing/selftests/bpf/progs/sock_iter_batch.c | 11 ++++++-----
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c b/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c
> index 0d0f1b4debff..afe0f55ead75 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sock_iter_batch.c
> @@ -433,6 +433,7 @@ static void do_resume_test(struct test_case *tc)
> skel->rodata->ports[0] = 0;
> skel->rodata->ports[1] = 0;
> skel->rodata->sf = tc->family;
> + skel->rodata->ss = 0;
>
> err = sock_iter_batch__load(skel);
> if (!ASSERT_OK(err, "sock_iter_batch__load"))
> @@ -498,6 +499,7 @@ static void do_test(int sock_type, bool onebyone)
> skel->rodata->ports[i] = ntohs(local_port);
> }
> skel->rodata->sf = AF_INET6;
[..]
> + skel->rodata->ss = TCP_LISTEN;
nit: let's maybe add `if (sock_type == SOCK_STREAM)` here? I see that you're
adding ss check only to the tcp prog, but let's also clearly state
the intent here..
Powered by blists - more mailing lists