Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: maciej.fijalkowski@intel.com
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	magnus.karlsson@intel.com, stfomichev@gmail.com, kuba@kernel.org,
	pabeni@redhat.com, tushar.vyavahare@intel.com,
	kerneljasonxing@gmail.com, bjorn@kernel.org
Subject: Re: [PATCH v4 net-next 12/15] selftests: xsk: prepare xskxceiver for endpoints on two hosts
Date: Tue, 20 Oct 2026 19:30:29 +0000	[thread overview]
Message-ID: <179252462905.3135.16990828336786085778@kernel.org> (raw)
In-Reply-To: <20261016174338.787135-13-maciej.fijalkowski@intel.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] parse_command_line() does not fully validate the new numeric
  options.
- [Low] In the adjust-tail cases, RX can decide to skip only after the
  traffic has run: testapp_validate_rx_endpoint() clears…

--

selftests: xsk: prepare xskxceiver for endpoints on two hosts

This prepares xskxceiver to run a case with its two endpoints on two
hosts. It adds --queue, --max-frags and --timeout options, a SKIP message
on the control channel, and a wait for the link to come up once the
endpoints are in sync. It also changes the default case MTU to
ETH_DATA_LEN and restores the original MTU in cleanup_iface().

> diff --git a/tools/testing/selftests/net/lib/xsk/xsk_peer.c b/tools/testing/selftests/net/lib/xsk/xsk_peer.c
> index e3e353d6abd95..256e63196f923 100644
> --- a/tools/testing/selftests/net/lib/xsk/xsk_peer.c
> +++ b/tools/testing/selftests/net/lib/xsk/xsk_peer.c

[ ... ]

> @@ -162,6 +179,30 @@ void xsk_peer_abort(struct xsk_peer *peer)
>  		peer_send(peer, XSK_PEER_ABORT, 0);
>  }
>  
> +/*
> + * Tell the peer that this endpoint skips the case, so that it skips too.
> + * Closing with unread data, or getting data once closed, resets the
> + * connection and drops the SKIP if the peer has yet to acknowledge it, as
> + * when a NIC reset holds the link down. So read until the peer closes.
> + */
> +void xsk_peer_skip(struct xsk_peer *peer, int timeout_ms)

[Severity: Low]
Is "so that it skips too" accurate for the adjust-tail cases?

In those cases the RX endpoint decides to skip only after the traffic has
run. testapp_validate_rx_endpoint() clears the support flag:

    if (!is_adjust_tail_supported(ifobject->xdp_progs)) {
        test->adjust_tail_support = false;
        return TEST_PASS;
    }

and then testapp_adjust_tail() returns TEST_SKIP:

    if (!test->adjust_tail_support) {
        ...
        return TEST_SKIP;
    }

By that point the TX endpoint has usually finished with TEST_PASS. It
never sees the SKIP, so it does not skip.

The final verdict still comes out right, because xsk.py later in the
series reports a pass plus a skip as a skipped case. Could the comment
say that the peer either skips or passes?

[ ... ]

> diff --git a/tools/testing/selftests/net/lib/xsk/xskxceiver.c b/tools/testing/selftests/net/lib/xsk/xskxceiver.c
> index 9704702f60fc9..56ea5ac6a3c63 100644
> --- a/tools/testing/selftests/net/lib/xsk/xskxceiver.c
> +++ b/tools/testing/selftests/net/lib/xsk/xskxceiver.c

[ ... ]

> @@ -328,6 +302,18 @@ static void parse_command_line(struct ifobject *ifobj_tx, struct ifobject *ifobj
>  		case OPT_UDP_PORT:
>  			opt_udp_port = strtoul(optarg, NULL, 10);
>  			break;
> +		case OPT_QUEUE:
> +			opt_queue = strtoul(optarg, NULL, 10);
> +			break;
> +		case OPT_MAX_FRAGS:
> +			/* It sizes the packet array of TOO_MANY_FRAGS. */
> +			opt_max_frags = strtoul(optarg, NULL, 10);
> +			if (opt_max_frags > 0xffff)
> +				print_usage(argv);
> +			break;
> +		case OPT_TIMEOUT:
> +			opt_timeout = strtoul(optarg, NULL, 10);
> +			break;

[Severity: Low]
Should --timeout and --max-frags get a full range check here?

strtoul() returns an unsigned long, and the result is truncated to u32
before the > 0xffff check. A --max-frags value of 2^32 or more can
therefore pass the check.

--timeout accepts any u32, including 0. Later the value is multiplied by
1000 in u32 and passed on as an int:

    wait_link_up()
        err = xsk_wait_link_up(ifobj->ifname, thread_tmout * 1000);

    main()
        xsk_peer_skip(peer, opt_timeout * 1000);

A timeout of 2147484 seconds or more, or a negative string (which
strtoul() wraps), gives a negative timeout_ms. With a negative
timeout_ms, the poll() in xsk_peer_skip() blocks with no limit.

In this series, xsk.py checks --max-frags and --timeout against 1-0xffff
before passing them on. So this only happens when xskxceiver is run by
hand.

Could xskxceiver reject these out-of-range values itself, as it already
does for the --max-frags upper bound?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016174338.787135-1-maciej.fijalkowski%40intel.com

  reply	other threads:[~2026-10-20 19:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 17:43 [PATCH v4 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 01/15] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 02/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 03/15] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 04/15] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 05/15] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 07/15] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 08/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 09/15] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 10/15] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 11/15] selftests: xsk: send UDP over IPv4 or IPv6 between the interface MACs Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 12/15] selftests: xsk: prepare xskxceiver for endpoints on two hosts Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko [this message]
2026-10-16 17:43 ` [PATCH v4 net-next 13/15] selftests: xsk: list the hardware test cases Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 14/15] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-20 19:30   ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 15/15] selftests: xsk: document generic and hardware endpoint runs Maciej Fijalkowski
2026-10-18 19:20 ` [PATCH v4 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Björn Töpel

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=179252462905.3135.16990828336786085778@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=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