mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Nicolas Rybowski <nicolas.rybowski@tessares.net>
Cc: Song Liu <song@kernel.org>, Shuah Khan <shuah@kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"Martin Lau" <kafai@fb.com>, Yonghong Song <yhs@fb.com>,
	Andrii Nakryiko <andriin@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Matthieu Baerts <matthieu.baerts@tessares.net>,
	"open list" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2 4/5] bpf: selftests: add MPTCP test base
Date: Tue, 15 Sep 2020 17:18:56 +0000	[thread overview]
Message-ID: <6BCFCB44-3CF4-47B0-BD59-720F32581E31@fb.com> (raw)
In-Reply-To: <CACXrtpRzZuCyZnduYcV+1d2Z3qTK2b7Mcj2gQvcRbnv7+k0VRw@mail.gmail.com>



> On Sep 15, 2020, at 9:35 AM, Nicolas Rybowski <nicolas.rybowski@tessares.net> wrote:
> 
> Hi Song,
> 
> Thanks for the feedback !
> 
> On Mon, Sep 14, 2020 at 8:07 PM Song Liu <song@kernel.org> wrote:
>> 
>> On Fri, Sep 11, 2020 at 8:02 AM Nicolas Rybowski
>> <nicolas.rybowski@tessares.net> wrote:
>>> 
>>> This patch adds a base for MPTCP specific tests.
>>> 
>>> It is currently limited to the is_mptcp field in case of plain TCP
>>> connection because for the moment there is no easy way to get the subflow
>>> sk from a msk in userspace. This implies that we cannot lookup the
>>> sk_storage attached to the subflow sk in the sockops program.
>>> 
>>> Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
>>> Signed-off-by: Nicolas Rybowski <nicolas.rybowski@tessares.net>
>> 
>> Acked-by: Song Liu <songliubraving@fb.com>
>> 
>> With some nitpicks below.
>> 
>>> ---
>>> 
>>> Notes:
>>>    v1 -> v2:
>>>    - new patch: mandatory selftests (Alexei)
>>> 
>> [...]
>>>                     int timeout_ms);
>>> diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
>>> new file mode 100644
>>> index 000000000000..0e65d64868e9
>>> --- /dev/null
>>> +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
>>> @@ -0,0 +1,119 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +#include <test_progs.h>
>>> +#include "cgroup_helpers.h"
>>> +#include "network_helpers.h"
>>> +
>>> +struct mptcp_storage {
>>> +       __u32 invoked;
>>> +       __u32 is_mptcp;
>>> +};
>>> +
>>> +static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 is_mptcp)
>>> +{
>>> +       int err = 0, cfd = client_fd;
>>> +       struct mptcp_storage val;
>>> +
>>> +       /* Currently there is no easy way to get back the subflow sk from the MPTCP
>>> +        * sk, thus we cannot access here the sk_storage associated to the subflow
>>> +        * sk. Also, there is no sk_storage associated with the MPTCP sk since it
>>> +        * does not trigger sockops events.
>>> +        * We silently pass this situation at the moment.
>>> +        */
>>> +       if (is_mptcp == 1)
>>> +               return 0;
>>> +
>>> +       if (CHECK_FAIL(bpf_map_lookup_elem(map_fd, &cfd, &val) < 0)) {
>>> +               perror("Failed to read socket storage");
>> 
>> Maybe simplify this with CHECK(), which contains a customized error message?
>> Same for some other calls.
>> 
> 
> The whole logic here is strongly inspired from prog_tests/tcp_rtt.c
> where CHECK_FAIL is used.
> Also the CHECK macro will print a PASS message on successful map
> lookup, which is not expected at this point of the tests.
> I think it would be more interesting to leave it as it is to keep a
> cohesion between TCP and MPTCP selftests. What do you think?

I guess CHECK_FAIL makes sense when we don't need the PASS message. 
Let's keep this part as-is then. 

Thanks,
Song


  reply	other threads:[~2020-09-15 17:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 14:30 [PATCH bpf-next v2 1/5] bpf: expose is_mptcp flag to bpf_tcp_sock Nicolas Rybowski
2020-09-11 14:30 ` [PATCH bpf-next v2 2/5] mptcp: attach subflow socket to parent cgroup Nicolas Rybowski
2020-09-14 20:52   ` Song Liu
2020-09-11 14:30 ` [PATCH bpf-next v2 3/5] bpf: add 'bpf_mptcp_sock' structure and helper Nicolas Rybowski
2020-09-14 21:00   ` Song Liu
2020-09-11 14:30 ` [PATCH bpf-next v2 4/5] bpf: selftests: add MPTCP test base Nicolas Rybowski
2020-09-14 18:07   ` Song Liu
2020-09-15 16:35     ` Nicolas Rybowski
2020-09-15 17:18       ` Song Liu [this message]
2020-09-11 14:30 ` [PATCH bpf-next v2 5/5] bpf: selftests: add bpf_mptcp_sock() verifier tests Nicolas Rybowski
2020-09-14 18:08   ` Song Liu
2020-09-11 14:30 ` [PATCH bpf-next v2 0/5] bpf: add MPTCP subflow support Nicolas Rybowski
2020-09-14 18:20 ` [PATCH bpf-next v2 1/5] bpf: expose is_mptcp flag to bpf_tcp_sock Song Liu
2020-09-14 22:13   ` Andrii Nakryiko

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=6BCFCB44-3CF4-47B0-BD59-720F32581E31@fb.com \
    --to=songliubraving@fb.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=matthieu.baerts@tessares.net \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.rybowski@tessares.net \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=yhs@fb.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

all inboxes | Powered by JetHome®