[PATCH bpf-next] selftests/bpf: fix selftests build with old system-wide headers

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [selftests] (test runners & infrastructure), kernel selftest framework, the rest

STALE1878d LANDED

Landed in mainline as f20792d425d2 on 2021-06-17.

3 messages, 3 authors, 2021-06-17 · open the first message on its own page

[PATCH bpf-next] selftests/bpf: fix selftests build with old system-wide headers

From: Andrii Nakryiko <andrii@kernel.org>
Date: 2021-06-17 04:15:10

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 <redacted>
Fixes: c9d0bdef89a6 ("bpf: Test BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c b/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c
index 0fa3f750567d..59adb4715394 100644
--- a/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c
+++ b/tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c
@@ -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
-- 
2.30.2

Re: [PATCH bpf-next] selftests/bpf: fix selftests build with old system-wide headers

From: Kuniyuki Iwashima <hidden>
Date: 2021-06-17 04:38:51

From:   Andrii Nakryiko <andrii@kernel.org>
Date:   Wed, 16 Jun 2021 21:14:46 -0700
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.
Acked-by: Kuniyuki Iwashima <redacted>

Thank you!

Re: [PATCH bpf-next] selftests/bpf: fix selftests build with old system-wide headers

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-17 11:10:04

Hello:

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

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 <redacted>
Fixes: c9d0bdef89a6 ("bpf: Test BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

[...]
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help