All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: "sunyucong@gmail.com" <sunyucong@gmail.com>
Cc: Yucong Sun <fallentree@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: adding delay in socketmap_listen to reduce flakyness
Date: Thu, 19 Aug 2021 12:29:17 -0700	[thread overview]
Message-ID: <CAEf4Bza-Oj4fQ9xboiXNEFJN0Pmpyr3BW=RAQQGByx=CUyfF9g@mail.gmail.com> (raw)
In-Reply-To: <CAJygYd2FpcennyFp+JabOEsgNj+oGBentf_Kbj-QcNs0csv-uw@mail.gmail.com>

On Thu, Aug 19, 2021 at 12:16 PM sunyucong@gmail.com
<sunyucong@gmail.com> wrote:
>
> On Thu, Aug 19, 2021 at 11:45 AM Andrii Nakryiko
> <andrii.nakryiko@gmail.com> wrote:
> >
> > On Thu, Aug 19, 2021 at 9:36 AM Yucong Sun <fallentree@fb.com> wrote:
> > >
> > > This patch adds a 1ms delay to reduce flakyness of the test.
> > >
> > > Signed-off-by: Yucong Sun <fallentree@fb.com>
> > > ---
> >
> > Any reasons to not implement exponential back-off, like we did for test_maps?
>
> for simplicity, since there are no contention involved here I figured
> we don’t need random delay and back-offs.

Alright, it's an improvement anyways. Let's see if it still causes
problem. Applied to bpf-next, thanks!

>
> (sorry for resending, I was fooled by the mobile gmail client that it
> doesn't do plain text).
>

AFAIK, mobile client doesn't support plain text

>
> >
> > >  .../selftests/bpf/prog_tests/sockmap_listen.c        | 12 +++++++++---
> > >  1 file changed, 9 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> > > index afa14fb66f08..6a5df28f9a3d 100644
> > > --- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> > > +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
> > > @@ -1603,8 +1603,10 @@ static void unix_redir_to_connected(int sotype, int sock_mapfd,
> > >  again:
> > >         n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1);
> > >         if (n < 0) {
> > > -               if (errno == EAGAIN && retries--)
> > > +               if (errno == EAGAIN && retries--) {
> > > +                       usleep(1000);
> > >                         goto again;
> > > +               }
> > >                 FAIL_ERRNO("%s: read", log_prefix);
> > >         }
> > >         if (n == 0)
> > > @@ -1776,8 +1778,10 @@ static void udp_redir_to_connected(int family, int sock_mapfd, int verd_mapfd,
> > >  again:
> > >         n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1);
> > >         if (n < 0) {
> > > -               if (errno == EAGAIN && retries--)
> > > +               if (errno == EAGAIN && retries--) {
> > > +                       usleep(1000);
> > >                         goto again;
> > > +               }
> > >                 FAIL_ERRNO("%s: read", log_prefix);
> > >         }
> > >         if (n == 0)
> > > @@ -1869,8 +1873,10 @@ static void inet_unix_redir_to_connected(int family, int type, int sock_mapfd,
> > >  again:
> > >         n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1);
> > >         if (n < 0) {
> > > -               if (errno == EAGAIN && retries--)
> > > +               if (errno == EAGAIN && retries--) {
> > > +                       usleep(1000);
> > >                         goto again;
> > > +               }
> > >                 FAIL_ERRNO("%s: read", log_prefix);
> > >         }
> > >         if (n == 0)
> > > --
> > > 2.30.2
> > >

  reply	other threads:[~2021-08-19 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 16:36 [PATCH bpf-next] selftests/bpf: adding delay in socketmap_listen to reduce flakyness Yucong Sun
2021-08-19 18:44 ` Andrii Nakryiko
2021-08-19 19:15   ` sunyucong
2021-08-19 19:29     ` Andrii Nakryiko [this message]
2021-08-19 19:30 ` patchwork-bot+netdevbpf

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='CAEf4Bza-Oj4fQ9xboiXNEFJN0Pmpyr3BW=RAQQGByx=CUyfF9g@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=fallentree@fb.com \
    --cc=sunyucong@gmail.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.