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: 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 v5 net-next 08/13] selftests: xsk: send UDP over IPv4 or IPv6 between the interface MACs
Date: Mon, 23 Nov 2026 20:08:50 +0100	[thread overview]
Message-ID: <87y0ajpdq5.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20261119164636.1071385-9-maciej.fijalkowski@intel.com>

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

> xskxceiver sends frames of the loopback ethertype between made-up MAC
> addresses, and its XDP programs redirect every frame to the XSKMAP.
> That suits a veth pair that carries nothing else, but not a physical
> link, where the peer NIC filters out the made-up addresses and the
> programs take neighbour discovery, LLDP or SSH away from the stack.
>
> Send the test packets as UDP between the MAC addresses of the two
> interfaces on any link. Each endpoint takes the IPv4 or IPv6 addresses
> of the flow (--src-ip, --dst-ip), the MAC address of its peer
> (--dst-mac) and the UDP port (--udp-port), and reads its own MAC
> address from the interface. Over IPv4 the UDP checksum is left at zero,
> as IPv4 allows; over IPv6 it is computed from the known payload.
> PKT_HDR_SIZE and MIN_PKT_SIZE now stand for variables that
> xsk_set_flow() sets, so the smallest packet grows with the headers to
> 64 bytes over IPv4 and 88 over IPv6, and a verbatim stream adds up the
> descriptors of a packet for its IP and UDP lengths.
>
> The XDP programs redirect only the UDP packets to the test port and
> pass everything else to the stack, all IPv4 fragments included. The port
> is written when a skeleton is loaded, so it also reaches the shadow
> endpoint's copy, whose programs the local side attaches once
> BIDIRECTIONAL swaps the directions. XDP_SHARED_UMEM picks the socket by
> the UDP source port, the test port plus the socket index, rather than by
> a made-up destination MAC, and xsk_xdp_adjust_tail() numbers a grown
> tail after the UDP header.
>
> is_adjust_tail_supported() copied all of .bss into an int with
> bpf_map_lookup_elem(), past the end of the int even before the port
> grew .bss; read adjust_value through the skeleton instead.
> is_frag_valid() now rejects a fragment too short for the words it
> reads, and pkt_dump() prints only the words within the length it is
> given, which is_pkt_valid() gives as the first fragment's length.
> write_payload() zeroes the bytes after the last full word, which the
> IPv6 UDP checksum counts.
>
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Reviewed-by: Björn Töpel <bjorn@kernel.org>

  parent reply	other threads:[~2026-11-23 19:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 16:46 [PATCH v5 net-next 00/13] selftests: net: adjust xskxceiver to drv-net Maciej Fijalkowski
2026-11-19 16:46 ` [PATCH v5 net-next 01/13] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-11-19 16:46 ` [PATCH v5 net-next 02/13] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-19 16:46 ` [PATCH v5 net-next 03/13] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-11-19 16:46 ` [PATCH v5 net-next 04/13] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-11-19 16:46 ` [PATCH v5 net-next 05/13] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-19 16:46 ` [PATCH v5 net-next 06/13] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-19 16:46 ` [PATCH v5 net-next 07/13] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-19 16:46 ` [PATCH v5 net-next 08/13] selftests: xsk: send UDP over IPv4 or IPv6 between the interface MACs Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-23 19:08   ` Björn Töpel [this message]
2026-11-19 16:46 ` [PATCH v5 net-next 09/13] selftests: xsk: prepare xskxceiver for endpoints on two hosts Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-23 19:10   ` Björn Töpel
2026-11-19 16:46 ` [PATCH v5 net-next 10/13] selftests: xsk: list the endpoint roles of the test cases Maciej Fijalkowski
2026-11-23 19:12   ` Björn Töpel
2026-11-19 16:46 ` [PATCH v5 net-next 11/13] selftests: drv-net: decouple local link setup from netdevsim Maciej Fijalkowski
2026-11-23 19:12   ` Björn Töpel
2026-11-19 16:46 ` [PATCH v5 net-next 12/13] selftests: drv-net: run the AF_XDP tests over veth or a NIC Maciej Fijalkowski
2026-11-23 18:46   ` netdev-bot+sashiko
2026-11-19 16:46 ` [PATCH v5 net-next 13/13] 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=87y0ajpdq5.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@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