From d4987cd760229723fe121484b07e701c17a95933 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Thu, 5 Sep 2024 10:26:59 +0800 Subject: [PATCH] Squash to "selftests/bpf: Add bpf scheduler test" Now ss_search() are only used by bpf_sched tests. It will be dropped in next step. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 29d3d6abc6c982..93869c873cada2 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -368,12 +368,6 @@ static int endpoint_init(char *flags) return -1; } -static int _ss_search(char *src, char *dst, char *port, char *keyword) -{ - return SYS_NOFAIL("ip netns exec %s ss -enita src %s dst %s %s %d | grep -q '%s'", - NS_TEST, src, dst, port, PORT_1, keyword); -} - static void wait_for_new_subflows(int fd) { socklen_t len; @@ -495,9 +489,15 @@ static struct nstoken *sched_init(char *flags, char *sched) return NULL; } +static int ss_search(char *src, char *dst, char *port, char *keyword) +{ + return SYS_NOFAIL("ip netns exec %s ss -enita src %s dst %s %s %d | grep -q '%s'", + NS_TEST, src, dst, port, PORT_1, keyword); +} + static int has_bytes_sent(char *dst) { - return _ss_search(ADDR_1, dst, "sport", "bytes_sent:"); + return ss_search(ADDR_1, dst, "sport", "bytes_sent:"); } static void send_data_and_verify(char *sched, bool addr1, bool addr2)