Skip to contentSkip to conversation

bpf, selftests: fix test_maps now that sockmap supports UDP

PATCH Applied John Fastabend 2 participants 2 messages Jul 20, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf, selftests: fix test_maps now that sockmap supports UDP

UDP socket support was added recently so testing UDP insert failure is no longer correct and causes test_maps failure. The fix is easy though, we simply need to test that UDP is correctly added instead of blocked.

Fixes 122e6c79efe1c ("sock_map: Update sock type checks for UDP")
---
 tools/testing/selftests/bpf/test_maps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/test_maps.c +2 -2
index d832d135211c..5a8e069e64fa 100644
@@ -764,8 +764,8 @@ static void test_sockmap(unsigned int tasks, void *data)
 	udp = socket(AF_INET, SOCK_DGRAM, 0);
 	i = 0;
 	err = bpf_map_update_elem(fd, &i, &udp, BPF_ANY);
-	if (!err) {
-		printf("Failed socket SOCK_DGRAM allowed '%i:%i'\n",
+	if (err) {
+		printf("Failed socket update SOCK_DGRAM '%i:%i'\n",
 		       i, udp);
 		goto out_sockmap;
 	}
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to bpf/bpf-next.git (refs/heads/master):

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

Quoted 9 lines · On Tue, 20 Jul 2021 11:48:32 -0700 you wrote:

UDP socket support was added recently so testing UDP insert failure is no longer correct and causes test_maps failure. The fix is easy though, we simply need to test that UDP is correctly added instead of blocked.

Fixes 122e6c79efe1c ("sock_map: Update sock type checks for UDP")

[...]

Here is the summary with links:
- [bpf-next] bpf, selftests: fix test_maps now that sockmap supports UDP

    https://git.kernel.org/bpf/bpf-next/c/c39aa2159974

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html