[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <641a2b86c449_80a2420866@john.notmuch>
Date: Tue, 21 Mar 2023 15:11:18 -0700
From: John Fastabend <john.fastabend@...il.com>
To: John Fastabend <john.fastabend@...il.com>, jakub@...udflare.com,
daniel@...earbox.net, lmb@...valent.com, cong.wang@...edance.com
Cc: bpf@...r.kernel.org, john.fastabend@...il.com,
netdev@...r.kernel.org, edumazet@...gle.com, ast@...nel.org,
andrii@...nel.org, will@...valent.com
Subject: RE: [PATCH bpf 10/11] bpf: sockmap, test shutdown() correctly exits
epoll and recv()=0
John Fastabend wrote:
> When session gracefully shutdowns epoll needs to wake up and any recv()
> readers should return 0 not the -EAGAIN they previously returned.
>
> Note we use epoll instead of select to test the epoll wake on shutdown
> event as well.
>
> Signed-off-by: John Fastabend <john.fastabend@...il.com>
> ---
> .../selftests/bpf/prog_tests/sockmap_basic.c | 71 ++++++++++++++++++-
> .../bpf/progs/test_sockmap_pass_prog.c | 32 +++++++++
> 2 files changed, 100 insertions(+), 3 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_pass_prog.c
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
> index 0aa088900699..38a22c71b8dd 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
> @@ -2,6 +2,7 @@
> // Copyright (c) 2020 Cloudflare
> #include <error.h>
> #include <netinet/tcp.h>
> +#include <sys/epoll.h>
>
> #include "test_progs.h"
> #include "test_skmsg_load_helpers.skel.h"
> @@ -9,8 +10,11 @@
> #include "test_sockmap_invalid_update.skel.h"
> #include "test_sockmap_skb_verdict_attach.skel.h"
> #include "test_sockmap_progs_query.skel.h"
> +#include "test_sockmap_pass_prog.skel.h"
> #include "bpf_iter_sockmap.skel.h"
>
> +#include "sockmap_helpers.h"
> +
> #define TCP_REPAIR 19 /* TCP sock is under repair right now */
>
> #define TCP_REPAIR_ON 1
> @@ -286,9 +290,6 @@ static void test_sockmap_skb_verdict_attach(enum bpf_attach_type first,
> err = bpf_prog_attach(verdict, map, second, 0);
> ASSERT_EQ(err, -EBUSY, "prog_attach_fail");
>
> - err = bpf_prog_detach2(verdict, map, first);
> - if (!ASSERT_OK(err, "bpf_prog_detach2"))
> - goto out;
Also shouldn't have cut these will add this back in v2.
Powered by blists - more mailing lists