Skip to content

Commit e31a11b

Browse files
WeiFang-NXPkuba-moo
authored andcommitted
net: phylink: add missing supported link modes for the fixed-link
Pause, Asym_Pause and Autoneg bits are not set when pl->supported is initialized, so these link modes will not work for the fixed-link. This leads to a TCP performance degradation issue observed on the i.MX943 platform. The switch CPU port of i.MX943 is connected to an ENETC MAC, this link is a fixed link and the link speed is 2.5Gbps. And one of the switch user ports is the RGMII interface, and its link speed is 1Gbps. If the flow-control of the fixed link is not enabled, we can easily observe the iperf performance of TCP packets is very low. Because the inbound rate on the CPU port is greater than the outbound rate on the user port, the switch is prone to congestion, leading to the loss of some TCP packets and requiring multiple retransmissions. Solving this problem should be as simple as setting the Asym_Pause and Pause bits. The reason why the Autoneg bit needs to be set, Russell has gave a very good explanation in the thread [1], see below. "As the advertising and lp_advertising bitmasks have to be non-empty, and the swphy reports aneg capable, aneg complete, and AN enabled, then for consistency with that state, Autoneg should be set. This is how it was prior to the blamed commit." Fixes: de7d3f8 ("net: phylink: Use phy_caps_lookup for fixed-link configuration") Link: https://lore.kernel.org/aRjqLN8eQDIQfBjS@shell.armlinux.org.uk # [1] Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20251117102943.1862680-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 106a674 commit e31a11b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/phy/phylink.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,9 @@ static int phylink_validate(struct phylink *pl, unsigned long *supported,
637637

638638
static void phylink_fill_fixedlink_supported(unsigned long *supported)
639639
{
640+
linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, supported);
641+
linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, supported);
642+
linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, supported);
640643
linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, supported);
641644
linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, supported);
642645
linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, supported);

0 commit comments

Comments
 (0)