mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 1/2] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed
       [not found] <20261021191035.751684-1-florian.fainelli@broadcom.com>
@ 2026-10-21 19:10 ` Florian Fainelli
  2026-10-21 19:10 ` [PATCH net 2/2] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Florian Fainelli
  1 sibling, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2026-10-21 19:10 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Jonas Gorski, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rafał Miłecki, Broadcom internal kernel review list,
	Russell King, Jon Mason, Arnd Bergmann, open list

Northstar and Northstar Plus use a 2.5 Gbps internal link between the
AMAC and the switch.  BGMAC_FEAT_FORCE_SPEED_2500 makes bgmac_miiconfig()
configure that speed, but bgmac_adjust_link() subsequently replaces it
with the synthetic fixed PHY's 1 Gbps speed.

Use the forced speed when processing link changes so the MAC remains at
2.5 Gbps.  Together with configuring the switch IMP port for its 2 Gbps
mode, this eliminates the output queue discards that caused approximately
1000 TCP retransmissions per second during an iperf3 transmit test.

Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 1835266fdd09..7079228e70c0 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1415,11 +1415,15 @@ void bgmac_adjust_link(struct net_device *net_dev)
 {
 	struct bgmac *bgmac = netdev_priv(net_dev);
 	struct phy_device *phy_dev = net_dev->phydev;
+	int speed = phy_dev->speed;
 	bool update = false;
 
+	if (bgmac->feature_flags & BGMAC_FEAT_FORCE_SPEED_2500)
+		speed = SPEED_2500;
+
 	if (phy_dev->link) {
-		if (phy_dev->speed != bgmac->mac_speed) {
-			bgmac->mac_speed = phy_dev->speed;
+		if (speed != bgmac->mac_speed) {
+			bgmac->mac_speed = speed;
 			update = true;
 		}
 
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH net 2/2] net: dsa: b53: restore the NSP IMP port 2 Gbps mode
       [not found] <20261021191035.751684-1-florian.fainelli@broadcom.com>
  2026-10-21 19:10 ` [PATCH net 1/2] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Florian Fainelli
@ 2026-10-21 19:10 ` Florian Fainelli
  1 sibling, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2026-10-21 19:10 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Jonas Gorski, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rafał Miłecki, Broadcom internal kernel review list,
	Russell King, Jon Mason, Arnd Bergmann, open list

The Northstar Plus IMP port uses the switch's proprietary 2 Gbps mode for
its internal link to the AMAC.  Its fixed-link description reports 1 Gbps,
so applying that speed clears PORT_OVERRIDE_SPEED_2000M and leaves the two
ends of the internal link configured at different speeds.

Force the 2 Gbps mode and flow control for BCM5301x and NSP CPU ports.  The
mismatch caused switch output queue discards on both copper and SerDes
ports, with one discard for every TCP retransmission.  With both ends
restored to their high-speed modes, iperf3 reports no retransmissions.

Fixes: b6a8a5477fe9 ("net: dsa: b53: fix resetting speed and pause on forced link")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/net/dsa/b53/b53_common.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 172ada124cbf..5c7d7b210347 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1643,10 +1643,13 @@ static void b53_phylink_mac_link_up(struct phylink_config *config,
 	if (!b53_phylink_mac_needs_override(dev, port, mode, interface))
 		return;
 
-	/* Force flow control on BCM5301x's CPU port */
-	if (mode == MLO_AN_FIXED && is5301x(dev) && dsa_is_cpu_port(ds, port)) {
+	/* Force flow control on BCM5301x and NSP CPU ports */
+	if (mode == MLO_AN_FIXED &&
+	    (is5301x(dev) || dev->chip_id == BCM58XX_DEVICE_ID) &&
+	    dsa_is_cpu_port(ds, port)) {
 		tx_pause = true;
 		rx_pause = true;
+		speed = 2000;
 	}
 
 	/* PCS negotiation supplies state; the MAC applies phylink's policy. */
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-21 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20261021191035.751684-1-florian.fainelli@broadcom.com>
2026-10-21 19:10 ` [PATCH net 1/2] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Florian Fainelli
2026-10-21 19:10 ` [PATCH net 2/2] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Florian Fainelli

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®