BPF List
 help / color / mirror / Atom feed
From: Kui-Feng Lee <thinker.li@gmail.com>
To: bpf@vger.kernel.org, ast@kernel.org, martin.lau@linux.dev,
	song@kernel.org, kernel-team@meta.com, andrii@kernel.org,
	sdf@fomichev.me
Cc: sinquersw@gmail.com, kuifeng@meta.com,
	Kui-Feng Lee <thinker.li@gmail.com>
Subject: [PATCH bpf-next v2 4/4] selftests/bpf: Monitor traffic for select_reuseport.
Date: Tue, 23 Jul 2024 11:24:39 -0700	[thread overview]
Message-ID: <20240723182439.1434795-5-thinker.li@gmail.com> (raw)
In-Reply-To: <20240723182439.1434795-1-thinker.li@gmail.com>

Enable traffic monitoring for the subtests of select_reuseport.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
---
 tools/testing/selftests/bpf/prog_tests/select_reuseport.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/bpf/prog_tests/select_reuseport.c b/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
index 64c5f5eb2994..d3039957ee94 100644
--- a/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
+++ b/tools/testing/selftests/bpf/prog_tests/select_reuseport.c
@@ -22,6 +22,7 @@
 
 #include "test_progs.h"
 #include "test_select_reuseport_common.h"
+#include "network_helpers.h"
 
 #define MAX_TEST_NAME 80
 #define MIN_TCPHDR_LEN 20
@@ -795,6 +796,7 @@ static void test_config(int sotype, sa_family_t family, bool inany)
 	};
 	char s[MAX_TEST_NAME];
 	const struct test *t;
+	struct tmonitor_ctx *tmon;
 
 	for (t = tests; t < tests + ARRAY_SIZE(tests); t++) {
 		if (t->need_sotype && t->need_sotype != sotype)
@@ -808,9 +810,14 @@ static void test_config(int sotype, sa_family_t family, bool inany)
 		if (!test__start_subtest(s))
 			continue;
 
+		tmon = traffic_monitor_start(NULL);
+		ASSERT_TRUE(tmon, "traffic_monitor_start");
+
 		setup_per_test(sotype, family, inany, t->no_inner_map);
 		t->fn(sotype, family);
 		cleanup_per_test(t->no_inner_map);
+
+		traffic_monitor_stop(tmon);
 	}
 }
 
-- 
2.34.1


  parent reply	other threads:[~2024-07-23 18:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 18:24 [PATCH bpf-next v2 0/4] monitor network traffic for flaky test cases Kui-Feng Lee
2024-07-23 18:24 ` [PATCH bpf-next v2 1/4] selftests/bpf: Add traffic monitor functions Kui-Feng Lee
2024-07-23 22:03   ` Kui-Feng Lee
2024-07-24 15:22   ` Stanislav Fomichev
2024-07-24 15:46     ` Kui-Feng Lee
2024-07-24 19:08   ` Martin KaFai Lau
2024-07-25  1:44     ` Martin KaFai Lau
2024-07-25 22:47     ` Kui-Feng Lee
2024-07-26  0:23       ` Martin KaFai Lau
2024-07-23 18:24 ` [PATCH bpf-next v2 2/4] selftests/bpf: Monitor traffic for tc_redirect/tc_redirect_dtime Kui-Feng Lee
2024-07-24  8:36   ` Geliang Tang
2024-07-24 16:24     ` Kui-Feng Lee
2024-07-24 15:26   ` Stanislav Fomichev
2024-07-24 18:04     ` Kui-Feng Lee
2024-07-24 22:13       ` Stanislav Fomichev
2024-07-23 18:24 ` [PATCH bpf-next v2 3/4] selftests/bpf: Monitor traffic for sockmap_listen Kui-Feng Lee
2024-07-24  9:32   ` Geliang Tang
2024-07-24 16:24     ` Kui-Feng Lee
2024-07-24 18:11       ` Andrii Nakryiko
2024-07-23 18:24 ` Kui-Feng Lee [this message]
2024-07-24  9:33   ` [PATCH bpf-next v2 4/4] selftests/bpf: Monitor traffic for select_reuseport Geliang Tang
2024-07-23 22:01 ` [PATCH bpf-next v2 0/4] monitor network traffic for flaky test cases Kui-Feng Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240723182439.1434795-5-thinker.li@gmail.com \
    --to=thinker.li@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kuifeng@meta.com \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=sinquersw@gmail.com \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox