netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Lorenz Bauer <lmb@cloudflare.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	kernel-team <kernel-team@cloudflare.com>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v3 1/5] bpf: consolidate shared test timing code
Date: Tue, 2 Mar 2021 20:27:04 -0800	[thread overview]
Message-ID: <CAEf4BzYvteVTJkGkyTNK_1YPV8aEQTYxDkW5uXTpWj5SvE4pvg@mail.gmail.com> (raw)
In-Reply-To: <20210301101859.46045-2-lmb@cloudflare.com>

On Mon, Mar 1, 2021 at 2:19 AM Lorenz Bauer <lmb@cloudflare.com> wrote:
>
> Share the timing / signal interruption logic between different
> implementations of PROG_TEST_RUN. There is a change in behaviour
> as well. We check the loop exit condition before checking for
> pending signals. This resolves an edge case where a signal
> arrives during the last iteration. Instead of aborting with
> EINTR we return the successful result to user space.
>
> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
> ---
>  net/bpf/test_run.c | 141 +++++++++++++++++++++++++--------------------
>  1 file changed, 78 insertions(+), 63 deletions(-)
>
> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> index 58bcb8c849d5..ac8ee36d60cc 100644
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -16,14 +16,78 @@
>  #define CREATE_TRACE_POINTS
>  #include <trace/events/bpf_test_run.h>
>
> +struct test_timer {

nit: super generic name, I'd add bpf_ prefix throughout
(bpf_test_timer, bpf_test_timer_enter, bpf_test_timer_leave, and so
on)

> +       enum { NO_PREEMPT, NO_MIGRATE } mode;
> +       u32 i;
> +       u64 time_start, time_spent;
> +};
> +

[...]

  reply	other threads:[~2021-03-03  4:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 10:18 [PATCH bpf-next v3 0/5] PROG_TEST_RUN support for sk_lookup programs Lorenz Bauer
2021-03-01 10:18 ` [PATCH bpf-next v3 1/5] bpf: consolidate shared test timing code Lorenz Bauer
2021-03-03  4:27   ` Andrii Nakryiko [this message]
2021-03-01 10:18 ` [PATCH bpf-next v3 2/5] bpf: add PROG_TEST_RUN support for sk_lookup programs Lorenz Bauer
2021-03-01 10:18 ` [PATCH bpf-next v3 3/5] selftests: bpf: convert sk_lookup ctx access tests to PROG_TEST_RUN Lorenz Bauer
2021-03-01 10:18 ` [PATCH bpf-next v3 4/5] selftests: bpf: check that PROG_TEST_RUN repeats as requested Lorenz Bauer
2021-03-01 10:18 ` [PATCH bpf-next v3 5/5] selftests: bpf: don't run sk_lookup in verifier tests Lorenz Bauer

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=CAEf4BzYvteVTJkGkyTNK_1YPV8aEQTYxDkW5uXTpWj5SvE4pvg@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@cloudflare.com \
    --cc=lmb@cloudflare.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).