🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3289

Re: [PATCH net v7 2/4] net: hsr: preserve submission order without a forwarding lock

#3289
From: Sebastian Andrzej Siewior
Date: Wed, 14 Oct 2026 15:18
47 lines
9280 bytes
On 2026-10-14 16:48:55 [+0200], Xin Xie wrote:
> > What are stacked HSR devices? Looking from the setup in the referenced
> > report this is a bridge device attached to a HSR ring.
> > An announce frame is sent and this goes to hsr_dev_xmit(). This does not
> > look like a normal setup. Is this something you use or is this something
> > the bot came up with?
> It is the setup from the syzbot report, not something we use. In that
> report the slave port of one HSR device is a bridge, and one bridge
> port is a second HSR device. The announce frame of the first device
> holds its seqnr_lock, goes through the bridge, and ends in
> hsr_dev_xmit() of the second device, which takes its own seqnr_lock.
> Lockdep sees the same lock class twice and reports it. With two
> devices this is not a real deadlock. It only becomes one when the
> transmit path comes back to the same device.

Okay. In that case, could you please teach HSR to reject bridge ports at
the very least?

Given that HSR is a ring and PRP faces two networks, I don't think a
bridge setup would make sense here. So rejecting this should be any easy
fix.

…
> So for v8 I see two simple options:
> (a) Keep seqnr_lock across the submission like today and only break
>     the re-entry: a frame that enters HSR transmit while this CPU is
>     already inside HSR forwarding is dropped and counted. Ordering is
>     kept, but all forwarding of one device stays serialized.
> (b) Narrow the lock to the counter update, as in v6 and in Hangbin's
>     patch [1]. Several CPUs can forward in parallel. A receiver without
>     the bitmap discard can drop a reordered frame, so the patch would
>     carry "Cc: <stable@vger.kernel.org> # aae9d6b616b5: ..." as Simon
>     suggested there, and the TX statistics move to per-CPU counters.
> 
> I would prefer (b) because of the parallel forwarding, if the old
> receiver limitation is acceptable to you. Otherwise (a). 
> 
> Hangbin, Simon, your view is welcome too.
> 
> Patch 3 works with both: it segments before the lock, and each
> segment is numbered and submitted under the lock.

Or (c) tell HSR to reject bridge ports. This should avoid the case and
the problem.

Sebastian
Technical Details
Message-ID: <20261014151838.6RyMIRVM@linutronix.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346332-linux-kernel-netdev=dewy.ru
References: <20261009201324.17-1-xiexinet@gmail.com> <20261009201324.17-3-xiexinet@gmail.com> <20261014134718.YGcKmfB9@linutronix.de> <003d3e2a-3568-44f6-a9cc-3202de60da58@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346332-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v7 2/4] net: hsr: preserve submission order without a
 forwarding lock
Date: Wed, 14 Oct 2026 17:18:38 +0200
Organization: Usenet Network
Message-ID: <20261014151838.6RyMIRVM@linutronix.de>
References: <20261009201324.17-1-xiexinet@gmail.com>
 <20261009201324.17-3-xiexinet@gmail.com>
 <20261014134718.YGcKmfB9@linutronix.de>
 <003d3e2a-3568-44f6-a9cc-3202de60da58@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2330603"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:QmGknLkmpzf5XLw9Xms9xB3ZuiE= sha256:v9S2lIpUMimh/dYfCRcuCRAroymLzoJp/i2TWjW6myM=
	sha1:o3zwoJjyMPb2iYCm6a1xrxTyIrw= sha256:sP12/9VD7Rq6g3N85XmmIPkZ2+lH0okcZkMcHOxqAvo=
Content-Disposition: inline
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 7972D110163; Wed, 14 Oct 2026 19:12:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, 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=linutronix.de header.b=gqP11io2; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=kdapR0i2
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 m1qYDQS02hR3;
	Wed, 14 Oct 2026 19:12:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-346332-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linutronix.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6F8C6110161; Wed, 14 Oct 2026 19:12:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id B78B2378D9; Wed, 14 Oct 2026 15:18:48 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A27C35519A6;
	Wed, 14 Oct 2026 15:18:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gqP11io2";
	dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kdapR0i2"
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9C1353162A;
	Wed, 14 Oct 2026 15:18:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791991126; cv=none; b=I24IIaaQc17RY+EjNmgM5hdCByvC2KCFHE2wy2zZwh+g47MDXtlpZsVYV+eYjrBd2ma6WbvurpQ8CvDmxoAna+JXc4c/2s8nRZMVROKrymySaU5t2euoVp3TreBPXuc4xL8dhEE6ZJ73X9E8rSNgSvitzmYf0Mt0MV+VIOUjKQw=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791991126; c=relaxed/simple;
	bh=wZdjWgb2NT+vzgnTlPr7fPSSVUJ3ymSYaIFCWHLM2ZU=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=UcjFoBZPrPKQ5dvkqOq8Ks8mCXl5Kcz0CrOn0VdEvremhKm09QXzpqVGcy1XJJ7X3tW+Iwn0xgAzCYLI+hxBIvMXG8EFa9WqcjX0mjm1nQWJUoPE1H2JLRoCNQfAjphBBFASwQDma+hgTSJgYV1DDfmJmO/zAT6rg33Z6wfGF3w=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gqP11io2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kdapR0i2; arc=none smtp.client-ip=193.142.43.55
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1791991119;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=3VSLCeFmF65RLXMr+lpZPrtUt8NDrMnmjDiLSUsI+rQ=;
	b=gqP11io2/qEsXWgDGZBxYdXuca8xI8ITMl/bW+oV2F+hzQ348BDGiwjT/SvcsqTJ8vveZL
	4KgXM6m4nTYukmO9uU5cS9JkvPS3z59qGa60iot5Ss3os/M7wagIaC3CmIjXBDQ0ulvMg8
	fK7qWdLtVDZ2bWFQZOh1Q2LfEVkG1+LkapexfuMufvZRmsnwiARcpmBao5KbTn5OjrVFgG
	wmlyX1dieCHSSlvbFAmy0yozlkz3voAHB3NeRmgh/wUR6Jt9ii/FMg72eDbrnPipYq6rgH
	VIPNcPezgDL+XIIRk9gSMZ+5pyfe/iOdLbI6+d/QRHjrZifjXjE66ppQc41Frw==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1791991119;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=3VSLCeFmF65RLXMr+lpZPrtUt8NDrMnmjDiLSUsI+rQ=;
	b=kdapR0i2102at6jWmEphHIl/0nk8fmGunszsqpl9TsVv+k61KxT7nF5tJPm4bRMTE6zyo7
	NyeYbz3rgnJo3AAA==
X-Cc: liuhangbin@gmail.com, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	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, xiaoliang.yang_1@nxp.com, skhawaja@google.com,
	stable@vger.kernel.org, sdf.kernel@gmail.com,
	syzbot+fbf74291c3b7e753b481@syzkaller.appspotmail.com
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <003d3e2a-3568-44f6-a9cc-3202de60da58@gmail.com>