aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
diff options
context:
space:
mode:
authorSong Liu <[email protected]>2023-09-19 06:02:58 +0000
committerAlexei Starovoitov <[email protected]>2023-09-19 09:59:28 +0000
commit48f5e7d3f7300ff679dc50bfb7a7451de6f29e4c (patch)
treecc9c6941fc983916828daec9468a9a3a691d73d8 /tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
parents390/bpf: Let arch_prepare_bpf_trampoline return program size (diff)
downloadkernel-48f5e7d3f7300ff679dc50bfb7a7451de6f29e4c.tar.gz
kernel-48f5e7d3f7300ff679dc50bfb7a7451de6f29e4c.zip
selftests/bpf: Check bpf_cubic_acked() is called via struct_ops
Test bpf_tcp_ca (in test_progs) checks multiple tcp_congestion_ops. However, there isn't a test that verifies functions in the tcp_congestion_ops is actually called. Add a check to verify that bpf_cubic_acked is actually called during the test. Suggested-by: Martin KaFai Lau <[email protected]> Signed-off-by: Song Liu <[email protected]> Acked-by: Ilya Leoshkevich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
index a53c254c6058..4aabeaa525d4 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
@@ -185,6 +185,8 @@ static void test_cubic(void)
do_test("bpf_cubic", NULL);
+ ASSERT_EQ(cubic_skel->bss->bpf_cubic_acked_called, 1, "pkts_acked called");
+
bpf_link__destroy(link);
bpf_cubic__destroy(cubic_skel);
}