Article View: linux.kernel.netdev
Article #17327Re: [PATCH net v9 4/4] selftests: net: hsr: verify GRO policy and ordered forwarding
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 16:27
Date: Mon, 16 Nov 2026 16:27
195 lines
15982 bytes
15982 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 3
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In tcp_prp(), the check for 'no tag/RCT on local delivery' can
never fail.
- [Low] The commit message overstates what the second refusal group in
port_types() checks…
- [Low] In tcp_prp(), a Skip raised by verify_stream() bypasses the PRP
reply checks.
- [Low] Lab.close() closes every owned socket (lines 367-368) before it
joins the producer threads (lines 369-373).
--
selftests: net: hsr: verify GRO policy and ordered forwarding
This adds two HSR/PRP selftests, hsr_gro_superpacket.sh and
hsr_ordered_forwarding.sh. Both exec one shared Python helper. The gro
mode checks the member GRO policy, the refusal of unsupported port
types, and byte-exact TCP forwarding over an HSR interlink and over PRP
LANs. The ordered mode checks sequence ordering of local, interlink,
supervision and concurrent traffic, including a sequence wrap.
> diff --git a/tools/testing/selftests/net/hsr/hsr_gro_superpacket.py b/tools/testing/selftests/net/hsr/hsr_gro_superpacket.py
> new file mode 100755
> index 0000000000000..3548ee0adfae3
> --- /dev/null
> +++ b/tools/testing/selftests/net/hsr/hsr_gro_superpacket.py
> @@ -0,0 +1,1456 @@
[ ... ]
> + def close(self):
> + """Stop threads, close sockets and delete owned namespaces."""
> + self.stop.set()
> + end, errors = time.monotonic() + 20, []
> + for sock in self.sockets:
> + sock.close()
> + for thread in self.threads:
> + if thread.ident is not None:
> + thread.join(max(0, end - time.monotonic()))
> + if thread.is_alive():
> + errors.append("sender thread did not stop")
[Severity: Low]
This isn't a bug, but the docstring says "Stop threads, close sockets".
Lab.close() closes the sockets before it joins the producer threads
started by ordered_concurrent().
If a producer is still running here, its sendto() on the closed socket
gets EBADF. Its except (OSError, ValueError, RuntimeError) clause
catches that. The 1 second timeout from ordered_socket() and the
lab.stop check limit how long it can run. The main thread opens no new
fds until the join returns, so fd reuse does not look possible.
Would joining the threads before closing the sockets match the docstring
order?
[ ... ]
> + # A refused second port leaves the first port as it was.
> + for dev in ("w", "g"):
> + local_pair(lab, ns, dev)
> + set_gro(lab, ns, "p", "on")
> + set_gro(lab, ns, "g", "on")
> + first, second = link_state(lab, ns, "p"), []
[ ... ]
> + for kind, dev, error in second:
> + label = f"{kind} as slave2"
> + result = lab.ip(ns, "link", "add", "name", "hsr0", "type", "hsr",
> + "slave1", "p", "slave2", dev, "version", "1", check=False)
> + require(result.returncode != 0 and error in result.stderr,
> + f"{label}: missing refusal message: {result.stderr.strip()}")
> + require(lab.ip(ns, "link", "show", "dev", "hsr0", check=False).returncode,
> + label + ": HSR device left behind")
> + after = link_state(lab, ns, "p")
> + require("master" not in after and after["promiscuity"] == first["promiscuity"],
> + f"{label}: first port p changed by the refused attach")
> + gro_state(lab, ns, "p", "on", label + ": first port p")
> + refused.append(label)
[Severity: Low]
Does this second refusal group in port_types() check what the commit
message describes? The message says:
... and of a VRF port without leaving an upper link or a promiscuity
reference on any port ...
and:
... a device refused at attach keeps its request.
Only p is snapshotted here (first = link_state(lab, ns, "p")), and only
p is compared after each refused attach. The refused VRF port w and the
macvlan mvg have no baseline. Their promiscuity is never compared, and
the GRO state of mvg is never read back.
The first refusal group snapshots every candidate device in before and
checks each one again, so the two groups do not match. A leaked
promiscuity reference on w or mvg would still pass this case.
Should w and mvg also go into the before/after comparison?
[ ... ]
> +def tcp_prp(lab, row):
> + """TCP GSO from a SAN on one PRP LAN is delivered locally, segmented."""
[ ... ]
> + lab.cmd(tx, "ethtool", "-K", lower, "tso", "on", "gso", "on")
> + caps = [lab.capture(tx, lower, pkttype=4), lab.capture(dut, "pm", pkttype=0)]
[Severity: Medium]
Can the check for no tag/RCT on local delivery ever fail for this
capture?
The pm capture is opened with the default prp=False. decode() only
recognises a PRP RCT when prp is set:
elif prp and end >= off + 6 and raw[-2:] == b"\x88\xfb":
So every frame captured on pm decodes with tag=False and
encoding="plain". The TCP payload ends at the IPv4 total length, so 6
trailing RCT bytes are silently ignored.
verify_stream(..., local=True) then calls:
wire_rows(captures[1].rows, port, stack, tagged=False)
and this check in wire_rows() is always true here:
require(row["tag"] == tagged, "flow tag/RCT missing or unexpected")
The size limit does not catch it either. A 1514 byte segment plus a 6
byte RCT is exactly 1520, which passes
row["size"] <= 1520 + 4 * len(stack).
Suppose the PRP master delivered frames locally with the RCT still
attached. The IP stack would trim the trailer and TCP would still
complete, so this case would pass. The commit message says "Tags/RCT,
sequence numbers and VLAN stacks are checked".
Would opening the pm capture with prp=True make this check effective?
> + ingress = lab.capture(dut, "d" + side.lower(), prp=True)
> + lanes = [lab.capture(dut, dev, pkttype=4, prp=True) for dev in ("da", "db")]
> + payload, reply = tcp_transfer(lab, tx, dut, sender, "10.68.0.2", "10.68.0.1", 5201)
> + lab.finish(fin_seen(caps + lanes + [ingress], 5201))
> + verify_stream(caps, 5201, payload, stack, local=True, inband=inband, ingress=ingress)
[Severity: Low]
What happens to the PRP reply checks below when verify_stream() raises
Skip? verify_stream() ends with:
if not aggregate:
raise Skip("no sender GSO aggregate observed")
The comment above it says this gap is reported only "after transfer and
all other checks". In tcp_prp(), though, the reply checks run only after
verify_stream() returns: exactly once per LAN, RCT present, LAN id
10 + index, encoding "prp", identical copies. Nothing here catches
Skip, so main() prints "ok N - ... # SKIP".
When the sender capture shows no payload larger than 1500 bytes, a
missing, duplicated or wrongly tagged PRP reply would be reported as
SKIP, not FAIL. This seems to contradict "its reply must appear once on
each LAN" in the commit message.
Could the Skip be held back until the reply checks in tcp_prp() have
run?
> + copies = []
> + for index, cap in enumerate(lanes):
> + cap.validate()
> + rows = [frame for frame in cap.rows if frame["ports"] and
> + frame["ports"][0] == 5201 and frame["payload"]]
> + require(len(rows) == 1 and rows[0]["payload"] == reply,
> + "PRP reply not exactly once per LAN")
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112153333.20-1-xiexinet%40gmail.com
Technical Details
Message-ID:
<179484644688.3136.15525954898173827248@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364550-linux-kernel-netdev=dewy.ruReferences:
<20261112153333.20-5-xiexinet@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364550-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v9 4/4] selftests: net: hsr: verify GRO policy and ordered forwarding Date: Mon, 16 Nov 2026 16:27:26 +0000 Organization: Usenet Network Message-ID: <179484644688.3136.15525954898173827248@kernel.org> References: <20261112153333.20-5-xiexinet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2110580"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:5OUoG1ll6idYh5SuJIPFDx/BFkM= sha256:Wl/LQ62f9PLSuFJJuximloK/pPtWb26nmx/hjvzIQoA= sha1:Hz5wxIz03pEDAt0/wLkT3RBG3GQ= sha256:OPDdR8lEAa9Oaz0iCgUcyafH4pb+M9CGZ+dvv6aTVUw= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id F3081114CDF; Mon, 16 Nov 2026 19:27:51 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SUtHjUd4PEDK; Mon, 16 Nov 2026 19:27:48 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364550-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C7FD5114CCA; Mon, 16 Nov 2026 19:27:39 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 2E0EB2D6E8; Mon, 16 Nov 2026 16:27:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794846451; b=aopwvPRAb4OoD/HIQ//JEAHOUeZaoJFnkdqS4+GbX4GBxHh1Abg8Kp8N74dZvsl0g6kx Y1NvvpV8gAfmpJojeH8eTX4HEsYmdLqq/8Ad44bq/WR0JwGt757mRvJZwEx4rZATMwccZ GhwhhbQrA+gS5GoGEAzA+sW0HNPx79mNyaMi4VozKVWrRR0SAhKOI2wx4M+Jh0VMh8xCs gO/f9V08Doj1yLxwJ9DuLtje8nnGRfzofesTaluv7bngce7ZvL2f5hirbhUpdzlVQynio iRZDjor+kl2bgmkkyE4g5YtPElmYlXfCun8sP4I3eRCdetuwjLUn2qCx6b4AFfH+Jjw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794846451; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=nV9c2MLNlihsCA7BTpRORTeWE46Uw4LSE6nUB+YU+40=; b=t6p2DpTZKTdGBY9jLN4NJrtg2C1t0lDTWcgwhZ5/p3klJCLxeSdO5U9aGQ110jAFIDK8 fo/ZZK80GRITys6AQZ7v6gyDrtGbB6K5VitSgLDE1lTjBfW0zchYf7+HNtlcomTdS0Toc tpfmdo/3p+bQr3KzWIYZXEXL2LuRCd/eQEFXnx/3sxWhksegGPM/XPysCfIwKSHtE15Hw vAzD4HvD7lBJbHmttvI6wpy7z9kGyyOEeERHrUktQT6r0EoHSa77sOygVxzfxknZXwIKi xgM/wAiLZLL9Wq4WPfTOf//dGfck1IM1P7H5BH6r+Q16lR6ZObGowWIb1ge64/hB4ug== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EvdLpzCv; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34308606A33B; Mon, 16 Nov 2026 16:27:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EvdLpzCv X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794846449; b=KelDVbuzHshosJLzFO9JkgyBL9lrJ9zH2Yn9xk2E6tsho3d/IL3IOoebfL1rKHjnJgoE lr9h+fnxMaZMrn2FSr+UAx9Tub9EAu/0y0b5DnwK1d1EiZBJEg2Q9ACCXHOTMZMY5YQ1I 9F6sb9wk4RR85evZ1NZQWuZtgWWQbqQD6DbYVABHbPUB5HEpcRQyalv1tJfoT77M292o0 hcQ2phlCcPYBAdhMTC5WBef9+kmocoBQReo8fxTI5ldDT8SDFVQ7xebzcZIyURR7UbiLh RKY03TiwTr+gbfrRBwL2y6WS3/5RAZ/h6aLr1kfABOCxww8bh0J3r96bauD6iG70ScA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794846449; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=nV9c2MLNlihsCA7BTpRORTeWE46Uw4LSE6nUB+YU+40=; b=JgVedYGJiiPiKI5qzZeDeCtOieLg+If04nh92ReQpGCtPEH1JBe3OaH4bdfzQUbquw6l ilMBRluNHoVxJkpOhRGVUrMUjS8z7Imf3Feakj0E3I8Go2O3ROXPHUrnv7R54ClrS/2YG VcEHUPa4af3MnHv5OAGRUwyKxKKCUbIh6k/HTOoXqTicwgOVkokNa53HS66MhMTGN6B92 v6XMI06nLRkehC94MNd3bVq0BEx973KspYYESIrVmOwm8yYxrZ1mNHevg8NRjcBG5QngC cA4xpHXujvF6cVKPCtXZ10E7EmqOZ06h1Yj9mLcu1MVA5HdU3IQDU8aQEt9itGMtn/Q== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EvdLpzCv; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26EB4606A32C; Mon, 16 Nov 2026 16:27:28 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 530861F000D0; Mon, 16 Nov 2026 16:27:27 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794846448; bh=nV9c2MLNlihsCA7BTpRORTeWE46Uw4LSE6nUB+YU+40=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=EvdLpzCvDmBIPhUdLLEYg/bg/X09XK9EzfDBSHVn6+fs1+9GupPKWuockBAB/U11/ rXZ7Xw2eVeUa/QZ8lcKySQShRZgO5zA7Gopx3Y9Ws9KukNTgUklisww4m3STxOg57f F/ouZZg6ycw8Sw7KvtJrJgnWRZEAPjrgpmxQSI9sdeYpr+aytHp+C+dCVOTBEicR4Q ej0laSiZVDd8thLnM4G4AdXsHlzzqRKDjRre32y8xVEemlvsiXxVyuF5iXWB6i5ddJ dwdlIONRiJvpVQsdgWXi1G9MJxHSMVy/35MQMSnRHqUtIcQbiBFlYpm0lwgkHVe1d2 kK6YvMYwy6WQg== X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, andrew+netdev@lunn.ch, shuah@kernel.org, kees@kernel.org, petr.wozniak@gmail.com, qingfang.deng@linux.dev, fmaurer@redhat.com, luka.gejak@linux.dev, bigeasy@linutronix.de, xiaoliang.yang_1@nxp.com, skhawaja@google.com, liuhangbin@gmail.com, stable@vger.kernel.org, sdf.kernel@gmail.com, lukma@denx.de, fmancera@suse.de, danishanwar@ti.com X-In-Reply-To: <20261112153333.20-5-xiexinet@gmail.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list