BPF List
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: Kui-Feng Lee <thinker.li@gmail.com>,
	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
Subject: Re: [PATCH bpf-next v2 3/4] selftests/bpf: Monitor traffic for sockmap_listen.
Date: Wed, 24 Jul 2024 17:32:18 +0800	[thread overview]
Message-ID: <14043bdeb2621f6f283fbe59eff0084bbf8179fa.camel@kernel.org> (raw)
In-Reply-To: <20240723182439.1434795-4-thinker.li@gmail.com>

On Tue, 2024-07-23 at 11:24 -0700, Kui-Feng Lee wrote:
> Enable traffic monitor for each subtest of sockmap_listen.
> 
> Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
> ---
>  tools/testing/selftests/bpf/prog_tests/sockmap_listen.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> index e91b59366030..62683ccb6d56 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> @@ -28,6 +28,7 @@
>  #include "test_sockmap_listen.skel.h"
>  
>  #include "sockmap_helpers.h"
> +#include "network_helpers.h"
>  
>  static void test_insert_invalid(struct test_sockmap_listen *skel
> __always_unused,
>  				int family, int sotype, int mapfd)
> @@ -1893,14 +1894,21 @@ static void test_udp_unix_redir(struct
> test_sockmap_listen *skel, struct bpf_map
>  {
>  	const char *family_name, *map_name;
>  	char s[MAX_TEST_NAME];
> +	struct tmonitor_ctx *tmon;
>  
>  	family_name = family_str(family);
>  	map_name = map_type_str(map);
>  	snprintf(s, sizeof(s), "%s %s %s", map_name, family_name,
> __func__);
>  	if (!test__start_subtest(s))
>  		return;
> +
> +	tmon = traffic_monitor_start(NULL);
> +	ASSERT_TRUE(tmon, "traffic_monitor_start");

Using ASSERT_TRUE() on a pointer is a bit strange, it's better to use
ASSERT_NEQ(NULL) like patch 2.

> +
>  	inet_unix_skb_redir_to_connected(skel, map, family);
>  	unix_inet_skb_redir_to_connected(skel, map, family);
> +
> +	traffic_monitor_stop(tmon);
>  }
>  
>  static void run_tests(struct test_sockmap_listen *skel, struct
> bpf_map *map,


  reply	other threads:[~2024-07-24  9:32 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 [this message]
2024-07-24 16:24     ` Kui-Feng Lee
2024-07-24 18:11       ` Andrii Nakryiko
2024-07-23 18:24 ` [PATCH bpf-next v2 4/4] selftests/bpf: Monitor traffic for select_reuseport Kui-Feng Lee
2024-07-24  9:33   ` 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=14043bdeb2621f6f283fbe59eff0084bbf8179fa.camel@kernel.org \
    --to=geliang@kernel.org \
    --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 \
    --cc=thinker.li@gmail.com \
    /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