πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Mon, 23 Nov 2026 14:51
Re: [PATCH net-next 1/3] net: stmmac: dwmac-sun8i: allow controlling TX and RX flow control separately
#21093
Author: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 14:51
64 lines
10424 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] 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads