OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 v4 0/3] selftests/bpf: run the xsk veth tests in a network namespace of their own
@ 2026-10-27 18:15 Konstantin Khorenko
  2026-10-27 18:15 ` [Devel] [PATCH hci-8.1 v4 1/3] selftests/bpf: xsk: exit with the status test_exit() is given Konstantin Khorenko
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Konstantin Khorenko @ 2026-10-27 18:15 UTC (permalink / raw)
  To: Konstantin Khorenko, devel

Patchset for task https://virtuozzo.atlassian.net/browse/VSTOR-150731

test_xsk.sh makes its veth pair in the host's namespace. The host's own
traffic on the pair reaches the AF_XDP sockets under test, so the tests
fail on a configured host and pass on a bare one. The series moves the
veth part into a namespace of its own, after two fixes it relies on:

- Patch 1: test_exit() exits 1 for a skip, so the runner counts every
  "skip all tests" as a failure.
- Patch 2: xskxceiver takes the fragment limit from the max_skb_frags
  sysctl, which AF_XDP does not check and which exists in the initial
  namespace only. Take MAX_SKB_FRAGS from the kernel's BTF.
- Patch 3: the namespace itself.

Assisted-by: LLM
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Changes in v4:
- Split v3 into three patches. The test_exit() fix gets a Fixes: tag;
  mainline gets the same fix (VSTOR-151679), and a commit of its own
  here can later be replaced by the ms/ one.
- Patch 3: drop "mount --make-rprivate /", unshare --mount already
  makes the new mount namespace private.
- Messages: the sysctl fallback serves kernels without BTF only, it
  cannot work inside the namespace; the "as before" claim is gone.
- Link to v3: http://lore.virtuozzo.com/20261026012309.458048-1-eva.kurchatova@virtuozzo.com

Changes in v3:
- The namespace is unnamed, so it goes with its last process however
  the run ends, Ctrl-C, a timeout or a kill, and no outer run is left
  to delete host interfaces.
- Obtain max_skb_frags from the kernel BTF, removing -f option.
- Fix test_exit() exit status for skipped runs.
- With -d, the namespace is kept.
- Rebased.
- Link to v2: http://lore.virtuozzo.com/kernel/20261022024816.2435565-1-eva.kurchatova@virtuozzo.com/T/#t

Changes in v2:
- -f is checked as the sysctl is, 1 to 45 and digits only, so a value
  that would wrap the fragment count or the packet array is refused.
- -f goes into the namespace only when the host's sysctl file could be
  read; a bare -f made getopts complain.
- No network namespace skips the tests, as no veth support does, rather
  than failing them.
- The -f description says the option tells the tests the kernel's limit
  and changes nothing in the kernel.
- The -d hint names the namespace in a usable form.
- test_exit() exits 1 for a skip as it does for the veth one; as the
  script has it.
- Link to v1: http://lore.virtuozzo.com/kernel/20261020041218.1659392-1-eva.kurchatova@virtuozzo.com/T/#t

---
Eva Kurchatova (3):
      selftests/bpf: xsk: exit with the status test_exit() is given
      selftests/bpf: xsk: take the fragment limit from the kernel's BTF
      selftests/bpf: run the xsk veth tests in a network namespace of their own

 tools/testing/selftests/bpf/test_xsk.sh    | 30 +++++++++++++++++++++--
 tools/testing/selftests/bpf/xsk_prereqs.sh |  2 +-
 tools/testing/selftests/bpf/xskxceiver.c   | 39 +++++++++++++++++++++++++++++-
 3 files changed, 67 insertions(+), 4 deletions(-)
---
base-commit: 02401c5e378f282fbf11bdc65996253ff65dad9b
change-id: 20261027-b4-prep-khorenko-vstor-150731-xsk-veth-netns-d97e81caa801

Best regards,
--  
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-29 14:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 18:15 [Devel] [PATCH hci-8.1 v4 0/3] selftests/bpf: run the xsk veth tests in a network namespace of their own Konstantin Khorenko
2026-10-27 18:15 ` [Devel] [PATCH hci-8.1 v4 1/3] selftests/bpf: xsk: exit with the status test_exit() is given Konstantin Khorenko
2026-10-27 18:15 ` [Devel] [PATCH hci-8.1 v4 2/3] selftests/bpf: xsk: take the fragment limit from the kernel's BTF Konstantin Khorenko
2026-10-27 18:15 ` [Devel] [PATCH hci-8.1 v4 3/3] selftests/bpf: run the xsk veth tests in a network namespace of their own Konstantin Khorenko
2026-10-27 18:50 ` [Devel] [PATCH hci-8.1 v4 0/3] " Eva Kurchatova (Virtuozzo)
2026-10-29 13:59 ` Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox