Skip to contentSkip to conversation

selftests/bpf: fix selftests build with old system-wide headers

PATCH Applied Andrii Nakryiko 3 participants 3 messages Jun 17, 2021

Subsystems (5)
lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

PATCH 1/1 selftests/bpf: fix selftests build with old system-wide headers

migrate_reuseport.c selftest relies on having TCP_FASTOPEN_CONNECT defined in system-wide netinet/tcp.h. Selftests can use up-to-date uapi/linux/tcp.h, but that one doesn't have SOL_TCP. So instead of switching everything to uapi header, add #define for TCP_FASTOPEN_CONNECT to fix the build.

Cc Kuniyuki Iwashima <[email protected]>
Fixes c9d0bdef89a6 ("bpf: Test BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.")
---
 tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c +4 -0
index 0fa3f750567d..59adb4715394 100644
@@ -30,6 +30,10 @@
 #include "test_migrate_reuseport.skel.h"
 #include "network_helpers.h"
 
+#ifndef TCP_FASTOPEN_CONNECT
+#define TCP_FASTOPEN_CONNECT 30
+#endif
+
 #define IFINDEX_LO 1
 
 #define NR_SERVERS 5
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
From:   Andrii Nakryiko <[email protected]>
Date:   Wed, 16 Jun 2021 21:14:46 -0700
Quoted 4 lines

migrate_reuseport.c selftest relies on having TCP_FASTOPEN_CONNECT defined in system-wide netinet/tcp.h. Selftests can use up-to-date uapi/linux/tcp.h, but that one doesn't have SOL_TCP. So instead of switching everything to uapi header, add #define for TCP_FASTOPEN_CONNECT to fix the build.

Thank you!

#2 lore raw
In reply to Andrii Nakryiko
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 10 lines · On Wed, 16 Jun 2021 21:14:46 -0700 you wrote:

migrate_reuseport.c selftest relies on having TCP_FASTOPEN_CONNECT defined in system-wide netinet/tcp.h. Selftests can use up-to-date uapi/linux/tcp.h, but that one doesn't have SOL_TCP. So instead of switching everything to uapi header, add #define for TCP_FASTOPEN_CONNECT to fix the build.

Cc Kuniyuki Iwashima <[email protected]>
Fixes c9d0bdef89a6 ("bpf: Test BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.")

[...]

Here is the summary with links:
- [bpf-next] selftests/bpf: fix selftests build with old system-wide headers

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

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