Article View: linux.kernel.netdev
Article #15255[PATCH net v9 0/4] net: hsr: fix super-packet forwarding
From: Xin Xie
Date: Thu, 12 Nov 2026 15:33
Date: Thu, 12 Nov 2026 15:33
108 lines
16134 bytes
16134 bytes
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 30c71476d842; also applies to net-next. Patch 3
conflicts with Sebastian's pending net-next series [5]; its notes give
the resolution.
Changes since v8:
- Patch 1: the message and comments say which ports the rule covers.
- Patch 2: macvlan and MACsec are refused only on top of a bridge,
bond, team or HSR/PRP master; all ports are checked before any is
changed.
- Patch 3: copy a head shared with a clone before segmenting.
- Patch 4: no fixed sleep, no need for iproute2 to print the HSR
version, new refusal cases.
[1] https://lore.kernel.org/netdev/20261014151838.6RyMIRVM@linutronix.de/
[2] https://lore.kernel.org/netdev/20260805-hsr_deadlock-v1-1-d8a6f06fc5a8@kylinos.cn/
[3] https://lore.kernel.org/netdev/anXnxn-PBv8qH6VB@fedora/
[4] https://lore.kernel.org/netdev/4fc3b9f1-4bef-4b34-ae7a-e89037cce829@redhat.com/
[5] https://lore.kernel.org/netdev/20261104-hsr_ptp-v10-0-2c4a38ad973c@linutronix.de/
v8: https://lore.kernel.org/netdev/20261107220544.20-1-xiexinet@gmail.com/
v7: https://lore.kernel.org/netdev/20261009201324.17-1-xiexinet@gmail.com/
v6: https://lore.kernel.org/netdev/20260809121455.1745-1-xiexinet@gmail.com/
v5: https://lore.kernel.org/netdev/20260807140751.1351-1-xiexinet@gmail.com/
v4: https://lore.kernel.org/netdev/20260803222211.877-1-xiexinet@gmail.com/
v3: https://lore.kernel.org/netdev/20260731090224.18-1-xiexinet@gmail.com/
v2: https://lore.kernel.org/netdev/20260724161253.79-1-xiexinet@gmail.com/
v1: https://lore.kernel.org/netdev/20260722171836.196-1-xiexinet@gmail.com/
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 | 158 ++
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 | 1456 +++++++++++++++++
.../selftests/net/hsr/hsr_gro_superpacket.sh | 9 +
.../net/hsr/hsr_ordered_forwarding.sh | 9 +
13 files changed, 1819 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: 30c71476d842b094651bd7712f6c8ee8716147d0
--
2.53.0
Technical Details
Message-ID:
<20261112153333.20-1-xiexinet@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361979-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361979-linux-kernel-netdev=dewy.ru
From: xiexinet@gmail.com (Xin Xie)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v9 0/4] net: hsr: fix super-packet forwarding
Date: Thu, 12 Nov 2026 16:33:29 +0100
Organization: Usenet Network
Message-ID: <20261112153333.20-1-xiexinet@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1116922"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DLFlUlY0N10HqAXP1e4usQi6qn0= sha256:8ScXlSYZPpobS4UA/5MfEVBLIoH/K1CFles1CzxNuw0=
sha1:jg/h9NHXYFnViCsFouXTT5mNy7U= sha256:SlUsiFgN0YVjj1czn7LOUIgS7sn4LO20KzsuVDqNN5A=
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 967A91142CE; Thu, 12 Nov 2026 18:37:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 82IwN4rEmjd8;
Thu, 12 Nov 2026 18:37:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-361979-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id ADA331142CA; Thu, 12 Nov 2026 18:37:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id CDFDC615B14; Thu, 12 Nov 2026 15:33:46 +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=1794497619;
b=3CBSHngGbKwA+TgLMVkPcWKOjW9kgcu3MTRP5tB910hcwfcLpeLlqUvgSgiUgijxtWGN
4KlwEjIbvt4Z07fx7Nd5TMOs/OFd2nERqO0I6jRF7OKki7KQFDsVvdWp751QfrZWwX9Mr
uvG1oS2Hd9crh307dhN4hmRcFFtWjm92kf4eXiFnFlSHVT4oeWX+nUM4qDPYsaqz6glh5
9alJHkXbyo7s8SGuwUz6wqXuZU/90QXM4e4BXgXj2nrroJ8sWNBMakcHARGrERNBuQsKT
6W/d7WefwJMiRGJMoXHiBx7EnL1ssIjAZzSbhdN5EIDSG6a1MHuEuEbAuQjIg0FyjJw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794497619;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=rEhQI3hSOE9lI+wJjJwvBECQfjSinYgfuJ/QdhixFTY=;
b=gGjQJpzQHKGoNFOVNegxuLx6SycfzpCD8y7tEMdgLNYZFMoObEpRPjooC/kENZybxUw2
ClbOFRlK+S1QuWkGy3Wl8fZxELWnpLt4MtE5Ps/k588cPchQkDbvBdkO3A9scoaoEam9v
AMmU0Dtf08O1wE6G7sfwRcZYz6f7YtMKdX/JPTahewSWXS22UEs0pKFyX/RyJGooGM2ms
n+IloKnMuRZ9w1kvRvPtLeR3/b/DxonsFHEHiIDy+mrUQP5yyPNXm0hb01AtYzzvuQUFX
c4vt3vJJAxIAoWQd7lK1jjNvvtMuEK9LnSypD3Eq6LSP7MRxIz5/alLSBwa4WQMoaNQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jMLMrqdr;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 A11F9606A336;
Thu, 12 Nov 2026 15:33:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jMLMrqdr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.49
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794497618;
b=t/bIIRWFcLapJDg9sinf0It8WRANGHwOh7qw2PfHVc7L/0bCGEocoYLus5bWvHSNhk0D
KOlDLb1rFHS4JfBkEotYzpuzKNKIzXCZVaLJvUQ5akQeVe7HGzBM3OjfhBGa+Y8spmF7D
x8tSsJe+SmWB+hRjlPgR/U5ShGV2m4ht6DUGooKka3FXURemelUt0roCJpH0xAgQuhBv6
FnNJWWrt0FB5lA06VQfo2EjePQ0S/vkyID//e2XzUgmvOc4NykIRQRhvUqwn6jFlmMMh2
la2pB+LbhfwGESnyBQuqB0yKGYjyftwBLHljs47rfDlG/JGMsHuJLzsPMlM2uHcK9EQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794497618;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
bh=rEhQI3hSOE9lI+wJjJwvBECQfjSinYgfuJ/QdhixFTY=;
b=qfLS3DfsvQSrJRxEh4Qm2620ttOifR8fZK4RWY3FfoVc3OISTdq5tRMASIESF9U7MPG6
Kn5XcLRd5w7HHvJNdHBJXVCyE3bXf1tZ/C+D/BePgLu58ALb9QAj6ck4w2+SwQCuVWv55
m4PydJhrVAOolB8xMlJKfGD5TQFmpn8tYl++vEELqAZqc8PpwrXdMv8KyIU0U8Vq+pCj3
5GszsUu1Eh9NjP6Vr5+iKSIi7OfaEOMvjSeCgLZl+TWVmd3tY+UkGfIQPbYCClMfzFSqv
OxoDG1X8LkaQLOWJLkAGJ5ZRAiWj/3O6cG19MqExFsYBeoogUoAzCfPrfSvgS+pyWUw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jMLMrqdr;
arc=none smtp.remote-ip=209.85.128.49
X-Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0F7A606A327
for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 15:33:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F0F7A606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4af520023fdso2774885e9.1
for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 07:33:37 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794497616; x=1795102416; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=rEhQI3hSOE9lI+wJjJwvBECQfjSinYgfuJ/QdhixFTY=;
b=jMLMrqdrw+sf9VotlU3FcMTa96S3NZy1TCicumpr6ODmSsTZMyuvA+ILiUWWR1qRuF
373uxwLJPAZENG6ysZRpyusJXuNW4CIuQ4h2/3GhBk7ZtY+Hqi2dmnQNVz18cEFgXz0n
dS+CM5qBPG67oWoVh0tYOSRNbX2SxhCYWKfdgh5C2ItnfNZyBS3Lt/CNfq16WvWWCh2p
6/fc16B6JIsFxXluBO+yC/AAVXPpkzbarh1WPa160M8tyNgSjZAuBLcec4orXcd7L8Np
H5/MO5WwkylQHs2n13Gs5celfVKXmvV8NJUwwnTNMw0qe6jGa3mXHSekqwRMeS/V90yI
mlmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794497616; x=1795102416;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=rEhQI3hSOE9lI+wJjJwvBECQfjSinYgfuJ/QdhixFTY=;
b=1HtiOsLNlN4obWbd2owKna7j5xom4NxZmO73lml3XedItF+/ocHzidfSxbVFr8lxrN
ST0BdkEOQ6Azi/AOPN/BMSgrNbHb3Bz1RgjhnZ+JzobxeqhVzyIdfHMATfo8jpVGN0eC
JPjoyqGOX+9NhZgb4dq/2pwRh+FsnwqN0z9DIwrgTJcJlANcMUZ1MVnJ2t/71Wdqbqmw
4MDj8omq6m8KMMFRSchHUUs/eZvYIRArWW55eYJDaBDikl1gjiJguzUj1Y0Fs6fdQV/N
qKxWnBw5kaZ7LFI8HvbBucgjyqqdA7YahNMZDCOZ6JmYk4qHtOx85jnw4LelEYwXIuCp
ElVA==
X-Gm-Message-State: APuU4Z8NtSY5f7EuDdvJVGQnzEhq3k4djyg5VvoL+vyxvkrU+rP6OPNw
xveFtBXITmODY17Jo7+0O2xLX7/1UPE1AmJ325qepvR4VQJrA/wP9V9wQVLwglB1
X-Gm-Gg: AYBFou1+dVWEgCR9W1MwjnriwBHDbBJBidkIGxnIcQTEQ1nnk1PC/+LCJkrS0iK9qgp
aL54JAfejTB78h6afmzYpB2H7WSYcoTr7A91WWjxcFEp7Z5L0o4ShBI+f/fc0Miv6NCSRpVh8lZ
ywlJ8QGxAmEU2z0h2KO6y1pLoJFJhluV/3K45exq7AuvuIeVozz2oANM+ktPTrygTEG4hXfh9qK
yFNwkiYtf5OGTUkCKsAp/IBnFrz6JybJCpYb1aDmQcXpBOTBqZq5iunr95e6b8j4gpiOWrJMaYn
nz3UhfpOPG5hcVCDynsxOmcL8l/M3UbxkSTlLkjXXRltRie1g40i1aJk+K++kkB277TJk9tN2tD
N+zqB6HL504rIJ93C2KRh6q/1gaZZymFTkUL17M8cLyUwjZ8ogyh0f5XCqc8mHCwIH77In7HdF+
uu+NEd3PdCgYS95mIpyl/LeBvzMHL+A6RCTihx7UCvCZ2lGrPoRxsLRfVUMYtGPAuHz3vgjm74/
tRE6dJaaIYMXNa40CgJvWA88ueqvuGY2uroF/MGY5FjcIjAiNHxA7PqByIpte2/HvmNan+z+sn6
R5EUTs6svSaajT1AP95U67Wa9Jd7q4Cj3GZr8Q0I4V5rFrRVa/owaXTRFvPGmBj4VoVeLB0RMpg
YJ1TIQf4+pJj7zMEE+wMuBDPy41M+ZGL+YXLROVSuAKD0VD1Bb8QAsNHU/VOAXB4=
X-Received: by 2002:a05:600d:8448:b0:4b6:2242:d0be with SMTP id 5b1f17b1804b1-4ba091a5d00mr85202145e9.0.1794497616053;
Thu, 12 Nov 2026 07:33:36 -0800 (PST)
X-Received: from L-022584.energy.envision.com (dynamic-093-130-172-139.93.130.pool.telefonica.de. [93.130.172.139])
by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba08ddbe68sm229331185e9.0.2026.11.12.07.33.34
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 12 Nov 2026 07:33:35 -0800 (PST)
X-Cc: 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,
xiexinet@gmail.com,
lukma@denx.de,
fmancera@suse.de,
danishanwar@ti.com
X-Mailer: git-send-email 2.47.3
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