bpf, sockmap: Test shutdown() correctly exits epoll and recv()=0
authorJohn Fastabend <john.fastabend@gmail.com>
Tue, 23 May 2023 02:56:15 +0000 (19:56 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 23 May 2023 14:11:05 +0000 (16:11 +0200)
commit1fa1fe8ff161cc34620e31295235dc1e6d0dce77
treed5699efef9beedd2746270d543da7c3a5e70fb3f
parent298970c8af9d73a9f3df4ac871a4456f87fd4cab
bpf, sockmap: Test shutdown() correctly exits epoll and recv()=0

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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20230523025618.113937-12-john.fastabend@gmail.com
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
tools/testing/selftests/bpf/progs/test_sockmap_pass_prog.c [new file with mode: 0644]