summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGeliang Tang <tanggeliang@kylinos.cn>2024-05-30 15:41:12 +0800
committerDaniel Borkmann <daniel@iogearbox.net>2024-06-06 23:04:06 +0200
commitf85af9d955ac9601174e1c64f4b3308c1cae4a7e (patch)
treefbd6222b981d77cca537fcc3447165c2cf68ae19 /tools
parentcd984b2ed62423eb3daceacb21d651115a612af6 (diff)
selftests/bpf: Drop useless arguments of do_test in bpf_tcp_ca
bpf_map_lookup_elem() has been removed from do_test(), it makes the sk_stg_map argument of do_test() useless. In addition, two exactly the same opts are passed in all the places where do_test() is invoked, so cli_opts argument can be dropped too. This patch drops these two useless arguments of do_test() in bpf_tcp_ca.c. Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/7056eab111d78a05bce29d2821228dc93f240de4.1717054461.git.tanggeliang@kylinos.cn
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c20
1 files changed, 9 insertions, 11 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 1b27d0232cbd..67358adf5db3 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
@@ -67,13 +67,11 @@ err:
return false;
}
-static void do_test(const struct network_helper_opts *opts,
- const struct network_helper_opts *cli_opts,
- const struct bpf_map *sk_stg_map)
+static void do_test(const struct network_helper_opts *opts)
{
int lfd = -1, fd = -1;
- if (!start_test(NULL, opts, cli_opts, &lfd, &fd))
+ if (!start_test(NULL, opts, opts, &lfd, &fd))
goto done;
ASSERT_OK(send_recv_data(lfd, fd, total_bytes), "send_recv_data");
@@ -114,7 +112,7 @@ static void test_cubic(void)
return;
}
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
ASSERT_EQ(cubic_skel->bss->bpf_cubic_acked_called, 1, "pkts_acked called");
@@ -382,14 +380,14 @@ static void test_update_ca(void)
link = bpf_map__attach_struct_ops(skel->maps.ca_update_1);
ASSERT_OK_PTR(link, "attach_struct_ops");
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
saved_ca1_cnt = skel->bss->ca1_cnt;
ASSERT_GT(saved_ca1_cnt, 0, "ca1_ca1_cnt");
err = bpf_link__update_map(link, skel->maps.ca_update_2);
ASSERT_OK(err, "update_map");
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
ASSERT_EQ(skel->bss->ca1_cnt, saved_ca1_cnt, "ca2_ca1_cnt");
ASSERT_GT(skel->bss->ca2_cnt, 0, "ca2_ca2_cnt");
@@ -418,14 +416,14 @@ static void test_update_wrong(void)
link = bpf_map__attach_struct_ops(skel->maps.ca_update_1);
ASSERT_OK_PTR(link, "attach_struct_ops");
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
saved_ca1_cnt = skel->bss->ca1_cnt;
ASSERT_GT(saved_ca1_cnt, 0, "ca1_ca1_cnt");
err = bpf_link__update_map(link, skel->maps.ca_wrong);
ASSERT_ERR(err, "update_map");
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
ASSERT_GT(skel->bss->ca1_cnt, saved_ca1_cnt, "ca2_ca1_cnt");
bpf_link__destroy(link);
@@ -455,7 +453,7 @@ static void test_mixed_links(void)
link = bpf_map__attach_struct_ops(skel->maps.ca_update_1);
ASSERT_OK_PTR(link, "attach_struct_ops");
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
ASSERT_GT(skel->bss->ca1_cnt, 0, "ca1_ca1_cnt");
err = bpf_link__update_map(link, skel->maps.ca_no_link);
@@ -562,7 +560,7 @@ static void test_cc_cubic(void)
return;
}
- do_test(&opts, &opts, NULL);
+ do_test(&opts);
bpf_link__destroy(link);
bpf_cc_cubic__destroy(cc_cubic_skel);