From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.49 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== 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== 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 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 ; Thu, 12 Nov 2026 15:33:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F0F7A606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4af520023fdso2774885e9.1 for ; Thu, 12 Nov 2026 07:33:37 -0800 (PST) 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) 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) From: Xin Xie To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org 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 Subject: [PATCH net v9 0/4] net: hsr: fix super-packet forwarding Date: Thu, 12 Nov 2026 16:33:29 +0100 Message-ID: <20261112153333.20-1-xiexinet@gmail.com> X-Mailer: git-send-email 2.47.3 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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