Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: xiexinet@gmail.com
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
Subject: Re: [PATCH net v10 3/4] net: hsr: segment GSO before per-frame forwarding
Date: Fri, 20 Nov 2026 02:22:03 +0000	[thread overview]
Message-ID: <179514132368.3136.11119943958824488606@kernel.org> (raw)
In-Reply-To: <20261117141922.20-4-xiexinet@gmail.com>

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

  reply	other threads:[~2026-11-20  2:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 14:19 [PATCH net v10 0/4] net: hsr: fix super-packet forwarding Xin Xie
2026-11-17 14:19 ` [PATCH net v10 1/4] net: hsr: keep GRO disabled on HSR/PRP ports Xin Xie
2026-11-20  2:22   ` netdev-bot+sashiko
2026-11-17 14:19 ` [PATCH net v10 2/4] net: hsr: refuse forwarding devices as " Xin Xie
2026-11-20  2:22   ` netdev-bot+sashiko
2026-11-17 14:19 ` [PATCH net v10 3/4] net: hsr: segment GSO before per-frame forwarding Xin Xie
2026-11-20  2:22   ` netdev-bot+sashiko [this message]
2026-11-17 14:19 ` [PATCH net v10 4/4] selftests: net: hsr: verify GRO policy and ordered forwarding Xin Xie
2026-11-20  2:22   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179514132368.3136.11119943958824488606@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fmancera@suse.de \
    --cc=fmaurer@redhat.com \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=luka.gejak@linux.dev \
    --cc=lukma@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petr.wozniak@gmail.com \
    --cc=qingfang.deng@linux.dev \
    --cc=sdf.kernel@gmail.com \
    --cc=shuah@kernel.org \
    --cc=skhawaja@google.com \
    --cc=stable@vger.kernel.org \
    --cc=xiaoliang.yang_1@nxp.com \
    --cc=xiexinet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox