From: Jakub Kicinski <kuba@kernel.org>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
magnus.karlsson@intel.com, stfomichev@gmail.com,
pabeni@redhat.com, tushar.vyavahare@intel.com,
kerneljasonxing@gmail.com, bjorn@kernel.org
Subject: Re: [PATCH v2 net-next 13/14] selftests: drv-net: test AF_XDP zero-copy with an SKB peer
Date: Thu, 8 Oct 2026 14:37:10 -0700 [thread overview]
Message-ID: <20261008143710.02cfcbf8@kernel.org> (raw)
In-Reply-To: <20261008114909.734364-14-maciej.fijalkowski@intel.com>
On Thu, 8 Oct 2026 13:49:08 +0200 Maciej Fijalkowski wrote:
> +XSK_BIN = (Path(__file__).parent / "../../../net/lib/xskxceiver").resolve()
cfg.test_dir ? Please don't reinvent the wheel
> +XSK_CASES = XSK_BIN.parent / "xsk/test_xsk_case_defs.h"
> +def _hardware_cases():
> + defs = XSK_CASES.read_text()
> + entries = re.findall(r"(?m)^XSK_TEST_CASE\((\w+),\s*\w+,\s*([^)]+)\)", defs)
> + if not entries or len(entries) != defs.count("XSK_TEST_CASE("):
> + raise KsftFailEx(f"cannot parse {XSK_CASES}")
> + variants = []
> + for test_id, (name, hw) in enumerate(entries):
> + flags = {flag.strip() for flag in hw.split("|")}
> + if not flags <= {"0", "XSK_HW_RX", "XSK_HW_TX"}:
> + raise KsftFailEx(f"invalid hardware directions for {name}: {hw}")
> + variants += [KsftNamedVariant(f"{d}_{name.lower()}", name, d, test_id)
> + for d in ("rx", "tx") if f"XSK_HW_{d.upper()}" in flags]
> + return variants
?? Just list them, don't over optimize for de-duplication
it's obviously all LLM generated now.
> +def _netns_remote(cfg):
> + return cfg.env.get("REMOTE_TYPE") == "netns"
You shouldn't have to care, please don't break the abstractions
> +def _control_addr(cfg):
> + """An SSH remote is reached over its management link. A netns remote is
> + reached only over the tested link, where the XDP programs pass the
> + control connection to the stack."""
> + if _netns_remote(cfg):
> + return cfg.remote_addr_v["4"]
> + return cfg.remote.name.rpartition("@")[2]
Suspicious? Not sure why you need this. No existing test does
something like this
> +def _root_cmd(command, host=None, sudo=False, **kwargs):
> + if sudo:
> + command = "sudo -n " + command
> + return cmd(command, host=host, **kwargs)
No hacks like this please, all networking tests can assume root
> +def _remote_binary(cfg, local_binary):
> + binary = cfg.env.get("XSK_REMOTE_BIN")
Why this variable? Just assume the binary in tree is the one we need?
> + if not binary:
> + return cfg.remote.deploy(local_binary)
> + if cfg.env.get("REMOTE_TYPE") != "ssh":
> + raise KsftSkipEx("XSK_REMOTE_BIN requires the SSH remote backend")
> + if cfg.env.get("XSK_REMOTE_DEPLOY", "1") == "0":
> + result = cmd(f"test -x {shlex.quote(binary)}", host=cfg.remote,
> + fail=False)
> + if result.ret:
> + raise KsftSkipEx(f"remote xskxceiver is not executable: {binary}")
> + return binary
> + upload = binary + ".upload"
> + cmd(["scp", "-q", str(local_binary), f"{cfg.remote.name}:{upload}"],
> + shell=False)
> + cmd(f"mv -f {shlex.quote(upload)} {shlex.quote(binary)}",
> + host=cfg.remote)
Why any of these hacks/complexity? I think you need a better LLM and
point it at the existing tests. Weird stuff going on here :(
next prev parent reply other threads:[~2026-10-08 21:37 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
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 [this message]
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=20261008143710.02cfcbf8@kernel.org \
--to=kuba@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=kerneljasonxing@gmail.com \
--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