All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliang.tang@suse.com>
To: Matthieu Baerts <matthieu.baerts@tessares.net>
Cc: mptcp@lists.linux.dev
Subject: Re: [RFC bpf-next v2 8/8] selftests/bpf: Add mptcpify selftest
Date: Thu, 6 Jul 2023 16:42:52 +0800	[thread overview]
Message-ID: <20230706084252.GA15169@bogon> (raw)
In-Reply-To: <194f9db2-c5dc-d7b7-a237-5c458a028764@tessares.net>

On Thu, Jul 06, 2023 at 10:21:47AM +0200, Matthieu Baerts wrote:
> Hi Geliang,
> 
> (without BPF ML not to disturb them for this detail)
> 
> On 06/07/2023 09:47, Geliang Tang wrote:
> > This patch extends the MPTCP test base, add a selftest test_mptcpify()
> > for the mptcpify case.
> > 
> > Open and load the mptcpify test prog to mptcpify the TCP sockets
> > dynamically, then use start_server() and connect_to_fd() to create a
> > TCP socket, but actually what's created is an MPTCP socket, which can
> > be verified through the output of 'ss' command.
> > 
> > Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> > ---
> >  .../testing/selftests/bpf/prog_tests/mptcp.c  | 91 +++++++++++++++++++
> >  1 file changed, 91 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> > index b2a833a900c2..de05140fe638 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> 
> (...)
> 
> > +static int verify_mptcpify(void)
> > +{
> > +	char cmd[128];
> > +	int err = 0;
> > +
> > +	snprintf(cmd, sizeof(cmd),
> > +		 "ip netns exec %s ss -tOni | grep -q '%s'",
> > +		 NS_TEST, "tcp-ulp-mptcp");
> > +	if (!ASSERT_OK(system(cmd), "No tcp-ulp-mptcp found!"))
> > +		err++;
> > +
> > +	snprintf(cmd, sizeof(cmd),
> > +		 "ip netns exec %s nstat -asz %s | awk '%s' | grep -q '%s'",
> > +		 NS_TEST, "MPTcpExtMPCapableSYNACKRX",
> > +		 "NR==1 {next} {print $2}", "1");
> 
> It might be safer to increase cmd size to 256 (or even 1024) because if
> I'm not mistaken, you might need here 129 chars if NS_TEST can go up to
> 31 chars:
> 
> > ip netns exec 1234567890123456789012345678901 nstat -asz MPTcpExtMPCapableSYNACKRX | awk 'NR==1 {next} {print $2}' | grep -q '1'
> 
> That's 128 chars but without '\0'.

Yes, I had changed this size to 256 and sent out the v3 before reading
your letter :)

Now the tests for v3 all passed. Let's wait for the reply.

Thanks,
-Geliang

> 
> But I don't think you need a v3 now: it is an issue just with the tests
> and also because I know most subsystems ask not to send more than one
> version per 24h ;)
> 
> BTW, excellent cover-letter, thanks for that!
> 
> > +	if (!ASSERT_OK(system(cmd), "No MPTcpExtMPCapableSYNACKRX found!"))
> > +		err++;
> > +
> > +	return err;
> > +}
> 
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net

      reply	other threads:[~2023-07-06  8:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06  7:47 [RFC bpf-next v2 0/8] BPF 'force to MPTCP' Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 1/8] bpf: Add new prog type sockinit Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 2/8] bpf: Run a sockinit program Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 3/8] net: socket: run sockinit hooks Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 4/8] libbpf: Support sockinit hook Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 5/8] selftests/bpf: Add mptcpify program Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 6/8] selftests/bpf: use random netns name for mptcp Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 7/8] selftests/bpf: add two mptcp netns helpers Geliang Tang
2023-07-06  7:47 ` [RFC bpf-next v2 8/8] selftests/bpf: Add mptcpify selftest Geliang Tang
2023-07-06  8:21   ` Matthieu Baerts
2023-07-06  8:42     ` Geliang Tang [this message]

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=20230706084252.GA15169@bogon \
    --to=geliang.tang@suse.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.