diff mbox series

[mptcp-next,v4,4/4] Squash to "selftests/bpf: Add bpf_first scheduler & test"

Message ID 3155c5faa74d04130eb8d257f11de50603b1f5ac.1730260715.git.tanggeliang@kylinos.cn (mailing list archive)
State Accepted, archived
Commit 8c6acd6502aff8d7d4bd61810fbe9cab2235a0f6
Delegated to: Matthieu Baerts
Headers show
Series add netns helpers | expand

Checks

Context Check Description
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug success Success! ✅
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ success Success! ✅
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ success Success! ✅
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 25 lines checked
matttbe/shellcheck success MPTCP selftests files have not been modified
matttbe/build success Build and static analysis OK

Commit Message

Geliang Tang Oct. 30, 2024, 4:03 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

Use new netns helpers.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
index 8db1def2e219..1d68bbda3370 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -651,7 +651,7 @@  static void test_bpf_sched(struct bpf_object *obj, char *sched,
 			   bool addr1, bool addr2)
 {
 	char bpf_sched[MPTCP_SCHED_NAME_MAX] = "bpf_";
-	struct nstoken *nstoken;
+	struct netns_obj *netns;
 	struct bpf_link *link;
 	struct bpf_map *map;
 
@@ -664,14 +664,14 @@  static void test_bpf_sched(struct bpf_object *obj, char *sched,
 	if (CHECK(!link, sched, "attach_struct_ops: %d\n", errno))
 		return;
 
-	nstoken = sched_init("subflow", strcat(bpf_sched, sched));
-	if (!nstoken)
+	netns = sched_init("subflow", strcat(bpf_sched, sched));
+	if (!netns)
 		goto fail;
 
 	send_data_and_verify(sched, addr1, addr2);
 
 fail:
-	cleanup_netns(nstoken);
+	netns_free(netns);
 	bpf_link__destroy(link);
 }