BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Julius Bairaktaris" <julius@bairaktaris.de>
Cc: linux-rdma@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/2] selftests: net: check TCP IP IDs across tunnels after GRO and GSO
Date: Sat, 05 Dec 2026 22:45:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-251970@kernel.org> (raw)
In-Reply-To: <6580073c5293d9335859765d104213f255c64222.1796423663.git.julius@bairaktaris.de>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] selftests: net: tcp_fixedid.sh log_test_skip() calls omit skip
  reasons
- [Low] selftests: net: tcp_fixedid main() misorders AF_PACKET ETH_P_ALL
  bind()
--

commit 21a7a0a4ebf6a70ecb61c1ce948c930ffa3b36d6
Author: Julius Bairaktaris <julius@bairaktaris.de>

selftests: net: check TCP IP IDs across tunnels after GRO and GSO

This commit adds a networking selftest (tcp_fixedid.c and tcp_fixedid.sh)
that sends TCP segments with fixed or incrementing IPv4 IDs through GRO
and software GSO across IPIP, GRE, VXLAN, 6in4, and netdevsim-offloaded
ESP tunnels and verifies the resulting inner and outer IPv4 IDs.

> diff --git a/tools/testing/selftests/net/tcp_fixedid.c b/tools/testing/selftests/net/tcp_fixedid.c
> new file mode 100644
> index 0000000000000..6013d4606de7b
> --- /dev/null
> +++ b/tools/testing/selftests/net/tcp_fixedid.c

[ ... ]

> +	fd = socket(AF_PACKET, SOCK_RAW, htons(tx ? 0 : ETH_P_ALL));
> +	if (fd < 0)
> +		error(1, errno, "socket");
> +	sll.sll_family = AF_PACKET;
> +	sll.sll_protocol = htons(ETH_P_ALL);
> +	sll.sll_ifindex = if_nametoindex(ifname);
> +	if (!sll.sll_ifindex)
> +		error(1, errno, "%s", ifname);
> +	if (rx)
> +		rx_setup(fd);
> +	if (bind(fd, (struct sockaddr *)&sll, sizeof(sll)))
> +		error(1, errno, "bind");

[Severity: Low]
Does setting sll.sll_protocol to htons(ETH_P_ALL) and calling bind()
unconditionally defeat passing protocol 0 to socket() in TX mode?

In packet_do_bind(), the non-zero sll_protocol registers an ETH_P_ALL
receive hook on ifname for TX sockets as well, queuing unrelated ingress
frames into the unread receive queue until close() and invoking
dev_queue_xmit_nit() on every sent frame.

In RX mode, passing ETH_P_ALL to socket() before rx_setup() and bind()
also opens a brief wildcard receive window across all interfaces before
PACKET_IGNORE_OUTGOING and bind() restrict the socket.  Because
packet_set_ring() re-registers that active wildcard hook and tp_drops is
not cleared on bind(), an oversized frame or drop on another interface
during setup can cause a spurious failure in do_rx().

Opening the socket with protocol 0 in both modes, running rx_setup(), and
calling bind() with htons(ETH_P_ALL) only in RX mode avoids both issues.

> diff --git a/tools/testing/selftests/net/tcp_fixedid.sh b/tools/testing/selftests/net/tcp_fixedid.sh
> new file mode 100755
> index 0000000000000..3d30459747196
> --- /dev/null
> +++ b/tools/testing/selftests/net/tcp_fixedid.sh

[ ... ]

> +run_encap() {
> +	local type=$1 family=$2 want=$3
> +	local r0mac t0 laddr=10.2.0.1 raddr=10.2.0.2
> +	local f=""
> +
> +	setup || { log_test_skip "encap $type IPv$family"; return; }
> +	if [ "$family" = 6 ]; then
> +		laddr=fd02::1
> +		raddr=fd02::2
> +	fi
> +	if ! tunnel "$NRTR" tun0 "$type" "$family" "$laddr" "$raddr"; then
> +		log_test_skip "encap $type IPv$family"

[Severity: Low]
Should these log_test_skip() calls include the reason for skipping (such
as setup or tunnel creation failure), as the later skips in run_esp() do?

log_test_skip() in lib.sh clears retmsg and prints only its arguments, so
a skipped subtest gives no indication of which prerequisite was missing.
The same applies to the setup and link creation skips in run_decap(),
run_encap_decap(), run_6in4(), and run_esp().

In addition, run_encap(), run_decap(), and run_6in4() omit their variant
($want, $fixed, and $outer) from these skip labels, producing identical
skip lines for distinct subtests.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796423662.git.julius@bairaktaris.de?part=2

      reply	other threads:[~2026-12-05 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 22:45 [PATCH net-next v5 0/2] net: keep the TCP fixed-ID flags on the header they describe Julius Bairaktaris
2026-12-04 22:45 ` [PATCH net-next v5 1/2] " Julius Bairaktaris
2026-12-05 22:45   ` sashiko-bot
2026-12-04 22:45 ` [PATCH net-next v5 2/2] selftests: net: check TCP IP IDs across tunnels after GRO and GSO Julius Bairaktaris
2026-12-05 22:45   ` sashiko-bot [this message]

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=sashiko-outbox-251970@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=julius@bairaktaris.de \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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