From: Geliang Tang <geliang.tang@suse.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v7 16/19] selftests/bpf: Add bpf_burst test
Date: Wed, 14 Jun 2023 15:38:36 +0800 [thread overview]
Message-ID: <20230614073836.GA9545@bogon> (raw)
In-Reply-To: <f18a8bad95754fae7a9c0cae48583279c62b78b3.camel@redhat.com>
Hi Paolo,
On Wed, Jun 07, 2023 at 07:08:59PM +0200, Paolo Abeni wrote:
> On Wed, 2023-06-07 at 16:38 +0800, Geliang Tang wrote:
> > This patch adds the burst BPF MPTCP scheduler test: test_burst(). Use
> > sysctl to set net.mptcp.scheduler to use this sched. Add two veth net
> > devices to simulate the multiple addresses case. Use 'ip mptcp endpoint'
> > command to add the new endpoint ADDR_2 to PM netlink. Send data and check
> > bytes_sent of 'ss' output after it to make sure the data has been sent
> > on both net devices.
> >
> > 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 a968641cc94a..b9f6dcf995fd 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
> > @@ -10,6 +10,7 @@
> > #include "mptcp_bpf_bkup.skel.h"
> > #include "mptcp_bpf_rr.skel.h"
> > #include "mptcp_bpf_red.skel.h"
> > +#include "mptcp_bpf_burst.skel.h"
> >
> > char NS_TEST[32];
> >
> > @@ -455,6 +456,41 @@ static void test_red(void)
> > mptcp_bpf_red__destroy(red_skel);
> > }
> >
> > +static void test_burst(void)
> > +{
> > + struct mptcp_bpf_burst *burst_skel;
> > + int server_fd, client_fd;
> > + struct nstoken *nstoken;
> > + struct bpf_link *link;
> > +
> > + burst_skel = mptcp_bpf_burst__open_and_load();
> > + if (!ASSERT_OK_PTR(burst_skel, "bpf_burst__open_and_load"))
> > + return;
> > +
> > + link = bpf_map__attach_struct_ops(burst_skel->maps.burst);
> > + if (!ASSERT_OK_PTR(link, "bpf_map__attach_struct_ops")) {
> > + mptcp_bpf_burst__destroy(burst_skel);
> > + return;
> > + }
> > +
> > + nstoken = sched_init("subflow", "bpf_burst");
> > + if (!ASSERT_OK_PTR(nstoken, "sched_init:bpf_burst"))
> > + goto fail;
> > + server_fd = start_mptcp_server(AF_INET, ADDR_1, 0, 0);
> > + client_fd = connect_to_fd(server_fd, 0);
> > +
> > + send_data(server_fd, client_fd);
> > + ASSERT_OK(has_bytes_sent(ADDR_1), "has_bytes_sent addr 1");
> > + ASSERT_OK(has_bytes_sent(ADDR_2), "has_bytes_sent addr 2");
> > +
> > + close(client_fd);
> > + close(server_fd);
> > +fail:
> > + cleanup_netns(nstoken);
> > + bpf_link__destroy(link);
> > + mptcp_bpf_burst__destroy(burst_skel);
> > +}
> > +
> > void test_mptcp(void)
> > {
> > if (test__start_subtest("base"))
> > @@ -467,4 +503,6 @@ void test_mptcp(void)
> > test_rr();
> > if (test__start_subtest("red"))
> > test_red();
> > + if (test__start_subtest("burst"))
> > + test_burst();
> > }
>
> I would be curious to see how the ebpf scheduler compare with the
> build-in one performance wise (max tput on 2 fast links with a subflow
> on each of them). The link should be fast enough so that the tput will
> be CPU bound.
I just sent a patch in ML to add time metrics for BPF tests to compare
the performance of each schedulers, named "selftests: bpf: Add time
metrics for sched tests".
> sudo ./test_progs -t mptcp -v | grep " ms"
default: 178 ms
bpf_first: 6 ms
bpf_bkup: 6 ms
bpf_rr: 24 ms
bpf_red: 9 ms
bpf_burst: 179 ms
bpf_stale: 8 ms
From this result, it can be seen that bpf_burst and default in-kernel
scheduler performance are basically the same.
Thanks,
-Geliang
>
> /P
>
next prev parent reply other threads:[~2023-06-14 7:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 8:38 [PATCH mptcp-next v7 00/19] BPF packet scheduler updates Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 01/19] Squash to "mptcp: drop last_snd and MPTCP_RESET_SCHEDULER" Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 02/19] Squash to "mptcp: add struct mptcp_sched_ops" Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 03/19] Squash to "mptcp: add sched in mptcp_sock" Geliang Tang
2023-06-07 16:42 ` Paolo Abeni
2023-06-07 8:38 ` [PATCH mptcp-next v7 04/19] Squash to "mptcp: add scheduler wrappers" Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 05/19] mptcp: add last_snd in sched_data Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 06/19] mptcp: add snd_burst " Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 07/19] mptcp: register default scheduler Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 08/19] Squash to "bpf: Add bpf_mptcp_sched_ops" Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 09/19] Squash to "selftests/bpf: Add mptcp sched structs" Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 10/19] Squash to "selftests/bpf: Add bpf_rr scheduler" Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 11/19] mptcp: rename __mptcp_set_timeout Geliang Tang
2023-06-07 16:51 ` Paolo Abeni
2023-06-07 8:38 ` [PATCH mptcp-next v7 12/19] mptcp: add two wrappers needed by bpf_burst Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 13/19] bpf: Add bpf_burst write accesses Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 14/19] bpf: Export more bpf_burst related functions Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 15/19] selftests/bpf: Add bpf_burst scheduler Geliang Tang
2023-06-07 17:06 ` Paolo Abeni
2023-06-07 8:38 ` [PATCH mptcp-next v7 16/19] selftests/bpf: Add bpf_burst test Geliang Tang
2023-06-07 17:08 ` Paolo Abeni
2023-06-14 7:38 ` Geliang Tang [this message]
2023-06-07 8:38 ` [PATCH mptcp-next v7 17/19] bpf: Add subflow bit flags write accesses Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 18/19] selftests/bpf: Add bpf_stale scheduler Geliang Tang
2023-06-07 8:38 ` [PATCH mptcp-next v7 19/19] selftests/bpf: Add bpf_stale test Geliang Tang
2023-06-07 9:15 ` selftests/bpf: Add bpf_stale test: Build Failure MPTCP CI
2023-06-07 9:42 ` selftests/bpf: Add bpf_stale test: Tests Results 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=20230614073836.GA9545@bogon \
--to=geliang.tang@suse.com \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.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 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.