[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a965cc31-bbac-43dd-86d4-b2f72e789c92@bootlin.com>
Date: Tue, 18 Mar 2025 16:10:12 +0100
From: Bastien Curutchet <bastien.curutchet@...tlin.com>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: Björn Töpel <bjorn@...nel.org>,
Magnus Karlsson <magnus.karlsson@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau
<martin.lau@...ux.dev>, Eduard Zingerman <eddyz87@...il.com>,
Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Mykola Lysenko <mykolal@...com>,
Shuah Khan <shuah@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Jesper Dangaard Brouer <hawk@...nel.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Alexis Lothore <alexis.lothore@...tlin.com>, netdev@...r.kernel.org,
bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/13] selftests/bpf: test_xsk: Split xskxceiver
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@...tlin.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
Powered by blists - more mailing lists