diff options
author | Song Liu <song@kernel.org> | 2023-09-18 23:02:58 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-09-19 02:59:28 -0700 |
commit | 48f5e7d3f7300ff679dc50bfb7a7451de6f29e4c (patch) | |
tree | cc9c6941fc983916828daec9468a9a3a691d73d8 /tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c | |
parent | cf094baa3e0f19f1f80ceaf205c80402b024386c (diff) | |
download | lwn-48f5e7d3f7300ff679dc50bfb7a7451de6f29e4c.tar.gz lwn-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 <martin.lau@kernel.org>
Signed-off-by: Song Liu <song@kernel.org>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230919060258.3237176-3-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
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.c | 2 |
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); } |