Re: [PATCH net-next 1/3] net: stmmac: dwmac-sun8i: allow controlling TX and RX flow control separately
From: netdev-bot+sashiko
Date: Mon Nov 23 2026 - 09:52:07 EST
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] In drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c, the commit
message for sun8i_dwmac_flow_ctrl() presents the change as a new…
--
net: stmmac: dwmac-sun8i: allow controlling TX and RX flow control separately
This changes sun8i_dwmac_flow_ctrl() in dwmac-sun8i.c to test the FLOW_RX
and FLOW_TX bits on their own. Before, it only enabled
EMAC_RX_FLOW_CTL_EN and EMAC_TX_FLOW_CTL_EN when fc == FLOW_AUTO.
> Currently, the sun8i flow control setup only looks at FLOW_AUTO (which
> is FLOW_RX | FLOW_TX), and enables RX/TX based on that.
>
> Allow enabling RX/TX flow control directions separately.
[Severity: Low]
Would this be better described as a fix than as a new capability?
Since commit 9cb54af214a7 ("net: stmmac: Fix IP-cores specific MAC
capabilities"), sun8i_dwmac_setup() advertises asymmetric pause to
phylink:
mac->link.caps = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000;
When pause resolves asymmetrically, stmmac_mac_link_up() passes a single
direction:
if (rx_pause && tx_pause)
flow_ctrl = FLOW_AUTO;
else if (rx_pause && !tx_pause)
flow_ctrl = FLOW_RX;
else if (!rx_pause && tx_pause)
flow_ctrl = FLOW_TX;
With the old fc == FLOW_AUTO test in sun8i_dwmac_flow_ctrl(), FLOW_RX or
FLOW_TX alone cleared both EMAC_RX_FLOW_CTL_EN and EMAC_TX_FLOW_CTL_EN.
Phylink and ethtool -a still reported pause as active.
There are two ways to reach the rx-only case:
- The link partner advertises only Asym_Pause, so linkmode_resolve_pause()
gives rx_pause=1 and tx_pause=0.
- The admin runs "ethtool -A ethX autoneg off rx on tx off".
In that case the MAC ignores the partner's PAUSE frames.
Should the commit message say that this fixes that behaviour, and add a
tag like this one?
Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
That would let the stable maintainers consider it for backporting.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122144926.284857-1-maxime.chevallier%40bootlin.com