MPTCP Linux Development
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v14 3/3] selftests/bpf: add bpf_rr test
Date: Thu, 12 May 2022 18:08:57 -0700 (PDT)	[thread overview]
Message-ID: <344bad28-8918-29c7-387c-a41c356c447b@linux.intel.com> (raw)
In-Reply-To: <e3d31fc19246a91423fca7c497bdd0f661470e36.1652270663.git.geliang.tang@suse.com>

On Wed, 11 May 2022, Geliang Tang wrote:

> This patch adds the round-robin BPF MPTCP scheduler test. Use sysctl to
> set net.mptcp.scheduler to use this sched. Add a veth net device to
> simulate the multiple addresses case. Use 'ip mptcp endpoint' command to
> add this new endpoint to PM netlink.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> .../testing/selftests/bpf/prog_tests/mptcp.c  | 38 +++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> index 93a5739712ce..6303eba67fab 100644
> --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> @@ -6,6 +6,7 @@
> #include "cgroup_helpers.h"
> #include "network_helpers.h"
> #include "mptcp_bpf_first.skel.h"
> +#include "mptcp_bpf_rr.skel.h"
>
> #ifndef TCP_CA_NAME_MAX
> #define TCP_CA_NAME_MAX	16
> @@ -369,10 +370,47 @@ static void test_first(void)
> 	mptcp_bpf_first__destroy(first_skel);
> }
>
> +static void test_rr(void)
> +{
> +	struct mptcp_bpf_rr *rr_skel;
> +	int server_fd, client_fd;
> +	struct bpf_link *link;
> +
> +	rr_skel = mptcp_bpf_rr__open_and_load();
> +	if (!ASSERT_OK_PTR(rr_skel, "bpf_rr__open_and_load"))
> +		return;
> +
> +	link = bpf_map__attach_struct_ops(rr_skel->maps.rr);
> +	if (!ASSERT_OK_PTR(link, "bpf_map__attach_struct_ops")) {
> +		mptcp_bpf_rr__destroy(rr_skel);
> +		return;
> +	}
> +
> +	system("ip link add veth1 type veth");
> +	system("ip addr add 10.0.1.1/24 dev veth1");
> +	system("ip link set veth1 up");
> +	system("ip mptcp endpoint add 10.0.1.1 subflow");
> +	system("sysctl -qw net.mptcp.scheduler=bpf_rr");
> +	server_fd = start_mptcp_server(AF_INET, NULL, 0, 0);
> +	client_fd = connect_to_mptcp_fd(server_fd, 0);
> +
> +	send_data(server_fd, client_fd);
> +

Is there a way to verify data was sent on both subflows? Maybe look at 
bytes_sent or segs_out in 'ss' output?

> +	close(client_fd);
> +	close(server_fd);
> +	system("sysctl -qw net.mptcp.scheduler=default");
> +	system("ip mptcp endpoint flush");
> +	system("ip link del veth1");
> +	bpf_link__destroy(link);
> +	mptcp_bpf_rr__destroy(rr_skel);
> +}
> +
> void test_mptcp(void)
> {
> 	if (test__start_subtest("base"))
> 		test_base();
> 	if (test__start_subtest("first"))
> 		test_first();
> +	if (test__start_subtest("rr"))
> +		test_rr();
> }
> -- 
> 2.34.1
>
>
>

--
Mat Martineau
Intel

      reply	other threads:[~2022-05-13  1:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 12:09 [PATCH mptcp-next v14 0/3] BPF round-robin scheduler Geliang Tang
2022-05-11 12:09 ` [PATCH mptcp-next v14 1/3] mptcp: add subflows array in sched data Geliang Tang
2022-05-11 12:09 ` [PATCH mptcp-next v14 2/3] selftests/bpf: add bpf_rr scheduler Geliang Tang
2022-05-11 12:09 ` [PATCH mptcp-next v14 3/3] selftests/bpf: add bpf_rr test Geliang Tang
2022-05-13  1:08   ` Mat Martineau [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=344bad28-8918-29c7-387c-a41c356c447b@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=geliang.tang@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox