Skip to contentSkip to conversation

net: hsr: fix super-packet forwarding

PATCH In review Xin Xie 2 participants 13 messages Nov 17 – Nov 20

Subsystems (6)
lore
Share & tools
lore

Xin Xie

author
#0 lore raw

v10 cover net: hsr: fix super-packet forwarding

HSR and PRP tag, number and de-duplicate each frame on the wire. GRO and GSO can hand them one skb holding several frames, which the lower device then drops or which goes out with a single tag or RCT and sequence number.

Patch 1 keeps software GRO off on HSR/PRP ports. GRO_HW that the driver keeps on is left alone.

Patch 2 refuses bridge, bond, team and OVS masters as ports, a macvlan or MACsec device on top of a bridge, bond, team or HSR/PRP master, and devices that already have a master or cannot take an RX handler. This fixes the syzbot recursive seqnr_lock report, as Sebastian suggested [1].

A port check cannot catch every path back into an HSR master, such as a tc/BPF redirect or a tunnel; those still nest the lock and can deadlock on the same device. Fixing them without dropping traffic needs seqnr_lock released before the port transmit, which can reorder frames for receivers without aae9d6b616b5 ("hsr: Implement more robust duplicate discard for HSR"). That is left to net-next, where Hangbin's patch [2] fits. He dropped it in favor of this series [3]; as this series no longer narrows seqnr_lock, it can go ahead there.

Patch 3 segments GSO skbs before per-frame processing, outside seqnr_lock. GSO reaches an HSR/PRP port even with GRO off, typically from a container attached to a PRP RedBox interlink through veth:

  container/netns                  host PRP RedBox
  prp0-peer ---- veth ---- prp0-int (interlink RX)
                                  |
                           split GSO into frames
                                  |
                           sequence number + RCT
                              /          \
                           LAN A        LAN B

Some old Linux PRP senders put one RCT on a whole GSO skb; patch 3 drops such aggregates when it can detect them. With GRO_HW off on virtio-net, the host may segment them first and the RCT arrives as payload; upgrade the sender or disable GSO and TSO on its HSR/PRP master.

Patch 4 adds selftests.

Tested on a lockdep kernel: the new selftests (also with Python 3.9) and the existing hsr selftests pass, and the syzbot reproducer no longer reports recursive locking. No new W=1 warnings.

No stable backport is requested. The remaining HSR dev->stats races are left to a separate series, as Paolo suggested [4].

Based on net aa40afa831eb; also applies to net-next. Patch 3 conflicts with Sebastian's pending net-next series [5]; its notes give the resolution.

Changes since v9:
- Added Sebastian's Reviewed-by.
- Patch 1: the role clear in hsr_del_port() and the hsr_port bit moved, so that the series applies with the pending fix [6] and with the XDP series now in net-next [7]. Comment and message updated after the AI review [8].
- Patch 3: the segment loop uses skb_list_walk_safe(), as Sebastian suggested.
- Patch 4: three test checks tightened after the AI review [8].
- AI review [8], not changed: a tunnel routed back through its own HSR master (patch 2) is the existing deadlock described above, and the socket close order in the test helper is harmless.

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/
[3] https://lore.kernel.org/netdev/anXnxn-PBv8qH6VB@fedora/
[4] https://lore.kernel.org/netdev/[email protected]/
[5] https://lore.kernel.org/netdev/[email protected]/
[6] https://lore.kernel.org/netdev/[email protected]/
[7] https://lore.kernel.org/netdev/[email protected]/
[8] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/[email protected]

v9: https://lore.kernel.org/netdev/[email protected]/
v8: https://lore.kernel.org/netdev/[email protected]/
v7: https://lore.kernel.org/netdev/[email protected]/
v6: https://lore.kernel.org/netdev/[email protected]/
v5: https://lore.kernel.org/netdev/[email protected]/
v4: https://lore.kernel.org/netdev/[email protected]/
v3: https://lore.kernel.org/netdev/[email protected]/
v2: https://lore.kernel.org/netdev/[email protected]/
v1: https://lore.kernel.org/netdev/[email protected]/

Xin Xie (4):
net: hsr: keep GRO disabled on HSR/PRP ports
net: hsr: refuse forwarding devices as HSR/PRP ports
net: hsr: segment GSO before per-frame forwarding
selftests: net: hsr: verify GRO policy and ordered forwarding

 .../networking/net_cachelines/net_device.rst  |    1 +
 include/linux/netdevice.h                     |    8 +
 net/core/dev.c                                |   15 +
 net/hsr/hsr_device.c                          |   13 +-
 net/hsr/hsr_forward.c                         |  156 ++
 net/hsr/hsr_forward.h                         |    1 +
 net/hsr/hsr_slave.c                           |  145 +-
 net/hsr/hsr_slave.h                           |    2 +
 tools/testing/selftests/net/hsr/Makefile      |    7 +-
 tools/testing/selftests/net/hsr/config        |   10 +
 .../selftests/net/hsr/hsr_gro_superpacket.py  | 1468 +++++++++++++++++
 .../selftests/net/hsr/hsr_gro_superpacket.sh  |    9 +
 .../net/hsr/hsr_ordered_forwarding.sh         |    9 +
 13 files changed, 1829 insertions(+), 15 deletions(-)
 create mode 100755 tools/testing/selftests/net/hsr/hsr_gro_superpacket.py
 create mode 100755 tools/testing/selftests/net/hsr/hsr_gro_superpacket.sh
 create mode 100755 tools/testing/selftests/net/hsr/hsr_ordered_forwarding.sh

base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4

Signature · 1 line
2.53.0
author
#1 lore raw

PATCH v10 1/4 net: hsr: keep GRO disabled on HSR/PRP ports

HSR and PRP tag and de-duplicate each wire frame separately. GRO on a member device merges several frames into one skb that cannot get valid per-frame metadata, and userspace can turn GRO back on at any time.

Mark direct members (slave A/B, interlink) with a kernel role bit. While it is set, __netdev_update_features() drops software GRO and configurable GRO_HW from wanted_features as well as from the computed features, before ndo_fix_features(). GRO_HW that the driver keeps on is left alone. The request has to go too: veth adds and deletes its NAPI instances according to wanted_features, so with GRO still requested, closing an attached veth spins in napi_disable(), and detaching a veth that was attached while down and then brought up hits the BUG_ON() in napi_enable(). A GRO request on a member is dropped, not kept pending: while GRO stays off, the legacy ETHTOOL_SFEATURES ioctl returns no ETHTOOL_F_WISH for it, and the netlink reply still shows the request as not applied. As for LRO disabled by an upper device, GRO is not restored when the port leaves; ethtool can turn it back on.
The rule covers every direct member, PRP ports and ports with HSR offload included: one simple rule is preferred to per-port exceptions, at some cost in receive throughput.

The attach fails if software GRO stays active. A failed attach does not restore the GRO request either. The next patch checks all ports before any of them is changed, so only a failure at run time, for example a driver that cannot turn GRO off or the upper device nesting limit (-EMLINK), leaves a port with its GRO request dropped. GSO skbs can still arrive, for example from a stacked member whose lower device runs GRO; a later patch segments them.

Fixes 5055cccfc2d1 ("net: hsr: Provide RedBox support (HSR-SAN)")
---
 .../networking/net_cachelines/net_device.rst  |  1 +
 include/linux/netdevice.h                     |  8 +++
 net/core/dev.c                                | 15 ++++++
 net/hsr/hsr_slave.c                           | 54 +++++++++++++++++++
 4 files changed, 78 insertions(+)
Documentation/networking/net_cachelines/net_device.rst +1 -0
index 8eceaa80b686..a9a7a52c8a16 100644
@@ -166,6 +166,7 @@ struct lock_class_key*              qdisc_tx_busylock
 bool                                proto_down
 unsigned:1                          wol_enabled
 unsigned_long:1                     see_all_hwtstamp_requests
+unsigned_long:1                     hsr_port
 unsigned_long:1                     change_proto_down
 unsigned_long:1                     netns_immutable
 unsigned_long:1                     fcoe_mtu
include/linux/netdevice.h +8 -0
index 435be7880d7e..ad63f0540c64 100644
@@ -2107,6 +2107,7 @@ enum netdev_reg_state {
  *			ndo_hwtstamp_set() for all timestamp requests
  *			regardless of source, even if those aren't
  *			HWTSTAMP_SOURCE_NETDEV
+ *	@hsr_port:	direct HSR/PRP member (slave A/B or interlink)
  *	@change_proto_down: device supports setting carrier via IFLA_PROTO_DOWN
  *	@netns_immutable: interface can't change network namespaces
  *	@fcoe_mtu:	device supports maximum FCoE MTU, 2158 bytes
@@ -2528,6 +2529,13 @@ struct net_device {
 
 	/* priv_flags_slow, ungrouped to save space */
 	unsigned long		see_all_hwtstamp_requests:1;
+	/* Direct HSR/PRP member: slave A/B or interlink. While set,
+	 * software GRO and configurable GRO_HW are dropped from the
+	 * request and before ndo_fix_features(); GRO_HW that the driver
+	 * keeps on is left alone. Kernel role state only; no user ABI or
+	 * offload capability.
+	 */
+	unsigned long		hsr_port:1;
 	unsigned long		change_proto_down:1;
 	unsigned long		netns_immutable:1;
 	unsigned long		fcoe_mtu:1;
net/core/dev.c +15 -0
index 3c58db732761..1f51a55ff2b0 100644
@@ -11289,6 +11289,21 @@ int __netdev_update_features(struct net_device *dev)
 
 	features = netdev_get_wanted_features(dev);
 
+	/* A direct HSR/PRP port needs per-frame metadata. Drop software
+	 * GRO and configurable GRO_HW from the request as well as from the
+	 * features passed to ndo_fix_features(): drivers such as veth
+	 * derive state from wanted_features and need the requested and the
+	 * active bit to agree. Fixed-on or driver-required GRO_HW is left
+	 * to the driver.
+	 */
+	if (dev->hsr_port) {
+		netdev_features_t gro = NETIF_F_GRO |
+					(dev->hw_features & NETIF_F_GRO_HW);
+
+		dev->wanted_features &= ~gro;
+		features &= ~gro;
+	}
+
 	if (dev->netdev_ops->ndo_fix_features)
 		features = dev->netdev_ops->ndo_fix_features(dev, features);
 
net/hsr/hsr_slave.c +54 -0

85 lines not on this page · raw message

Signature · 1 line
2.53.0
#2 lore raw

Re: [PATCH net v10 1/4] net: hsr: keep GRO disabled on HSR/PRP ports

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

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] When dev->hsr_port is set, __netdev_update_features() (net/core/dev.c) clears NETIF_F_GRO, and NETIF_F_GRO_HW if it is in…

--

net: hsr: keep GRO disabled on HSR/PRP ports

This patch adds an hsr_port role bit to struct net_device and sets it on HSR/PRP slave and interlink devices. While the bit is set, __netdev_update_features() removes NETIF_F_GRO and configurable NETIF_F_GRO_HW from both dev->wanted_features and the computed features. The attach is refused if software GRO is still on after the update.

Quoted 12 lines
net/core/dev.c +4 -0
index 3c58db732761a..1f51a55ff2b08 100644
@@ -11289,6 +11289,21 @@ int __netdev_update_features(struct net_device *dev)
 
 	features = netdev_get_wanted_features(dev);
 
+	/* A direct HSR/PRP port needs per-frame metadata. Drop software
+	 * GRO and configurable GRO_HW from the request as well as from the
+	 * features passed to ndo_fix_features(): drivers such as veth
+	 * derive state from wanted_features and need the requested and the

net/core/dev.c int __netdev_update_features(struct net_device *dev) · line 11305

Quoted 10 lines
net/core/dev.c +10 -0
+	 * active bit to agree. Fixed-on or driver-required GRO_HW is left
+	 * to the driver.
+	 */
+	if (dev->hsr_port) {
+		netdev_features_t gro = NETIF_F_GRO |
+					(dev->hw_features & NETIF_F_GRO_HW);
+
+		dev->wanted_features &= ~gro;
+		features &= ~gro;
+	}

[Severity: Medium]
Does clearing dev->wanted_features here make the ethtool uAPI report a GRO request on an HSR member incorrectly?

With the legacy ioctl, ethtool_set_features() in net/ethtool/ioctl.c stores the request, calls __netdev_update_features(), and then works out ETHTOOL_F_WISH from dev->wanted_features:

net/ethtool/ioctl.c:ethtool_set_features() {
    ...
	dev->wanted_features |= wanted & valid;
	__netdev_update_features(dev);

	if ((dev->wanted_features ^ dev->features) & valid)
		ret |= ETHTOOL_F_WISH;
    ...
}

On a member, "ethtool -K <port> gro on" ends with GRO cleared in both wanted_features and features. The call therefore succeeds without ETHTOOL_F_WISH, even though GRO stays off.

include/uapi/linux/ethtool.h documents the flag as:

* %ETHTOOL_F_WISH - some or all changes requested were recorded but the
* resulting state of bits masked by .valid is not equal to .requested.

Is that contract broken in this case?

On the netlink side, ethnl_set_features() in net/ethtool/features.c builds its reply from the local req_wanted bitmap:

	bitmap_xor(wanted_diff_mask, req_wanted, new_active,
		   NETDEV_FEATURE_COUNT);

So the SET reply says GRO is wanted but not active. A later ETHTOOL_MSG_FEATURES_GET then reads dev->wanted_features in features_prepare_data() and shows GRO as not wanted. Can the SET reply and the GET that follows it disagree about the same request, and can the ioctl and netlink interfaces disagree with each other?

The commit message describes this behaviour:

A GRO request on a member is dropped,
not kept pending: while GRO stays off, the legacy ETHTOOL_SFEATURES ioctl returns no ETHTOOL_F_WISH for it, and the netlink reply still shows the request as not applied.

The other core paths seem to handle this differently. netdev_sync_upper_features() and ndo_fix_features() only mask the computed features, so a bridge port's LRO request still returns ETHTOOL_F_WISH. dev_disable_lro() and dev_disable_gro_hw() clear wanted_features only once, when they are called. This new branch erases the request on every recompute.

Could the request stay in wanted_features, with only the computed features masked here? veth's use of wanted_features (veth_gro_requested() reads dev->wanted_features) could then be handled separately.

Quoted 3 lines
net/core/dev.c +0 -0
 	if (dev->netdev_ops->ndo_fix_features)
 		features = dev->netdev_ops->ndo_fix_features(dev, features);
 

[ ... ]

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117141922.20-1-xiexinet%40gmail.com
author
#3 lore raw

Re: [PATCH net v10 1/4] net: hsr: keep GRO disabled on HSR/PRP ports

Quoted 3 lines · On 20/11/2026 03:22, [email protected] wrote:

So the SET reply says GRO is wanted but not active. A later ETHTOOL_MSG_FEATURES_GET then reads dev->wanted_features in features_prepare_data() and shows GRO as not wanted.

This is intended, and the commit message says so: a GRO request on a member is dropped, not kept pending. While GRO stays off, ETHTOOL_SFEATURES returns no ETHTOOL_F_WISH and the netlink SET reply shows the bit as not applied. A later GET reads the stored request, which no longer has GRO; a SET reply and a GET can already differ in the same way for a bit outside hw_features.

Quoted 2 lines

Could the request stay in wanted_features, with only the computed features masked here?

Masking only the computed features is what v7 did, and it breaks veth, which adds and deletes its NAPI instances according to wanted_features; the commit message names the two failures. Changing veth is a separate matter and not part of this fix.

Signature · 1 line
Xin
author
#4 lore raw

PATCH v10 2/4 net: hsr: refuse forwarding devices as HSR/PRP ports

In reply to Xin Xie

syzbot reported recursive locking with an HSR device whose slave is a bridge, and that bridge has the master of a second HSR device as a port. The first device transmits its supervision frames with its seqnr_lock held; the bridge floods them to the second HSR master, whose hsr_dev_xmit() takes the seqnr_lock of that device:

WARNING: possible recursive locking detected
...

   hsr_dev_xmit+0x18a/0x210 net/hsr/hsr_device.c:234
   ...
   br_dev_xmit+0x1202/0x1b40
   ...
   hsr_forward_skb+0x171c/0x2ac0 net/hsr/hsr_forward.c:728
   send_hsr_supervision_frame+0x63b/0xcc0 net/hsr/hsr_device.c:351
   hsr_announce+0x1f8/0x3a0 net/hsr/hsr_device.c:408

Interlink RX forwards to the slaves with the same lock held. A chain of two devices does not deadlock, but such a port makes no sense: an HSR ring and the two PRP LANs are attached to the node directly.

Refuse bridge and OVS masters and bond and team masters (also without ports, since ports can be added later) as slave or interlink, and a macvlan or MACsec device when an HSR/PRP, bridge, bond or team master is below it; on an ordinary NIC or veth such a device stays valid. This also refuses one on a DSA user port whose conduit is a bond or team, since it can gain ports later too. A macvlan takes its GRO setting from its lower device, so it is accepted only if GRO is off there when it is attached. The lower devices of other ports are not checked, because a DSA user port is an upper of its conduit and can offload HSR. VLAN devices are already refused. The check runs at attach; later changes below a stacked device are not rechecked. Not covered are a tunnel whose route leads back through the HSR master, a tc or BPF redirect to it, other stacked devices, and a software device without an identifying flag such as batman-adv. Narrowing seqnr_lock, planned for net-next, addresses that class as a whole.

Also refuse a device whose RX handler is in use or not supported (IFF_NO_RX_HANDLER: ipvlan, VRF), or that already has a master, such as a VRF port, with an extack message and the same error codes. All ports are checked before any of them is changed. Some of these devices, such as a macvlan lower, ipvlan or VRF, used to fail only in netdev_rx_handler_register(), after the previous patch had dropped their GRO request; a refused device now keeps its state, and so do the ports given with it.

A bridge can no longer be used directly as the interlink; connect it through a veth pair.

Reported-by [email protected]
Fixes 06afd2c31d33 ("hsr: Synchronize sending frames to have always incremented outgoing seq nr.")
Fixes 430d67bdcb04 ("net: hsr: Use the seqnr lock for frames received via interlink port.")
---
 net/hsr/hsr_device.c |  7 ++++
 net/hsr/hsr_slave.c  | 79 ++++++++++++++++++++++++++++++++++++++++++--
 net/hsr/hsr_slave.h  |  2 ++
 3 files changed, 86 insertions(+), 2 deletions(-)
net/hsr/hsr_device.c +7 -0
index fc512204600c..90ee55eb3c19 100644
@@ -758,6 +758,13 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
 	INIT_LIST_HEAD(&hsr->proxy_node_db);
 	spin_lock_init(&hsr->list_lock);
 
+	/* Refuse a bad port before any port is changed. The same checks
+	 * in hsr_add_port() remain as a safety net.
+	 */
+	res = hsr_check_ports(slave, interlink, extack);
+	if (res)
+		return res;
+
 	eth_hw_addr_set(hsr_dev, slave[0]->dev_addr);
 
 	/* initialize protocol specific functions */
net/hsr/hsr_slave.c +77 -2

108 lines not on this page · raw message

net/hsr/hsr_slave.h +2 -0
index edc4612bb009..e19c779b500d 100644
@@ -14,6 +14,8 @@
 #include <linux/rtnetlink.h>
 #include "hsr_main.h"
 
+int hsr_check_ports(struct net_device *slave[2], struct net_device *interlink,
+		    struct netlink_ext_ack *extack);
 int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
 		 enum hsr_port_type pt, struct netlink_ext_ack *extack);
 void hsr_del_port(struct hsr_port *port);
Signature · 1 line
2.53.0
#5 lore raw

Re: [PATCH net v10 2/4] net: hsr: refuse forwarding devices as HSR/PRP ports

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 1

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).

- [High] The patch addresses the seqnr_lock recursion only by refusing certain port device types at attach time (bridge/OVS/bond/team…
- [Low] The patch is tagged for backport as a seqnr_lock recursion fix (Fixes: 06afd2c31d33, from v6.2, and Fixes: 430d67bdcb04), but it also…

--

net: hsr: refuse forwarding devices as HSR/PRP ports

This patch stops bridge/OVS/bond/team masters from being used as HSR/PRP slave or interlink ports. It also refuses a macvlan or MACsec device that sits on top of such a master or an HSR master. This addresses the seqnr_lock recursion that syzbot reported. The patch also refuses devices whose RX handler is busy or unsupported, or that already have a master. All ports are checked before any of them is modified.

Quoted 4 lines
net/hsr/hsr_slave.c +0 -0
index 4c4f8fe3d128a..a4dd64227db5f 100644

[ ... ]

Quoted 15 lines
net/hsr/hsr_slave.c +9 -2
@@ -131,13 +163,56 @@ static int hsr_check_dev_ok(struct net_device *dev,
 		return -EOPNOTSUPP;
 	}
 
-	/* HSR over bonded devices has not been tested, but I'm not sure it
-	 * won't work...
+	/* Forwarding devices feed HSR frames into another device's
+	 * transmit path and can nest seqnr_lock through a second HSR
+	 * device. A bridge, bond, team or OVS master makes no sense as a
+	 * ring or LAN port and is refused by type. A macvlan or MACsec
+	 * device is refused if such a master or an HSR/PRP master is
+	 * below it. Other devices keep their lower devices unchecked:
+	 * DSA user ports are uppers of their conduit.
+	 */
+	if (netif_is_any_bridge_master(dev) || netif_is_lag_master(dev)) {

net/hsr/hsr_slave.c static int hsr_check_dev_ok(struct net_device *dev, · line 184

Quoted 10 lines
net/hsr/hsr_slave.c +10 -0
+		NL_SET_ERR_MSG_MOD(extack,
+				   "Cannot use a bridge, bond, team or OVS master as HSR port.");
+		return -EINVAL;
+	}
+	if ((netif_is_macvlan(dev) || netif_is_macsec(dev)) &&
+	    netdev_walk_all_lower_dev(dev, hsr_lower_forwards, NULL)) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "Cannot use a macvlan or MACsec device stacked on an HSR, bridge, bond, team or OVS master as HSR port.");
+		return -EINVAL;
+	}

[Severity: High]
These checks in hsr_check_dev_ok() refuse ports by device type, and only at attach time. seqnr_lock is still held across the synchronous transmit to the ports:

net/hsr/hsr_device.c:hsr_dev_xmit() {
    ...
		spin_lock_bh(&hsr->seqnr_lock);
		hsr_forward_skb(skb, master);
		spin_unlock_bh(&hsr->seqnr_lock);
    ...
}

hsr_forward_skb() then goes through hsr_xmit() to dev_queue_xmit() on the port device. The same pattern is in send_hsr_supervision_frame(), send_prp_supervision_frame() and the interlink branch of hsr_handle_frame().

Can a plain veth slave still re-enter the xmit path of its own HSR master? For example, take veth0 as a slave of hsr0, with a tc egress mirred redirect back to hsr0:

hsr_dev_xmit(hsr0)
spin_lock_bh(&hsr->seqnr_lock)
hsr_forward_skb()

    hsr_xmit()
      dev_queue_xmit(veth0)
        tcf_mirred_act()   /* egress redirect to hsr0 */
          dev_queue_xmit(hsr0)
            hsr_dev_xmit(hsr0)
              spin_lock_bh(&hsr->seqnr_lock)   /* already held */

On the first redirect, tcf_mirred_act() only looks at sched_mirred_dev[], and hsr0 is not in it yet. hsr0 is lltx with IFF_NO_QUEUE, so neither the xmit_lock_owner check nor dev_xmit_recursion() would stop this either. veth passes every check in hsr_check_dev_ok().

That would be an AA self-deadlock on one instance with BH disabled. That is worse than the cross-instance lockdep splat in the syzbot report. CAP_NET_ADMIN in an unprivileged user namespace seems to be enough to set this up.

Other ways back into an HSR master also get past these checks:
ARPHRD_ETHER tunnels routed through the HSR master, BPF redirects, stacked devices whose lower devices are not walked (for example virt_wifi over a bridge), and batman-adv.

The commit message acknowledges this:

Not covered are a tunnel whose route leads back through the HSR master, a tc or BPF redirect to it, other stacked devices, and a software device without an identifying flag such as batman-adv. Narrowing seqnr_lock, planned for net-next, addresses that class as a whole.

This is still the case at the end of the series. There, hsr_forward_frame() in hsr_forward.c takes spin_lock_bh(&hsr->seqnr_lock) around hsr_forward_skb().

The bug class covered by the Fixes: tags is still reachable. Would it be better to stop holding seqnr_lock across dev_queue_xmit() in this fix, instead of adding a denylist that the planned lock narrowing would replace?

net/hsr/hsr_slave.c static int hsr_check_dev_ok(struct net_device *dev, · line 195

Quoted 11 lines
net/hsr/hsr_slave.c +10 -0
+	/* A macvlan takes its GRO setting from the lower device, so the
+	 * member role cannot turn it off. Refuse at attach, before any
+	 * state change, if the lower device runs GRO; it can still turn
+	 * GRO on later.
 	 */
+	if (netif_is_macvlan(dev) &&
+	    (macvlan_dev_real_dev(dev)->features & NETIF_F_GRO)) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "macvlan inherits GRO from its lower device; turn GRO off on the lower device.");
+		return -EBUSY;
+	}

[Severity: Low]
This check only makes sense together with the member-role GRO policy from the previous patch, "net: hsr: keep GRO disabled on HSR/PRP ports". It is an earlier form of the rejection that patch added to hsr_portdev_setup():

    hsr_portdev_role_set(dev);
    if (dev->features & NETIF_F_GRO) {
        NL_SET_ERR_MSG_MOD(extack,
                   "software GRO still on after feature update, cannot join");

It is not related to the seqnr_lock recursion.

This patch carries Fixes: 06afd2c31d33 (v6.2) and Fixes: 430d67bdcb04. The previous patch is only tagged Fixes: 5055cccfc2d1 (RedBox, v6.10).

Suppose stable takes this patch into 6.1 or 6.6 without the GRO policy patch. Would this hunk then refuse a macvlan on a NIC or veth, where GRO is on by default, with an error message that does not apply to that tree?

The patch probably won't apply cleanly there anyway, since the "Member role and feature policy" block and the interlink argument to hsr_dev_finalize() don't exist in those trees. A backporter may drop this hunk, but nothing in the commit tells them to.

Could this hunk move into the GRO policy patch, or could a stable dependency note be added? Right now the commit message mentions the previous patch only in the prose.

[ ... ]

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117141922.20-1-xiexinet%40gmail.com
author
#6 lore raw

Re: [PATCH net v10 2/4] net: hsr: refuse forwarding devices as HSR/PRP ports

Quoted 1 line · On 20/11/2026 03:22, [email protected] wrote:

Can a plain veth slave still re-enter the xmit path of its own HSR master?

Yes. The redirect case exists without the patch, and the commit message lists it as not covered. seqnr_lock has been held across the port transmit since 06afd2c31d33 and 430d67bdcb04. The patch refuses port types that make no sense as HSR/PRP ports, which covers the syzbot topology, as Sebastian suggested [1].

Quoted 4 lines

Would it be
better to stop holding seqnr_lock across dev_queue_xmit() in this fix, instead of adding a denylist that the planned lock narrowing would replace?

Releasing seqnr_lock before the port transmit closes the whole class, but it can reorder frames for receivers without aae9d6b616b5 ("hsr:
Implement more robust duplicate discard for HSR"). It is left to net-next, where Hangbin's patch [2] fits.

Quoted 2 lines

Could this hunk move into the GRO policy patch, or could a stable dependency note be added?

No stable backport is requested for this series. The macvlan GRO check depends on patch 1 and makes no sense in a tree without it.

[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/

Signature · 1 line
Xin
author
#7 lore raw

PATCH v10 3/4 net: hsr: segment GSO before per-frame forwarding

In reply to Xin Xie

HSR and PRP tag and de-duplicate each wire frame separately. A GSO super-packet reaching the forwarding path hides several wire frames, which cannot be tagged or numbered per frame. Such skbs reach a member even with GRO off, for example from a container or VM attached through veth, tap or virtio to a software RedBox, or from a member whose GRO_HW cannot be turned off.

Add one forwarding entry, hsr_forward_input(), for master TX and for frames received on any port. It segments GSO input outside seqnr_lock; each segment is then numbered and submitted under the lock, one frame at a time as before, and follows the normal forwarding and local delivery paths. Master TX and interlink RX now take the lock there instead of in their callers.

Classify by the effective inner protocol with the core's bounded VLAN decoder (802.1Q, 802.1AD, nested or accelerated). Drop aggregates with inner HSR/PRP, unreadable fragments or undecodable headers, and IPv4 or IPv6 aggregates whose nonzero IP length ends before the skb does, since the trailing bytes would become segment payload. GSO_PARTIAL and zero IP lengths are left to the segmenter. Drops are counted once on the entry device in the core per-CPU drop counters. Segmentation writes the control block, the headers and the L4 checksum, so a still-shared input is unshared first, and a head still shared with a clone, for example from a packet socket, is copied.

Older HSR and PRP senders can pass a whole GSO skb with one tag or one RCT, for example over tap or virtio. Such aggregates, including locally destined ones, are now dropped instead of being delivered.

Remove the NETIF_F_GSO_MASK types from the master's hw_features so the core segments local traffic before ndo_start_xmit(). This also holds over ports with HSR tag insertion offload, at some cost in performance.

Fixes f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)")

---
Integration with net-next: Sebastian's pending series "hsr: Allow to send packets on specific port and pass the timestamp" (v10) changes hsr_forward_skb() to take the requested TX port and a has_hsr_header flag, and keeps seqnr_lock in hsr_dev_xmit() and in the interlink path of hsr_handle_frame(). With both series:
- keep his PTP header parsing in hsr_dev_xmit(), then call hsr_forward_input(skb, master, req_tx_port, has_hsr_header) without taking seqnr_lock there;
- call hsr_forward_input(skb, port, HSR_PT_NONE, false) from hsr_handle_frame(), without the interlink lock;
- add both arguments to hsr_forward_input() and hsr_forward_frame() and pass them to hsr_forward_skb() for the skb and for each segment;
- keep both include sets in hsr_forward.c.
A frame with the PTP header is not GSO and takes the single-frame path under the lock, as in his series. A GSO input with the header is classified after the pull: with an HSR header it is dropped like any inner HSR/PRP aggregate, otherwise each segment keeps req_tx_port.
Checked: on net-next 7ccc5e05043b with his v10 applied, this series with the resolution builds without warnings, and on a lockdep kernel hsr_ptp.sh, the two tests of patch 4 and the existing hsr selftests pass.

 net/hsr/hsr_device.c  |   6 +-
 net/hsr/hsr_forward.c | 156 ++++++++++++++++++++++++++++++++++++++++++
 net/hsr/hsr_forward.h |   1 +
 net/hsr/hsr_slave.c   |  12 ++--
 4 files changed, 163 insertions(+), 12 deletions(-)
net/hsr/hsr_device.c +2 -4
index 90ee55eb3c19..5db71b49d08e 100644
@@ -232,9 +232,7 @@ static netdev_tx_t hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 		skb->dev = master->dev;
 		skb_reset_mac_header(skb);
 		skb_reset_mac_len(skb);
-		spin_lock_bh(&hsr->seqnr_lock);
-		hsr_forward_skb(skb, master);
-		spin_unlock_bh(&hsr->seqnr_lock);
+		hsr_forward_input(skb, master);
 	} else {
 		dev_core_stats_tx_dropped_inc(dev);
 		dev_kfree_skb_any(skb);
@@ -686,7 +684,7 @@ void hsr_dev_setup(struct net_device *dev)
 	dev->needs_free_netdev = true;
 
 	dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
-			   NETIF_F_GSO_MASK | NETIF_F_HW_CSUM |
+			   NETIF_F_HW_CSUM |
 			   NETIF_F_HW_VLAN_CTAG_TX |
 			   NETIF_F_HW_VLAN_CTAG_FILTER;
 
net/hsr/hsr_forward.c +156 -0

165 lines not on this page · raw message

net/hsr/hsr_forward.h +1 -0
index 206636750b30..ec08c4330259 100644
@@ -14,6 +14,7 @@
 #include "hsr_main.h"
 
 void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port);
+void hsr_forward_input(struct sk_buff *skb, struct hsr_port *port);
 struct sk_buff *prp_create_tagged_frame(struct hsr_frame_info *frame,
 					struct hsr_port *port);
 struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame,
net/hsr/hsr_slave.c +4 -8
index a4dd64227db5..2c0e7d96f67a 100644
@@ -76,15 +76,11 @@ static rx_handler_result_t hsr_handle_frame(struct sk_buff **pskb)
 	skb_reset_mac_len(skb);
 
 	/* Only the frames received over the interlink port will assign a
-	 * sequence number and require synchronisation vs other sender.
+	 * sequence number and require synchronisation vs other sender;
+	 * hsr_forward_input() takes seqnr_lock for them, one frame at a
+	 * time.
 	 */
-	if (port->type == HSR_PT_INTERLINK) {
-		spin_lock_bh(&hsr->seqnr_lock);
-		hsr_forward_skb(skb, port);
-		spin_unlock_bh(&hsr->seqnr_lock);
-	} else {
-		hsr_forward_skb(skb, port);
-	}
+	hsr_forward_input(skb, port);
 
 finish_consume:
 	return RX_HANDLER_CONSUMED;
Signature · 1 line
2.53.0
#8 lore raw

Re: [PATCH net v10 3/4] net: hsr: segment GSO before per-frame forwarding

Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you…

Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch adds a second way of counting rejected input frames in net/hsr/hsr_forward.c, so the same kind of drop now lands in different…

--

net: hsr: segment GSO before per-frame forwarding

This patch adds hsr_forward_input() as a single forwarding entry for master TX and for frames received on any port. GSO aggregates are segmented outside seqnr_lock, and each segment is then numbered and forwarded under the lock. Aggregates that cannot be segmented safely are dropped and counted in the core per-CPU drop counters. NETIF_F_GSO_MASK is removed from the master's hw_features.

Quoted 4 lines
net/hsr/hsr_forward.c +0 -0
index 44f6d9c83180a..5e49f2bb9e39b 100644

[ ... ]

Quoted 20 lines
net/hsr/hsr_forward.c +16 -0
@@ -794,3 +797,156 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port)
 	port->dev->stats.tx_dropped++;
 	kfree_skb(skb);
 }
+
+/* Master TX and interlink RX are numbered locally: number and submit
+ * one frame at a time under seqnr_lock, as before. LAN A/B input
+ * keeps its received number and needs no lock.
+ */
+static void hsr_forward_frame(struct sk_buff *skb, struct hsr_port *port)
+{
+	struct hsr_priv *hsr = port->hsr;
+	bool numbered = port->type == HSR_PT_MASTER ||
+			port->type == HSR_PT_INTERLINK;
+
+	if (numbered)
+		spin_lock_bh(&hsr->seqnr_lock);
+	hsr_forward_skb(skb, port);
+	if (numbered)
+		spin_unlock_bh(&hsr->seqnr_lock);

net/hsr/hsr_forward.c void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port) · line 825

Quoted 10 lines
net/hsr/hsr_forward.c +10 -0
+}
+
+/* One count per rejected GSO input on its entry device. */
+static void hsr_gso_drop_stat(struct hsr_port *port)
+{
+	if (port->type == HSR_PT_MASTER)
+		dev_core_stats_tx_dropped_inc(port->dev);
+	else
+		dev_core_stats_rx_dropped_inc(port->dev);
+}

[Severity: Low]
This isn't a functional bug, but this adds a second way of counting rejected input frames in hsr_forward.c. The same kind of drop can now end up in different counters.

For a GSO aggregate rejected by the hsr_forward_input() gate, hsr_gso_drop_stat() counts once in the core per-CPU counters. Slave and interlink ports get rx_dropped and the master gets tx_dropped.

Plain frames, and each segment produced by hsr_forward_input(), still go through hsr_forward_frame()->hsr_forward_skb(). When fill_frame_info() fails there, the existing out_drop path counts the drop in legacy tx_dropped for every port type:

net/hsr/hsr_forward.c:hsr_forward_skb() {
    ...
out_drop:
	rcu_read_unlock();
	port->dev->stats.tx_dropped++;
	kfree_skb(skb);
}

So on a slave port, a rejected frame goes to legacy tx_dropped if it was a plain frame or a segment. It goes to core rx_dropped if it was a whole GSO aggregate. Segments that fail fill_frame_info() are counted once per segment in legacy tx_dropped.

The commit message says:

Drops are counted once on the entry device in the core per-CPU drop counters.

That covers only the gate drops, not the segment drops counted in hsr_forward_skb().

hsr_forward_do() uses yet another convention, legacy rx_dropped on the receive port:

net/hsr/hsr_forward.c:hsr_forward_do() {
    ...
		if (!skb) {
			frame->port_rcv->dev->stats.rx_dropped++;
			continue;
		}
    ...
}

Would it make sense to bring these drop sites onto one convention? At minimum, could the commit message say that segments rejected later are still counted in legacy tx_dropped?

[ ... ]

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117141922.20-1-xiexinet%40gmail.com
author
#9 lore raw

Re: [PATCH net v10 3/4] net: hsr: segment GSO before per-frame forwarding

Quoted 2 lines · On 20/11/2026 03:22, [email protected] wrote:

That covers only the gate drops, not the segment drops counted in hsr_forward_skb().

Yes, the sentence is about the aggregates that hsr_forward_input() drops as a whole. A frame or segment that fill_frame_info() rejects later takes the existing tx_dropped path in hsr_forward_skb(), which the patch does not change.

Signature · 1 line
Xin
author
#10 lore raw

PATCH v10 4/4 selftests: net: hsr: verify GRO policy and ordered forwarding

In reply to Xin Xie

Add two tests, run by shell entries that exec one installed Python helper.

hsr_gro_superpacket.sh checks the member GRO policy: GRO is off, requested and active, while a veth is a member and after it leaves, and can then be turned on again; a device refused at attach keeps its request. It covers close and reopen of an attached veth, a veth attached while down, the master's GSO type mask, a refused bridge port that leaves the port given before it unchanged, a busy macvlan lower, the refusal of bridge, bond and ipvlan devices, of a macvlan on a bridge or on a bond and of a VRF port without leaving an upper link or a promiscuity reference on any port, a macvlan whose lower device runs GRO that is refused as second port with the first port unchanged, and a macvlan on a veth without GRO that is accepted. Natural TCP from the interlink is compared byte for byte, retransmissions included, with both LAN captures. TCP from a SAN on one PRP LAN, in plain and VLAN forms, is compared the same way with the ingress LAN and the local delivery, and its reply must appear once on each LAN. Tags/RCT, sequence numbers and VLAN stacks are checked.

hsr_ordered_forwarding.sh checks local data around interlink data and UDP GSO aggregates, local and proxy supervision, two concurrent producers and an observed sequence-number wrap.

Work is bounded to 120 seconds and cleanup to 20; INT/TERM remove the test's namespaces. Packets are judged only on complete captures without socket loss or truncation. A missing prerequisite SKIPs the affected case; query errors and missing packet evidence FAIL, and the cases after a failure are reported as not ok.

---
 tools/testing/selftests/net/hsr/Makefile      |    7 +-
 tools/testing/selftests/net/hsr/config        |   10 +
 .../selftests/net/hsr/hsr_gro_superpacket.py  | 1468 +++++++++++++++++
 .../selftests/net/hsr/hsr_gro_superpacket.sh  |    9 +
 .../net/hsr/hsr_ordered_forwarding.sh         |    9 +
 5 files changed, 1502 insertions(+), 1 deletion(-)
 create mode 100755 tools/testing/selftests/net/hsr/hsr_gro_superpacket.py
 create mode 100755 tools/testing/selftests/net/hsr/hsr_gro_superpacket.sh
 create mode 100755 tools/testing/selftests/net/hsr/hsr_ordered_forwarding.sh
tools/testing/selftests/net/hsr/Makefile +6 -1
index 2150e487ac7d..70f8a804b44a 100644
@@ -3,6 +3,8 @@
 top_srcdir = ../../../../..
 
 TEST_PROGS := \
+	hsr_gro_superpacket.sh \
+	hsr_ordered_forwarding.sh \
 	hsr_ping.sh \
 	hsr_prp_redbox.sh \
 	hsr_redbox.sh \
@@ -10,6 +12,9 @@ TEST_PROGS := \
 	prp_ping.sh \
 # end of TEST_PROGS
 
-TEST_FILES += hsr_common.sh
+TEST_FILES += \
+	hsr_common.sh \
+	hsr_gro_superpacket.py \
+# end of TEST_FILES
 
 include ../../lib.mk
tools/testing/selftests/net/hsr/config +10 -0
index 205cc4d3d64b..d9463ae0025a 100644
@@ -1,6 +1,16 @@
+CONFIG_BONDING=y
 CONFIG_BRIDGE=y
 CONFIG_HSR=y
+CONFIG_INET=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
 CONFIG_IPV6=y
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPVLAN=y
+CONFIG_MACVLAN=y
+CONFIG_NET_L3_MASTER_DEV=y
 CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_VRF=y
+CONFIG_PACKET=y
 CONFIG_VETH=y
 CONFIG_VLAN_8021Q=m
tools/testing/selftests/net/hsr/hsr_gro_superpacket.py new file +1468 -0

1,468 lines not on this page · raw message

tools/testing/selftests/net/hsr/hsr_gro_superpacket.sh new file +9 -0
new file mode 100755
index 000000000000..9da711ad2ab2
@@ -0,0 +1,9 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+if ! command -v python3 > /dev/null; then
+	echo "SKIP: missing python3"
+	exit 4
+fi
+
+exec python3 -B "$(dirname "$0")/hsr_gro_superpacket.py" gro "$@"
tools/testing/selftests/net/hsr/hsr_ordered_forwarding.sh new file +9 -0
new file mode 100755
index 000000000000..b43218709455
@@ -0,0 +1,9 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+if ! command -v python3 > /dev/null; then
+	echo "SKIP: missing python3"
+	exit 4
+fi
+
+exec python3 -B "$(dirname "$0")/hsr_gro_superpacket.py" ordered "$@"
Signature · 1 line
2.53.0
#11 lore raw

Re: [PATCH net v10 4/4] selftests: net: hsr: verify GRO policy and ordered forwarding

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

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] The single-producer ordered cases in hsr_ordered_forwarding.sh can fail even when the kernel is correct.

--

selftests: net: hsr: verify GRO policy and ordered forwarding

This commit adds two HSR/PRP kselftests, and both run one shared Python helper. hsr_gro_superpacket.sh checks the GRO policy on HSR members, the refusal of unsupported port types, and TCP forwarding from the interlink and from a PRP SAN. hsr_ordered_forwarding.sh checks the ordering of local and interlink data, supervision frames, concurrent producers and a sequence-number wrap.

Quoted 6 lines
tools/testing/selftests/net/hsr/hsr_gro_superpacket.py new file +0 -0
new file mode 100755
index 0000000000000..17055d9329b3d
@@ -0,0 +1,1468 @@

[ ... ]

tools/testing/selftests/net/hsr/hsr_gro_superpacket.py line 1022

Quoted 13 lines
tools/testing/selftests/net/hsr/hsr_gro_superpacket.py new file +13 -0
+def ordered_send(lab, sock, producer, first, count, port, segment=0):
+    """Send count datagrams, or UDP GSO aggregates of 16; return the payloads."""
+    expected = []
+    if segment:
+        sock.setsockopt(socket.IPPROTO_UDP, 103, segment)
+    blocks = 16 if segment else 1
+    size = segment or 64
+    for number in range(count):
+        payloads = [ordered_payload(producer, first + number * blocks + n,
+                                    size) for n in range(blocks)]
+        body = b"".join(payloads)
+        require(sock.sendto(body, ("239.0.0.9", port)) == len(body),
+                "short UDP send")

[Severity: Medium]

Can the single-producer ordered cases fail on a correct kernel because this sender is not pinned to a CPU?

ordered_send() runs in the main thread, and the main thread never calls os.sched_setaffinity(). Only the producer threads in ordered_concurrent() are pinned.

The frames go through the veth t0 to the interlink dil. There is no XDP, and GRO is forced off on HSR members. So veth hands each frame to the backlog of the CPU that sent it:

drivers/net/veth.c:veth_forward_skb() {
	return __dev_forward_skb(dev, skb) ?: xdp ?
		veth_xdp_rx(rq, skb) :
		__netif_rx(skb);
}

The netif_rx path then calls enqueue_to_backlog(skb, smp_processor_id(), ...).

Threaded backlogs are always used on CONFIG_PREEMPT_RT, and also with the thread_backlog_napi boot option. With them, ____napi_schedule() only wakes the per-CPU backlog thread:

net/core/dev.c:____napi_schedule() {
    ...
	if (use_backlog_threads() && thread == raw_cpu_read(backlog_napi))
		goto use_local_napi;

	set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
	wake_up_process(thread);
    ...
}

As a result, sendto() returns before the frame is processed. The same can happen without threaded backlogs when NET_RX is deferred to ksoftirqd.

Suppose the sender migrates from CPU X to CPU Y in the middle of the loop. The backlog threads of X and Y can then run hsr_handle_frame() for dil at the same time. They take seqnr_lock in arrival order, so a later send can get a lower HSR sequence number and appear earlier on dil, da and db.

The test still requires the exact send order in ordered_data():

require([row["payload"] for row in incoming] == expected_inputs,
"actual UDP ingress input set/order differs")

It also requires it through verify_udp(..., input_order=True) in ordered_data(), ordered_supervision() and ordered_wrap(). ordered_wrap() is the most exposed: it sends up to about 65k warmup datagrams plus 256 more, and all of them are checked with input_order=True.

Would pinning the sending thread to one CPU for the ordered cases, or pinning the whole process in ordered mode, avoid this?

Quoted 6 lines
tools/testing/selftests/net/hsr/hsr_gro_superpacket.py new file +6 -0
+        expected.extend(payloads)
+        # Keep capture receive queues bounded throughout long wrap warmups.
+        if number % 8 == 0:
+            lab.observe(0)
+    lab.observe(0.1)
+    return expected

[ ... ]

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117141922.20-1-xiexinet%40gmail.com
author
#12 lore raw

Re: [PATCH net v10 4/4] selftests: net: hsr: verify GRO policy and ordered forwarding

Quoted 2 lines · On 20/11/2026 03:22, [email protected] wrote:

Can the single-producer ordered cases fail on a correct kernel because this sender is not pinned to a CPU?

The single-producer cases send from the unpinned main thread, so with threaded backlogs a migration during the loop could deliver the frames that enter through veth out of order. That would be a spurious failure of the test on such a kernel; the forwarding code is not involved. No change to the series for this.

Signature · 1 line
Xin