BPF List
 help / color / mirror / Atom feed
From: Bastien Curutchet <bastien.curutchet@bootlin.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: "Björn Töpel" <bjorn@kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Jonathan Lemon" <jonathan.lemon@gmail.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Song Liu" <song@kernel.org>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"KP Singh" <kpsingh@kernel.org>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Hao Luo" <haoluo@google.com>, "Jiri Olsa" <jolsa@kernel.org>,
	"Mykola Lysenko" <mykolal@fb.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alexis Lothore" <alexis.lothore@bootlin.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/13] selftests/bpf: test_xsk: Split xskxceiver
Date: Tue, 18 Mar 2025 16:10:12 +0100	[thread overview]
Message-ID: <a965cc31-bbac-43dd-86d4-b2f72e789c92@bootlin.com> (raw)
In-Reply-To: <Z9lyK5pEi+FmcvYw@boxer>

Hi Maciej,

On 3/18/25 2:16 PM, Maciej Fijalkowski wrote:
> On Thu, Mar 13, 2025 at 11:48:08AM +0100, Bastien Curutchet (eBPF Foundation) wrote:
>> AF_XDP features are tested by the test_xsk.sh script but not by the
>> test_progs framework. The tests used by the script are defined in
>> xksxceiver.c which can't be integrated in the test_progs framework as is.
>>
>> Extract these test definitions from xskxceiver{.c/.h} to put them in new
>> test_xsk{.c/.h} files.
>> Keep the main() function and its unshared dependencies in xksxceiver to
>> avoid impacting the test_xsk.sh script which is often used to test real
>> hardware.
>>
>> Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
>> ---
>>   tools/testing/selftests/bpf/Makefile     |    2 +-
>>   tools/testing/selftests/bpf/test_xsk.c   | 2416 ++++++++++++++++++++++++++++
>>   tools/testing/selftests/bpf/test_xsk.h   |  279 ++++
>>   tools/testing/selftests/bpf/xskxceiver.c | 2503 +-----------------------------
>>   tools/testing/selftests/bpf/xskxceiver.h |  156 --
>>   5 files changed, 2727 insertions(+), 2629 deletions(-)
>> +
> 
> (...)
> 
>> +int testapp_hw_sw_max_ring_size(struct test_spec *test)
>> +{
>> +	u32 max_descs = XSK_RING_PROD__DEFAULT_NUM_DESCS * 4;
>> +	int ret;
>> +
>> +	test->set_ring = true;
>> +	test->total_steps = 2;
>> +	test->ifobj_tx->ring.tx_pending = test->ifobj_tx->ring.tx_max_pending;
>> +	test->ifobj_tx->ring.rx_pending  = test->ifobj_tx->ring.rx_max_pending;
>> +	test->ifobj_rx->umem->num_frames = max_descs;
>> +	test->ifobj_rx->umem->fill_size = max_descs;
>> +	test->ifobj_rx->umem->comp_size = max_descs;
>> +	test->ifobj_tx->xsk->batch_size = XSK_RING_PROD__DEFAULT_NUM_DESCS;
>> +	test->ifobj_rx->xsk->batch_size = XSK_RING_PROD__DEFAULT_NUM_DESCS;
>> +
>> +	ret = testapp_validate_traffic(test);
>> +	if (ret)
>> +		return ret;
>> +
>> +	/* Set batch_size to 8152 for testing, as the ice HW ignores the 3 lowest bits when
>> +	 * updating the Rx HW tail register.
>> +	 */
>> +	test->ifobj_tx->xsk->batch_size = test->ifobj_tx->ring.tx_max_pending - 8;
>> +	test->ifobj_rx->xsk->batch_size = test->ifobj_tx->ring.tx_max_pending - 8;
>> +	if (!pkt_stream_replace(test, max_descs, MIN_PKT_SIZE))
> 
> Here's the victim of test failures that i reported last week. This
> function succeds with 0 and you interpret it as failure:)

Oops ... Thanks for the feedback.

> One sign wrong caused two days of debugging, but it was kinda fun.
> 

I should have ordered patches in an other way to split the xskxceiver.c 
sooner, the bisection would have narrowed the bug more precisely. I'll 
do this in next iteration.

> What was happening was due to the failure here one of the sockets was not
> deleted and later on whole test suite could not attach the socket for
> every other test case which caused the ever going failures. Which makes me
> think that since you changed the logic from exits to returning failures
> probably we need to take care of state cleanup in a better way so case
> like this one described here wouldn't take place.
> 

I hadn't notice the cleanup done in __testapp_validate_traffic(), I'll 
handle this in a better way in next iteration.

> This test is only executed for hw tests that's why you haven't seen this
> problem as you were focused on veth case.
> 
> If you want to proceed with that then i would like to ask you to grab the
> hw and check you're not introducing regressions. FWIW i have been working
> with i40e and ice drivers.
> 

I don't think I have such hardware available but I'll try to find some 
equivalent to test the next iteration on real HW before submitting it.

> One last note is that verbose mode seemed to be broken for me.
> 

I'll take a look at this, thank you.


Best regards,
Bastien


  reply	other threads:[~2025-03-18 15:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13 10:47 [PATCH 00/13] selftests/bpf: Integrate test_xsk.c to test_progs framework Bastien Curutchet (eBPF Foundation)
2025-03-13 10:47 ` [PATCH 01/13] selftests/bpf: test_xsk: Initialize bitmap before use Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 02/13] selftests/bpf: test_xsk: Fix memory leaks Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 03/13] selftests/bpf: test_xsk: Wrap ksft_*() behind macros Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 04/13] selftests/bpf: test_xsk: Add return value to init_iface() Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 05/13] selftests/bpf: test_xsk: Don't exit immediately when xsk_attach fails Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 06/13] selftests/bpf: test_xsk: Don't exit immediately when gettimeofday fails Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 07/13] selftests/bpf: test_xsk: Don't exit immediately when workers fail Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 08/13] selftests/bpf: test_xsk: Don't exit immediately if validate_traffic fails Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 09/13] selftests/bpf: test_xsk: Don't exit immediately on allocation failures Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 10/13] selftests/bpf: test_xsk: Split xskxceiver Bastien Curutchet (eBPF Foundation)
2025-03-18 13:16   ` Maciej Fijalkowski
2025-03-18 15:10     ` Bastien Curutchet [this message]
2025-03-13 10:48 ` [PATCH 11/13] selftests/bpf: test_xsk: Make kselftest dependency optional Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 12/13] selftests/bpf: test_xsk: Isolate flaky tests Bastien Curutchet (eBPF Foundation)
2025-03-13 10:48 ` [PATCH 13/13] selftests/bpf: test_xsk: Integrate test_xsk.c to test_progs framework Bastien Curutchet (eBPF Foundation)
2025-03-13 10:50 ` [PATCH 00/13] selftests/bpf: " Bastien Curutchet
2025-03-14 15:45 ` Maciej Fijalkowski
2025-03-14 16:08   ` Bastien Curutchet

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=a965cc31-bbac-43dd-86d4-b2f72e789c92@bootlin.com \
    --to=bastien.curutchet@bootlin.com \
    --cc=alexis.lothore@bootlin.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=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jonathan.lemon@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yonghong.song@linux.dev \
    /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