netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	ciara.loftus@intel.com,
	"john fastabend" <john.fastabend@gmail.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>
Subject: Re: [PATCH v2 bpf-next 14/17] selftests: xsk: implement bpf_link test
Date: Mon, 22 Mar 2021 21:11:02 +0100	[thread overview]
Message-ID: <20210322201102.GC56104@ranger.igk.intel.com> (raw)
In-Reply-To: <CAEf4BzZDW8V0SPzqWksR8fg=8xShvRQdN3rJr_H3zm-VoXtdNw@mail.gmail.com>

On Mon, Mar 15, 2021 at 10:39:38PM -0700, Andrii Nakryiko wrote:
> On Thu, Mar 11, 2021 at 7:43 AM Maciej Fijalkowski
> <maciej.fijalkowski@intel.com> wrote:
> >
> > Introduce a test that is supposed to verify the persistence of BPF
> > resources based on underlying bpf_link usage.
> >
> > Test will:
> > 1) create and bind two sockets on queue ids 0 and 1
> > 2) run a traffic on queue ids 0
> > 3) remove xsk sockets from queue 0 on both veth interfaces
> > 4) run a traffic on queues ids 1
> >
> > Running traffic successfully on qids 1 means that BPF resources were
> > not removed on step 3).
> >
> > In order to make it work, change the command that creates veth pair to
> > have the 4 queue pairs by default.
> >
> > Introduce the arrays of xsks and umems to ifobject struct but keep a
> > pointers to single entities, so rest of the logic around Rx/Tx can be
> > kept as-is.
> >
> > For umem handling, double the size of mmapped space and split that
> > between the two sockets.
> >
> > Rename also bidi_pass to a variable 'second_step' of a boolean type as
> > it's now used also for the test that is introduced here and it doesn't
> > have anything in common with bi-directional testing.
> >
> > Drop opt_queue command line argument as it wasn't working before anyway.
> >
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> > ---
> >  tools/testing/selftests/bpf/test_xsk.sh  |   2 +-
> >  tools/testing/selftests/bpf/xdpxceiver.c | 179 +++++++++++++++++------
> >  tools/testing/selftests/bpf/xdpxceiver.h |   7 +-
> >  3 files changed, 138 insertions(+), 50 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
> > index 56d4474e2c83..2a00b8222475 100755
> > --- a/tools/testing/selftests/bpf/test_xsk.sh
> > +++ b/tools/testing/selftests/bpf/test_xsk.sh
> > @@ -107,7 +107,7 @@ setup_vethPairs() {
> >                 echo "setting up ${VETH0}: namespace: ${NS0}"
> >         fi
> >         ip netns add ${NS1}
> > -       ip link add ${VETH0} type veth peer name ${VETH1}
> > +       ip link add ${VETH0} numtxqueues 4 numrxqueues 4 type veth peer name ${VETH1} numtxqueues 4 numrxqueues 4
> >         if [ -f /proc/net/if_inet6 ]; then
> >                 echo 1 > /proc/sys/net/ipv6/conf/${VETH0}/disable_ipv6
> >         fi
> > diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c
> > index aef5840e1c24..dc775ee139c5 100644
> > --- a/tools/testing/selftests/bpf/xdpxceiver.c
> > +++ b/tools/testing/selftests/bpf/xdpxceiver.c
> > @@ -41,8 +41,12 @@
> >   *            Reduce the size of the RX ring to a fraction of the fill ring size.
> >   *       iv.  fill queue empty
> >   *            Do not populate the fill queue and then try to receive pkts.
> > + *    f. bpf_link resource persitence
> 
> typo: persistence

I'll fix it.

> 
> > + *       Configure sockets at indexes 0 and 1,run a traffic on queue ids 0,
> 
> while I'm here nitting :) space after comma?

I like nitpicking, yeah let's add that space.

> 
> > + *       then remove xsk sockets from queue 0 on both veth interfaces and
> > + *       finally run a traffic on queues ids 1
> >   *
> > - * Total tests: 10
> > + * Total tests: 12
> >   *
> >   * Flow:
> >   * -----
> 
> [...]

  reply	other threads:[~2021-03-22 20:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 15:28 [PATCH v2 bpf-next 00/17] AF_XDP selftests improvements & bpf_link Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 01/17] selftests: xsk: don't call worker_pkt_dump() for stats test Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 02/17] selftests: xsk: remove struct ifaceconfigobj Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 03/17] selftests: xsk: remove unused function Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 04/17] selftests: xsk: remove inline keyword from source file Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 05/17] selftests: xsk: simplify frame traversal in dumping thread Maciej Fijalkowski
2021-03-11 15:28 ` [PATCH v2 bpf-next 06/17] libbpf: xsk: use bpf_link Maciej Fijalkowski
2021-03-16  5:34   ` Andrii Nakryiko
2021-03-22 20:09     ` Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 07/17] samples: bpf: do not unload prog within xdpsock Maciej Fijalkowski
2021-03-16  5:35   ` Andrii Nakryiko
2021-03-11 15:29 ` [PATCH v2 bpf-next 08/17] selftests: xsk: remove thread for netns switch Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 09/17] selftests: xsk: split worker thread Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 10/17] selftests: xsk: remove Tx synchronization resources Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 11/17] selftests: xsk: refactor teardown/bidi test cases and testapp_validate Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 12/17] selftests: xsk: remove sync_mutex_tx and atomic var Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 13/17] veth: implement ethtool's get_channels() callback Maciej Fijalkowski
2021-03-16  8:44   ` Magnus Karlsson
2021-03-22 20:10     ` Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 14/17] selftests: xsk: implement bpf_link test Maciej Fijalkowski
2021-03-16  5:39   ` Andrii Nakryiko
2021-03-22 20:11     ` Maciej Fijalkowski [this message]
2021-03-11 15:29 ` [PATCH v2 bpf-next 15/17] selftests: xsk: remove thread attribute Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 16/17] selftest: xsk: Remove mutex and condition variable Maciej Fijalkowski
2021-03-11 15:29 ` [PATCH v2 bpf-next 17/17] selftests: xsk: Remove unused defines Maciej Fijalkowski

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=20210322201102.GC56104@ranger.igk.intel.com \
    --to=maciej.fijalkowski@intel.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=ciara.loftus@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@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 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).