From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: peilinhe2020@163.com, he.peilin@zte.com.cn
Cc: alexandre.torgue@foss.st.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, jiang.kun2@zte.com.cn,
kuba@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
mcoquelin.stm32@gmail.com, netdev@vger.kernel.org,
pabeni@redhat.com, vbridgers2013@gmail.com, xu.xin16@zte.com.cn
Subject: Re: [PATCH net v6] net: stmmac: remove software VLAN tag stripping
Date: Sat, 12 Sep 2026 23:35:48 +0200 [thread overview]
Message-ID: <7d72b99f-ca65-4ad4-954c-b3f9d07de523@bootlin.com> (raw)
In-Reply-To: <20260911141126.10592-1-peilinhe2020@163.com>
Hi,
On 9/11/26 16:11, peilinhe2020@163.com wrote:
> From: Peilin He <he.peilin@zte.com.cn>
Eaxh patch should be an independent thread, not a reply to the previous
one.
>
> The software VLAN stripping logic in stmmac_rx_vlan() was originally
> introduced in 2014 by commit b93819854d6e ("stmmac: Add vlan rx for
> better GRO performance.") as a workaround to improve GRO performance,
> since at that time GRO could not handle frames with VLAN tags. However,
> this limitation was resolved in 2015 by commit 66e5133f19e9 ("vlan: Add
> GRO support for non hardware accelerated vlan"), which added GRO support
> for non-hardware-accelerated VLAN frames. Keeping a software fallback
> path for VLAN stripping is no longer necessary and only adds complexity.
>
> Fixes: b93819854d6e ("stmmac: Add vlan rx for better GRO performance.")
> Signed-off-by: Peilin He <he.peilin@zte.com.cn>
> Reviewed-by: xu xin <xu.xin16@zte.com.cn>
> Reviewed-by: Jiang Kun <jiang.kun2@zte.com.cn>
So this patch breaks all the stmmac selftests on some dwmac1000, e.g. on
dwmac-meson8b :
# ethtool -t eth0
[trimming the output to tests that don't report -95, i.e. -EOPNOTSUPP]
The test result is FAIL
The test extra info:
1. MAC Loopback -110
2. MMC Counters -110
3. EEE -110
4. Hash Filter MC -110
8. Flow Control -110
28. Jumbo Frame -110
However I'd say this patch is still correct, what seems to be happening is :
As now we don't have the NETIF_F_HW_VLAN_[C|S]TAG_RX flags set anymore, the
platforms that don't support VLAN offloads end-up skipping this check in
stmmac_phylink_setup() :
if (!(priv->plat->flags & STMMAC_FLAG_RX_CLK_RUNS_IN_LPI) &&
!(priv->dev->features & NETIF_F_VLAN_FEATURES))
config->eee_rx_clk_stop_enable = true;
So if we enter LPI during the selfests, PHY stops rxc, and notoriously on
stmmac if you don't have RXC, half the features don't work, and especially
the DMA RX path.
This is confirmed by running :
# ethtool --set-eee eth0 eee off
# ethtool -t eth0
The test result is PASS
The test extra info:
1. MAC Loopback 0
2. MMC Counters 0
4. Hash Filter MC 0
8. Flow Control 0
28. Jumbo Frame 0
A solution is to block RXC from being disabled in the selftests.
Can you add the following patch to your series, as patch number 1 so
that ethtool selftests still work during bisect ? I've tested it on
the board who'se selftest failed with this patch and it works :)
Thanks,
Maxime
--------------------8x------------------------------------------
From 9e4bea5f2292521997ef6b3814b586a9623993aa Mon Sep 17 00:00:00 2001
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Sat, 12 Sep 2026 23:15:03 +0200
Subject: [PATCH] net: stmmac: selftests: Prevent RXC from being disabled in
LPI
RXC is critical to the RX path and some register banks in stmmac, so
it is blocked from being disabled in LPI when we know we're going
to need that clock.
During selftests, we're in MAC loopback so the PHY may enter LPI and
stop its RXC. This will prevent the RX path from properly receiving
the looped-back packets, hence failing the selftests.
As the NETIF_F_VLAN_FEATURES may be empty on some platforms once the
software vlan stripping is removed, the phylink config attribute
'eee_rx_clk_stop_enable' may no longer be inconditionnally set to
true, hence allowing RXC to be disabled during LPI on platforms
that don't have any VLAN features.
Fixes: 091810dbded9 ("net: stmmac: Introduce selftests support")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
index cd7dc99095a0..982c711a9700 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
@@ -2044,12 +2044,14 @@ void stmmac_selftest_run(struct net_device *dev,
return;
}
+ phylink_rx_clk_stop_block(priv->phylink);
for (i = 0; i < count; i++) {
ret = stmmac_selftests[i].fn(priv);
if (ret && (ret != -EOPNOTSUPP))
etest->flags |= ETH_TEST_FL_FAILED;
buf[i] = ret;
}
+ phylink_rx_clk_stop_unblock(priv->phylink);
stmmac_set_mac_loopback(priv, priv->ioaddr, false);
}
--
2.55.0
next prev parent reply other threads:[~2026-09-12 21:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 0:45 [PATCH net v5] " he.peilin
2026-09-04 7:33 ` Maxime Chevallier
2026-09-11 14:11 ` [PATCH net v6] " peilinhe2020
2026-09-12 21:35 ` Maxime Chevallier [this message]
2026-09-14 14:38 ` peilinhe2020
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=7d72b99f-ca65-4ad4-954c-b3f9d07de523@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=he.peilin@zte.com.cn \
--cc=jiang.kun2@zte.com.cn \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peilinhe2020@163.com \
--cc=vbridgers2013@gmail.com \
--cc=xu.xin16@zte.com.cn \
/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
all inboxes | Powered by JetHome®