BPF List
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>,
	 YiFei Zhu <zhuyifei@google.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	"Björn Töpel" <bjorn@kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
	"Jonathan Lemon" <jonathan.lemon@gmail.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Stanislav Fomichev" <sdf@google.com>,
	"Willem de Bruijn" <willemb@google.com>
Subject: Re: [RFC PATCH net-next 0/3] selftests: Add AF_XDP functionality test
Date: Wed, 12 Jun 2024 09:57:04 -0400	[thread overview]
Message-ID: <6669a930e1bce_125bdf294cf@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <CAJ8uoz2-Kt2o-v3CuLpf2VDv2VtUJL2T307rp04di5hY2ihYHg@mail.gmail.com>

Magnus Karlsson wrote:
> On Tue, 11 Jun 2024 at 22:43, YiFei Zhu <zhuyifei@google.com> wrote:
> >
> > We have observed that hardware NIC drivers may have faulty AF_XDP
> > implementations, and there seem to be a lack of a test of various modes
> > in which AF_XDP could run. This series adds a test to verify that NIC
> > drivers implements many AF_XDP features by performing a send / receive
> > of a single UDP packet.
> >
> > I put the C code of the test under selftests/bpf because I'm not really
> > sure how I'd build the BPF-related code without the selftests/bpf
> > build infrastructure.
> 
> Happy to see that you are contributing a number of new tests. Would it
> be possible for you to integrate this into the xskxceiver framework?

Makes sense, we'll need to take a look.

This is an internal test that we have been using for a long time in
our test framework.

My mistake for not keeping up at all with the changes to xskxceiver.c
in the meantime.

We want to test each case independently. Including a few non obvious
cases that we discovered from real use, notably

- Using XSK only for Tx, without installing an Rx program
- Using XSK with an empty fill queue, filling it after bind

> You can find that in selftests/bpf too. By default, it will run its
> tests using veth, but if you provide an interface name after the -i
> option, it will run the tests over a real interface. I put the NIC in
> loopback mode to use this feature, but feel free to add a new mode if
> necessary.

We do really want two machine tests, not loopback mode. Also to
integrate into the drv-net infrastructure.

Another non-obvious feature is to test one side AF_XDP and use
PF_PACKET on the other side, to be able to isolate and exercise only
the Tx or Rx path in a test.

> A lot of the setup and data plane code that you add already
> exists in xskxceiver, so I would prefer if you could reuse it. Your
> tests are new though and they would be valuable to have.
> 
> You could make the default packet that is sent in xskxceiver be the
> UDP packet that you want and then add all the other logic that you
> have to a number of new tests that you introduce.

      parent reply	other threads:[~2024-06-12 13:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 20:42 [RFC PATCH net-next 0/3] selftests: Add AF_XDP functionality test YiFei Zhu
2024-06-11 20:42 ` [RFC PATCH net-next 1/3] selftests/bpf: Move rxq_num helper from xdp_hw_metadata to network_helpers YiFei Zhu
2024-06-11 21:12   ` Willem de Bruijn
2024-06-11 20:42 ` [RFC PATCH net-next 2/3] selftests/bpf: Add xsk_hw AF_XDP functionality test YiFei Zhu
2024-06-11 20:42 ` [RFC PATCH net-next 3/3] selftests: drv-net: " YiFei Zhu
2024-06-11 21:09   ` Willem de Bruijn
2024-06-12 11:47 ` [RFC PATCH net-next 0/3] selftests: Add " Magnus Karlsson
2024-06-12 12:49   ` Maciej Fijalkowski
2024-06-12 16:44     ` YiFei Zhu
2024-06-13  6:42       ` Magnus Karlsson
2024-06-12 13:57   ` Willem de Bruijn [this message]

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=6669a930e1bce_125bdf294cf@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=willemb@google.com \
    --cc=zhuyifei@google.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