aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-01-19 16:00:17 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-19 16:00:17 +0100
commitd82f28726f6c1bae7f696b57d9d93303d6b7a021 (patch)
tree528daf594b5531bd1b698784148dd2c0106b4032
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next (diff)
parentnet: dsa: felix: Allow PHY to AN 10/100/1000 with 2500 serdes link (diff)
downloadwireguard-linux-d82f28726f6c1bae7f696b57d9d93303d6b7a021.tar.xz
wireguard-linux-d82f28726f6c1bae7f696b57d9d93303d6b7a021.zip
Merge branch 'Rate-adaptation-for-Felix-DSA-switch'
Vladimir Oltean says: ==================== Rate adaptation for Felix DSA switch When operating the MAC at 2.5Gbps (2500Base-X and USXGMII/QSXGMII) and in combination with certain PHYs, it is possible that the copper side may operate at lower link speeds. In this case, it is the PHY who has a MAC inside of it that emits pause frames towards the switch's MAC, telling it to slow down so that the transmission is lossless. These patches are the support needed for the switch side of things to work. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/ocelot/felix.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 269cc6953d47..3257962c147e 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -172,11 +172,10 @@ static void felix_phylink_validate(struct dsa_switch *ds, int port,
phylink_set(mask, Autoneg);
phylink_set(mask, Pause);
phylink_set(mask, Asym_Pause);
- if (state->interface != PHY_INTERFACE_MODE_2500BASEX) {
- phylink_set(mask, 10baseT_Full);
- phylink_set(mask, 100baseT_Full);
- phylink_set(mask, 1000baseT_Full);
- }
+ phylink_set(mask, 10baseT_Full);
+ phylink_set(mask, 100baseT_Full);
+ phylink_set(mask, 1000baseT_Full);
+
/* The internal ports that run at 2.5G are overclocked GMII */
if (state->interface == PHY_INTERFACE_MODE_GMII ||
state->interface == PHY_INTERFACE_MODE_2500BASEX ||
@@ -222,8 +221,12 @@ static void felix_phylink_mac_config(struct dsa_switch *ds, int port,
* specification in incoming pause frames.
*/
mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(state->speed);
- if (state->pause & MLO_PAUSE_RX)
- mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA;
+
+ /* handle Rx pause in all cases, with 2500base-X this is used for rate
+ * adaptation.
+ */
+ mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA;
+
if (state->pause & MLO_PAUSE_TX)
mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA |
SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) |