Netdev List
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	netdev@vger.kernel.org
Cc: bpf@vger.kernel.org, magnus.karlsson@intel.com,
	stfomichev@gmail.com, kuba@kernel.org, pabeni@redhat.com,
	tushar.vyavahare@intel.com, kerneljasonxing@gmail.com,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Subject: Re: [PATCH v2 net-next 12/14] selftests: xsk: share test case definitions with hardware runner
Date: Fri, 09 Oct 2026 14:12:52 +0200	[thread overview]
Message-ID: <875wzbqdh7.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20261008114909.734364-13-maciej.fijalkowski@intel.com>

Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:

> Keep case names, functions, and hardware directions in an X-macro
> header. The C test table keeps its order, so the test IDs do not
> change. This allows the Python runner added by the next patch to read
> the same definitions. Only the runner uses the hardware directions,
> the DUT roles in which it runs a case; xskxceiver ignores them.
>
> Install the header with selftests so the Python runner can read it
> from an installed tree.
>
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> ---
>  tools/testing/selftests/net/lib/Makefile      |  2 +-
>  .../testing/selftests/net/lib/xsk/test_xsk.h  | 46 ++-------------
>  .../net/lib/xsk/test_xsk_case_defs.h          | 57 +++++++++++++++++++
>  3 files changed, 62 insertions(+), 43 deletions(-)
>  create mode 100644 tools/testing/selftests/net/lib/xsk/test_xsk_case_defs.h
>
> diff --git a/tools/testing/selftests/net/lib/Makefile b/tools/testing/selftests/net/lib/Makefile
> index 066d011c478a..15353021cecf 100644
> --- a/tools/testing/selftests/net/lib/Makefile
> +++ b/tools/testing/selftests/net/lib/Makefile
> @@ -28,7 +28,7 @@ TEST_GEN_FILES := \
>  	xdp_helper \
>  # end of TEST_GEN_FILES
>  
> -TEST_INCLUDES := $(wildcard py/*.py sh/*.sh)
> +TEST_INCLUDES := $(wildcard py/*.py sh/*.sh) xsk/test_xsk_case_defs.h
>  
>  include ../../lib.mk
>  
> diff --git a/tools/testing/selftests/net/lib/xsk/test_xsk.h b/tools/testing/selftests/net/lib/xsk/test_xsk.h
> index c37423030eb6..e1ffd054c8f7 100644
> --- a/tools/testing/selftests/net/lib/xsk/test_xsk.h
> +++ b/tools/testing/selftests/net/lib/xsk/test_xsk.h
> @@ -309,48 +309,10 @@ int worker_testapp_validate_rx(struct test_spec *test);
>  int worker_testapp_validate_tx(struct test_spec *test);
>  
>  static const struct test_spec tests[] = {
> -	{.name = "SEND_RECEIVE", .test_func = testapp_send_receive},
> -	{.name = "SEND_RECEIVE_2K_FRAME", .test_func = testapp_send_receive_2k_frame},
> -	{.name = "SEND_RECEIVE_SINGLE_PKT", .test_func = testapp_single_pkt},
> -	{.name = "POLL_RX", .test_func = testapp_poll_rx},
> -	{.name = "POLL_TX", .test_func = testapp_poll_tx},
> -	{.name = "POLL_RXQ_FULL", .test_func = testapp_poll_rxq_tmout},
> -	{.name = "POLL_TXQ_FULL", .test_func = testapp_poll_txq_tmout},
> -	{.name = "ALIGNED_INV_DESC", .test_func = testapp_aligned_inv_desc},
> -	{.name = "ALIGNED_INV_DESC_2K_FRAME_SIZE", .test_func = testapp_aligned_inv_desc_2k_frame},
> -	{.name = "UMEM_HEADROOM", .test_func = testapp_headroom},
> -	{.name = "BIDIRECTIONAL", .test_func = testapp_bidirectional},
> -	{.name = "STAT_RX_DROPPED", .test_func = testapp_stats_rx_dropped},
> -	{.name = "STAT_TX_INVALID", .test_func = testapp_stats_tx_invalid_descs},
> -	{.name = "STAT_RX_FULL", .test_func = testapp_stats_rx_full},
> -	{.name = "STAT_FILL_EMPTY", .test_func = testapp_stats_fill_empty},
> -	{.name = "XDP_PROG_CLEANUP", .test_func = testapp_xdp_prog_cleanup},
> -	{.name = "XDP_DROP_HALF", .test_func = testapp_xdp_drop},
> -	{.name = "XDP_SHARED_UMEM", .test_func = testapp_xdp_shared_umem},
> -	{.name = "XDP_METADATA_COPY", .test_func = testapp_xdp_metadata},
> -	{.name = "XDP_METADATA_COPY_MULTI_BUFF", .test_func = testapp_xdp_metadata_mb},
> -	{.name = "ALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_aligned_inv_desc_mb},
> -	{.name = "TOO_MANY_FRAGS", .test_func = testapp_too_many_frags},
> -	{.name = "XDP_ADJUST_TAIL_SHRINK", .test_func = testapp_adjust_tail_shrink},
> -	{.name = "TX_QUEUE_CONSUMER", .test_func = testapp_tx_queue_consumer},
> -	/* Flaky tests */
> -	{.name = "XDP_ADJUST_TAIL_SHRINK_MULTI_BUFF", .test_func = testapp_adjust_tail_shrink_mb},
> -	{.name = "XDP_ADJUST_TAIL_GROW", .test_func = testapp_adjust_tail_grow},
> -	{.name = "XDP_ADJUST_TAIL_GROW_MULTI_BUFF", .test_func = testapp_adjust_tail_grow_mb},
> -	{.name = "SEND_RECEIVE_9K_PACKETS", .test_func = testapp_send_receive_mb},
> -	/* Tests with huge page dependency */
> -	{.name = "SEND_RECEIVE_UNALIGNED", .test_func = testapp_send_receive_unaligned},
> -	{.name = "UNALIGNED_INV_DESC", .test_func = testapp_unaligned_inv_desc},
> -	{.name = "UNALIGNED_INV_DESC_4001_FRAME_SIZE",
> -	 .test_func = testapp_unaligned_inv_desc_4001_frame},
> -	{.name = "SEND_RECEIVE_UNALIGNED_9K_PACKETS",
> -	 .test_func = testapp_send_receive_unaligned_mb},
> -	{.name = "UNALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_unaligned_inv_desc_mb},
> -	/* Test with HW ring size dependency */
> -	{.name = "HW_SW_MIN_RING_SIZE", .test_func = testapp_hw_sw_min_ring_size},
> -	{.name = "HW_SW_MAX_RING_SIZE", .test_func = testapp_hw_sw_max_ring_size},
> -	/* Too long test */
> -	{.name = "TEARDOWN", .test_func = testapp_teardown},
> +#define XSK_TEST_CASE(_name, _func, ...) \
> +	{ .name = #_name, .test_func = _func },
> +#include "test_xsk_case_defs.h"
> +#undef XSK_TEST_CASE
>  };

Hmm. Maybe not for this revision, but I'm getting a vibe that we're
mixing reusable operations with test receipes.

Ideally the operations would reside in the C-code, and the recipes in
Python...

  reply	other threads:[~2026-10-09 12:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 11:48 [PATCH v2 net-next 00/14] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-08 11:48 ` [PATCH v2 net-next 01/14] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-08 11:48 ` [PATCH v2 net-next 02/14] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-09  9:46   ` Björn Töpel
2026-10-09 12:43     ` Maciej Fijalkowski
2026-10-08 11:48 ` [PATCH v2 net-next 03/14] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-08 11:48 ` [PATCH v2 net-next 04/14] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 05/14] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-09 11:18   ` Björn Töpel
2026-10-09 12:46     ` Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 06/14] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 07/14] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 08/14] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-09 11:25   ` Björn Töpel
2026-10-08 11:49 ` [PATCH v2 net-next 09/14] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 10/14] selftests: xsk: add a hardware mode to xskxceiver Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 11/14] selftests: xsk: pass non-test traffic to the stack in hardware mode Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 12/14] selftests: xsk: share test case definitions with hardware runner Maciej Fijalkowski
2026-10-09 12:12   ` Björn Töpel [this message]
2026-10-09 12:52     ` Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 13/14] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-08 21:37   ` Jakub Kicinski
2026-10-09 13:13     ` Maciej Fijalkowski
2026-10-08 11:49 ` [PATCH v2 net-next 14/14] selftests: xsk: document generic and hardware endpoint runs Maciej Fijalkowski
2026-10-08 21:41   ` Jakub Kicinski
2026-10-08 21:30 ` [PATCH v2 net-next 00/14] selftests: net: migrate AF_XDP test suite over to net Jakub Kicinski
2026-10-09 12:02   ` Björn Töpel
2026-10-09 13:15     ` 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=875wzbqdh7.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stfomichev@gmail.com \
    --cc=tushar.vyavahare@intel.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