diff mbox series

[mptcp-next,8/8] Squash to "selftests/bpf: Add bpf_burst scheduler & test"

Message ID 3cfad7412c5d2fc439614357519855887a638ec6.1732153672.git.tanggeliang@kylinos.cn (mailing list archive)
State New
Headers show
Series split get_subflow interface into two | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
matttbe/build success Build and static analysis OK
matttbe/shellcheck success MPTCP selftests files have not been modified
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! ✅

Commit Message

Geliang Tang Nov. 21, 2024, 2:45 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

Set BPF_F_SLEEPABLE flags for bpf_burst_get_retrans.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 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 1d68bbda3370..d7a640dce7da 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -726,12 +726,22 @@  static void test_red(void)
 static void test_burst(void)
 {
 	struct mptcp_bpf_burst *skel;
+	int err;
 
-	skel = mptcp_bpf_burst__open_and_load();
-	if (!ASSERT_OK_PTR(skel, "open_and_load: burst"))
+	skel = mptcp_bpf_burst__open();
+	if (!ASSERT_OK_PTR(skel, "open: burst"))
 		return;
 
+	err = bpf_program__set_flags(skel->progs.bpf_burst_get_retrans,
+				     BPF_F_SLEEPABLE);
+	if (!ASSERT_OK(err, "set sleepable flags"))
+		goto skel_destroy;
+
+	if (!ASSERT_OK(mptcp_bpf_burst__load(skel), "load: burst"))
+		goto skel_destroy;
+
 	test_bpf_sched(skel->obj, "burst", WITH_DATA, WITH_DATA);
+skel_destroy:
 	mptcp_bpf_burst__destroy(skel);
 }