bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, Martin Lau <kafai@fb.com>,
	john fastabend <john.fastabend@gmail.com>,
	Kernel Team <kernel-team@fb.com>,
	Networking <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Lawrence Brakmo <brakmo@fb.com>,
	alexanderduyck@fb.com
Subject: Re: [bpf-next PATCH v2 1/5] selftests/bpf: Move test_tcppbf_user into test_progs
Date: Tue, 3 Nov 2020 10:34:02 -0800	[thread overview]
Message-ID: <CAEf4BzbyNVfkEe+X4ZW-vnWS_XhiD8sh059dNehGpX5eZrxaoQ@mail.gmail.com> (raw)
In-Reply-To: <160417033167.2823.10759249192027767614.stgit@localhost.localdomain>

On Sat, Oct 31, 2020 at 11:52 AM Alexander Duyck
<alexander.duyck@gmail.com> wrote:
>
> From: Alexander Duyck <alexanderduyck@fb.com>
>
> Recently a bug was missed due to the fact that test_tcpbpf_user is not a
> part of test_progs. In order to prevent similar issues in the future move
> the test functionality into test_progs. By doing this we can make certain
> that it is a part of standard testing and will not be overlooked.
>
> As a part of moving the functionality into test_progs it is necessary to
> integrate with the test_progs framework and to drop any redundant code.
> This patch:
> 1. Cleans up the include headers
> 2. Dropped a duplicate definition of bpf_find_map
> 3. Switched over to using test_progs specific cgroup functions
> 4. Replaced printf calls with fprintf to stderr

This is not necessary. test_progs intercept both stdout and stderr, so
you could have kept the code as is and minimize this diff further. But
it also doesn't matter all that much, so:

Acked-by: Andrii Nakryiko <andrii@kernel.org>

> 5. Renamed main to test_tcpbpf_user
> 6. Dropped return value in favor of CHECK_FAIL to check for errors
>
> The general idea is that I wanted to keep the changes as small as possible
> while moving the file into the test_progs framework. The follow-on patches
> are meant to clean up the remaining issues such as the use of CHECK_FAIL.
>
> Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
> ---
>  tools/testing/selftests/bpf/.gitignore             |    1
>  tools/testing/selftests/bpf/Makefile               |    3 -
>  .../testing/selftests/bpf/prog_tests/tcpbpf_user.c |   63 ++++++--------------
>  3 files changed, 21 insertions(+), 46 deletions(-)
>  rename tools/testing/selftests/bpf/{test_tcpbpf_user.c => prog_tests/tcpbpf_user.c} (70%)
>

[...]

  reply	other threads:[~2020-11-03 18:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <160416890683.710453.7723265174628409401.stgit@localhost.localdomain>
2020-10-31 18:52 ` [bpf-next PATCH v2 1/5] selftests/bpf: Move test_tcppbf_user into test_progs Alexander Duyck
2020-11-03 18:34   ` Andrii Nakryiko [this message]
2020-11-03 19:06     ` Alexander Duyck
2020-10-31 18:52 ` [bpf-next PATCH v2 2/5] selftests/bpf: Drop python client/server in favor of threads Alexander Duyck
2020-11-03  0:38   ` Martin KaFai Lau
2020-11-03  0:49     ` Alexander Duyck
2020-11-03  1:33       ` Martin KaFai Lau
2020-11-03 16:01         ` Alexander Duyck
2020-10-31 18:52 ` [bpf-next PATCH v2 3/5] selftests/bpf: Replace EXPECT_EQ with ASSERT_EQ and refactor verify_results Alexander Duyck
2020-11-03  0:42   ` Martin KaFai Lau
2020-11-03  0:56     ` Alexander Duyck
2020-11-03  1:40       ` Martin KaFai Lau
2020-11-03 18:38   ` Andrii Nakryiko
2020-10-31 18:52 ` [bpf-next PATCH v2 4/5] selftests/bpf: Migrate tcpbpf_user.c to use BPF skeleton Alexander Duyck
2020-11-03  0:55   ` Martin KaFai Lau
2020-11-03 15:44     ` Alexander Duyck
2020-10-31 18:52 ` [bpf-next PATCH v2 5/5] selftest/bpf: Use global variables instead of maps for test_tcpbpf_kern Alexander Duyck
2020-11-03  1:25   ` Martin KaFai Lau
2020-11-03 15:42     ` Alexander Duyck
2020-11-03 18:12       ` Martin KaFai Lau
2020-11-03 18:40   ` Andrii Nakryiko
2020-10-31 19:03 ` [bpf-next PATCH v2 0/5] selftests/bpf: Migrate test_tcpbpf_user to be a part of test_progs framework Alexander Duyck

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=CAEf4BzbyNVfkEe+X4ZW-vnWS_XhiD8sh059dNehGpX5eZrxaoQ@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexanderduyck@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brakmo@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).