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 v3 net-next 07/15] selftests: xsk: collect interface capabilities in struct xsk_caps
Date: Thu, 15 Oct 2026 10:27:57 +0200 [thread overview]
Message-ID: <87fqy774he.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20261014184539.774708-8-maciej.fijalkowski@intel.com>
Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
> A later patch runs the TX and RX endpoints of a case as separate
> processes, possibly on different hosts, each binding only its own
> interface. The shared test code still looks at the capabilities of both
> ifobjects, e.g. to check both for multi-buffer support or to size the
> RX batch from the TX ring limit. As the endpoints do not exchange
> capabilities, a process will represent the other side by a shadow
> ifobject that mirrors the local ones.
>
> Prepare for that by replacing the per-interface support booleans and
> limits in struct ifobject with one struct xsk_caps, so that mirroring
> takes a single struct assignment and a capability added later cannot
> be left out of the copy. The maximum TX ring size, which comes from the
> ethtool ring parameters that a shadow does not mirror, is copied there
> too. ifobj_has_cap() and ifobj_set_cap() test and set the flags, and
> xsk_get_cap() reads a limit from the TX ifobject, the only one that has
> all of them set, as the open-coded reads did.
>
> The unaligned UMEM check now looks at the RX ifobject only: the flag
> comes from a huge page probe that does not depend on the interface, and
> test_spec_set_unaligned() switches both UMEMs together.
>
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> ---
> .../testing/selftests/net/lib/xsk/test_xsk.c | 84 +++++++++++--------
> .../testing/selftests/net/lib/xsk/test_xsk.h | 34 ++++++--
> .../selftests/net/lib/xsk/xskxceiver.c | 13 +--
> 3 files changed, 81 insertions(+), 50 deletions(-)
[...]
> diff --git a/tools/testing/selftests/net/lib/xsk/test_xsk.h b/tools/testing/selftests/net/lib/xsk/test_xsk.h
> index 0717d855e4df..1d17e214db91 100644
> --- a/tools/testing/selftests/net/lib/xsk/test_xsk.h
> +++ b/tools/testing/selftests/net/lib/xsk/test_xsk.h
> @@ -144,11 +155,20 @@ struct ifobject {
> bool use_fill_ring;
> bool release_rx;
> bool use_metadata;
> - bool unaligned_supp;
> - bool multi_buff_supp;
> - bool multi_buff_zc_supp;
> - bool hw_ring_size_supp;
> };
> +
> +static inline bool ifobj_has_cap(const struct ifobject *ifobj, u32 cap)
> +{
> + return ifobj && (ifobj->caps.flags & cap);
> +}
> +
> +static inline void ifobj_set_cap(struct ifobject *ifobj, u32 cap)
> +{
> + ifobj->caps.flags |= cap;
> +}
> +
> +#define xsk_get_cap(test, cap) ((test)->ifobj_tx->caps.cap)
nit, and iff respin: I'd leave the whole inlining out. Keep it simple.
Also, please functions instead of macros.
Reviewed-by: Björn Töpel <bjorn@kernel.org>
next prev parent reply other threads:[~2026-10-15 8:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 18:45 [PATCH v3 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-14 18:45 ` [PATCH v3 net-next 01/15] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-15 8:14 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 02/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-10-15 8:15 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 03/15] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-15 8:17 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 04/15] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-15 8:18 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 05/15] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-15 8:20 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-15 8:22 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 07/15] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-15 8:27 ` Björn Töpel [this message]
2026-10-14 18:45 ` [PATCH v3 net-next 08/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-15 8:29 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 09/15] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-15 8:34 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 10/15] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-15 9:04 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 11/15] selftests: xsk: add a hardware mode to xskxceiver Maciej Fijalkowski
2026-10-15 9:42 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 12/15] selftests: xsk: pass non-test traffic to the stack in hardware mode Maciej Fijalkowski
2026-10-15 10:05 ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 13/15] selftests: xsk: list the hardware test cases Maciej Fijalkowski
2026-10-14 18:45 ` [PATCH v3 net-next 14/15] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-14 18:45 ` [PATCH v3 net-next 15/15] selftests: xsk: document generic and hardware endpoint runs 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=87fqy774he.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