🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19551

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

#19551
From: netdev-bot+sashiko
Date: Fri, 20 Nov 2026 02:22
114 lines
11890 bytes
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.

> diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
> index 44f6d9c83180a..5e49f2bb9e39b 100644
> --- a/net/hsr/hsr_forward.c
> +++ b/net/hsr/hsr_forward.c

[ ... ]

> @@ -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);
> +}
> +
> +/* 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?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117141922.20-1-xiexinet%40gmail.com
Technical Details
Message-ID: <179514132368.3136.11119943958824488606@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367564-linux-kernel-netdev=dewy.ru
References: <20261117141922.20-4-xiexinet@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367564-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v10 3/4] net: hsr: segment GSO before per-frame forwarding
Date: Fri, 20 Nov 2026 02:22:03 +0000
Organization: Usenet Network
Message-ID: <179514132368.3136.11119943958824488606@kernel.org>
References: <20261117141922.20-4-xiexinet@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3038687"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pgZNvmpYQnE6hyREYBhgaQu+ivU= sha256:7Msb4TEtZXiZokKAwxB1UUW+jOQqcCmEANj2ScEPWK8=
	sha1:pHrcMny4YhlgF+HtIdRuiv4UvD0= sha256:/ODRuGnddNj4vHd/1i1vUx5R0OdD629bhy+VSJ9A4O0=
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 F2875115866; Fri, 20 Nov 2026 05:22:30 +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 z01P3K9fmg44;
	Fri, 20 Nov 2026 05:22:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367564-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 322BC11584F; Fri, 20 Nov 2026 05:22:19 +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 5FF0C242E7B; Fri, 20 Nov 2026 02:22:08 +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=1795141326;
	b=s5H9FbKfYj7y8f5GilTLYePtcCFHKFhEOO0Uqwdejs1IGVPiAUXYu1aOQrMJuJUD3cI0
	 CjxmcoOP9DepDr5fpRlFaqLXypFXwmQZHkG0TiXCCaWFM93q5SBm22WQUI/DbLx9G9I2C
	 qOw5mrh9eQL6kKlwB7xKnmT6o8jrRMMIW8T3BzySgfP1/u44/euae+IaZBgt8u0eDKUBi
	 NjONv60G2Y1SqN0L8Nukh6EWnNx8sUZRebktbsGz35utcyNtKd2SKtRDVqfbrbqXEZygh
	 uM4cMKXxQ66q+BRNbCT4R8Tl5qwfKRwnwwNHBMMjXSeVGg5LTkDotlGQmeZiyrc+1uQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795141326;
	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=bFBl93slCnnNDRuvqGW5M/JPZcyWyl35W0K2HpRlQYg=;
	b=4uRJnPL7VSuT76b89Mt6N8ffajqXnijIH13cX6d2UKAnHn4qmfEO1Ua/NV+Qil1LxK9Z
	 AoDTU4KQmOMJei1puk9WbiVIln7P7jMOyjBbba8CCFjQQnkDg6ZdpLju8jvqBp4HH09Mi
	 Vcu/65ZoQZCcrt2HW0eY/RU6dm2WVCHPZJbqTCFNNfzyC6HvOFbofQ14qGx/eOI9lkYWv
	 2gQLn3m3dCpp505D9Kt/arsxK2KXE8Ebt1Cp/MPZNoom/F1EH2sRZNiGxm9JxGMtOF3nM
	 dXvyA9Yys/F6JfJMsSlezC4CO10FTrYo3NdM5o9TZJDHFURt8okC9cig+i/BG1/0USw==
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=gG2M71cB;
	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 854CE60A2605;
	Fri, 20 Nov 2026 02:22:06 +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=gG2M71cB
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=1795141325;
	b=WPKTiIVSfaum1RvTi+H7h/MEQ2rY9j3fA/8Rd9goXNcWw6W5u+uxrUnuGtzk71L1gcAD
	 mnamykGFEAzWo6ufJaXGzkQt78TJzco+TbwV7/e1tWUUd0nTEnsLiMGnqOlw9vjE7Wydw
	 YfJG7byZbCjafg5m9TEaIovf0QoIvXAbHLQJuhMcvfK06/Xfn+PC2PPZT8O3u01wb02U7
	 QU5zHR/HbYU/aweCg4AEq965iIx2V6ruFskp7k1o4wFjt0DkB8tVEAZ5NwrH1TYujAyyl
	 /78OWp5HMckOwFyOE8wDuj7wdEDYyE/tp0Mf6m/XI3j3cXHHaMz29vMAVhEhdnTD9ng==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795141325;
	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=bFBl93slCnnNDRuvqGW5M/JPZcyWyl35W0K2HpRlQYg=;
	b=RJCAM5XcVt2YeMY1JdD67Po4pxvSKfhj2NjQObMskI4bgIDMHuGmJVKjHhZB/nQz/iJY
	 jRkRHar+JHGVW+lNU5eYYlRpSpfDNxZ/NAmBnc88P9dApLzV+Qck0A2IfnwZrHkrH6oxf
	 goIPsp4XBKXcfQl57xvEVmP2NFn94k1ZQXSrLRQ/SDvPrT51IdJPzdZvgmumxlFkljZHt
	 7jiGHJ2TnjmMZzaXOaSIoNhIYKAi8OwhfIII5pMS58fMWe5nJgj/eUC+rqJcIRAD1vvvR
	 Plfa9vBcM4qp8xK1LWc9RRMFVCT1K1AyNupXs+FZYVWRu4gjO8aFfiW6C5f48FPiIRg==
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=gG2M71cB;
	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 A6A97606A325;
	Fri, 20 Nov 2026 02:22:05 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18EC01F000E6;
	Fri, 20 Nov 2026 02:22:04 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795141325;
	bh=bFBl93slCnnNDRuvqGW5M/JPZcyWyl35W0K2HpRlQYg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=gG2M71cBscSjViBbxE+PlolahxGfDD9MSXLIULV2JAbTs7dEHHBC+k4DB5BCABl5O
	 O50CbRfQXbcc9ZSTJ1sFGzU5NR63Pac0YVJQjTEiS77Q+nlhVY/1NKhrSkG3ETIBzD
	 wH45SPuBDJfbkVx+cYWcyT4On+Ap9KInZ400A2c5zcTEt6sjjDBCUYUXg7vsFtosQc
	 y7aWkU1HYwIYbO0Ha4am7nkpfd39MWD0lROHuArjo3VRCMbvtcY4LbTzRQ+klvBjR/
	 Um8U4qDa8OpvW6mIo4aqD195OqfqrO21B1WH5D+TNJERK7iRMFMYPr7Bss3aFUshaP
	 2M6An+V217zFw==
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: <20261117141922.20-4-xiexinet@gmail.com>
X-sashiko-severity: Low
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