MPTCP Linux Development
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v4 2/3] Squash to "selftests/bpf: Add mptcp subflow subtest"
Date: Mon, 13 May 2024 12:38:51 +0200	[thread overview]
Message-ID: <8c5f3bbf-16a9-4588-b2d3-bd9e31c4cd1e@kernel.org> (raw)
In-Reply-To: <77d5112c49fac9e8f77c09c7c1c057b8ea25a60f.1715503185.git.tanggeliang@kylinos.cn>

Hi Geliang,

On 12/05/2024 10:41, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> Use pm_nl_ctl when 'ip mptcp' fails.
> Use SYS_NOFAIL in _ss_search() and drop 'ss -M'.
> 
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  tools/testing/selftests/bpf/prog_tests/mptcp.c | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> index 793b4b9c2bd2..2459c0e2a794 100644
> --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> @@ -362,7 +362,10 @@ static int endpoint_init(char *flags)
>  	SYS(fail, "ip -net %s link set dev veth1 up", NS_TEST);
>  	SYS(fail, "ip -net %s addr add %s/24 dev veth2", NS_TEST, ADDR_2);
>  	SYS(fail, "ip -net %s link set dev veth2 up", NS_TEST);
> -	SYS(fail, "ip -net %s mptcp endpoint add %s %s", NS_TEST, ADDR_2, flags);
> +	if (SYS_NOFAIL("ip -net %s mptcp endpoint add %s %s", NS_TEST, ADDR_2, flags)) {
> +		SYS(fail, "ip netns exec %s ./mptcp_pm_nl_ctl add %s flags %s",
> +		    NS_TEST, ADDR_2, flags);

As I mentioned in the v1, I would prefer only using 'ip mptcp', and I
find it strange to have a CI validating networking feature using an old
version of IPRoute2. But if we need an alternative method for the BPF
CI, I would prefer also having our CI using this method, to prevent any
issue with this method, and only realising that when upstreaming
patches, delaying them and causing confusions.

But feel free to add a command:

  /* It would be better to use  "ip -net %s mptcp endpoint add %s %s",
   * but the BPF CI is using an old version of IPRoute (5.5.0).
   */


> +	}
>  
>  	return 0;
>  fail:
> @@ -371,16 +374,8 @@ static int endpoint_init(char *flags)
>  
>  static int _ss_search(char *src, char *dst, char *port, char *keyword)
>  {
> -	char cmd[128];
> -	int n;
> -
> -	n = snprintf(cmd, sizeof(cmd),
> -		     "ip netns exec %s ss -Menita src %s dst %s %s %d | grep -q '%s'",
> -		     NS_TEST, src, dst, port, PORT_1, keyword);
> -	if (n < 0 || n >= sizeof(cmd))
> -		return -1;
> -
> -	return system(cmd);
> +	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 ss_search(char *src, char *keyword)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2024-05-13 10:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12  8:41 [PATCH mptcp-next v4 0/3] patches for new MPTCP subflow subtest Geliang Tang
2024-05-12  8:41 ` [PATCH mptcp-next v4 1/3] selftests/bpf: Add mptcp pm_nl_ctl link Geliang Tang
2024-05-12  8:41 ` [PATCH mptcp-next v4 2/3] Squash to "selftests/bpf: Add mptcp subflow subtest" Geliang Tang
2024-05-13 10:38   ` Matthieu Baerts [this message]
2024-05-12  8:41 ` [PATCH mptcp-next v4 3/3] checkpatch: skip warnings for symbol links Geliang Tang
2024-05-13 10:44   ` Matthieu Baerts
2024-05-15 16:43   ` Matthieu Baerts
2024-05-12  9:34 ` [PATCH mptcp-next v4 0/3] patches for new MPTCP subflow subtest MPTCP CI

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=8c5f3bbf-16a9-4588-b2d3-bd9e31c4cd1e@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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