From: John Fastabend <john.fastabend@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>,
jakub@cloudflare.com, daniel@iogearbox.net, lmb@isovalent.com,
cong.wang@bytedance.com
Cc: bpf@vger.kernel.org, john.fastabend@gmail.com,
netdev@vger.kernel.org, edumazet@google.com, ast@kernel.org,
andrii@kernel.org, will@isovalent.com
Subject: RE: [PATCH bpf 10/11] bpf: sockmap, test shutdown() correctly exits epoll and recv()=0
Date: Tue, 21 Mar 2023 15:11:18 -0700 [thread overview]
Message-ID: <641a2b86c449_80a2420866@john.notmuch> (raw)
In-Reply-To: <20230321215212.525630-11-john.fastabend@gmail.com>
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@gmail.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.
next prev parent reply other threads:[~2023-03-21 22:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 21:52 [PATCH bpf 00/11] bpf sockmap fixes John Fastabend
2023-03-21 21:52 ` [PATCH bpf 01/11] bpf: sockmap, pass skb ownership through read_skb John Fastabend
2023-03-21 21:52 ` [PATCH bpf 02/11] bpf: sockmap, convert schedule_work into delayed_work John Fastabend
2023-03-21 21:52 ` [PATCH bpf 03/11] bpf: sockmap, improved check for empty queue John Fastabend
2023-03-21 21:52 ` [PATCH bpf 04/11] bpf: sockmap, handle fin correctly John Fastabend
2023-03-21 21:52 ` [PATCH bpf 05/11] bpf: sockmap, TCP data stall on recv before accept John Fastabend
2023-03-21 22:07 ` Eric Dumazet
2023-03-21 22:09 ` John Fastabend
2023-03-21 21:52 ` [PATCH bpf 06/11] bpf: sockmap, wake up polling after data copy John Fastabend
2023-03-21 21:52 ` [PATCH bpf 07/11] bpf: sockmap incorrectly handling copied_seq John Fastabend
2023-03-22 3:10 ` Eric Dumazet
2023-03-22 5:39 ` John Fastabend
2023-03-21 21:52 ` [PATCH bpf 08/11] bpf: sockmap, pull socket helpers out of listen test for general use John Fastabend
2023-03-21 21:52 ` [PATCH bpf 09/11] bpf: sockmap, build helper to create connected socket pair John Fastabend
2023-03-21 21:52 ` [PATCH bpf 10/11] bpf: sockmap, test shutdown() correctly exits epoll and recv()=0 John Fastabend
2023-03-21 22:11 ` John Fastabend [this message]
2023-03-21 21:52 ` [PATCH bpf 11/11] bpf: sockmap, test FIONREAD returns correct bytes in rx buffer 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=641a2b86c449_80a2420866@john.notmuch \
--to=john.fastabend@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cong.wang@bytedance.com \
--cc=daniel@iogearbox.net \
--cc=edumazet@google.com \
--cc=jakub@cloudflare.com \
--cc=lmb@isovalent.com \
--cc=netdev@vger.kernel.org \
--cc=will@isovalent.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;
as well as URLs for NNTP newsgroup(s).