Skip to contentSkip to conversation

net: dsa: qca8k: Fix port MTU setting

PATCH Applied Jonathan McDowell 3 participants 3 messages Oct 30, 2020 – Nov 2, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: qca8k: Fix port MTU setting

The qca8k only supports a switch-wide MTU setting, and the code to take the max of all ports was only looking at the port currently being set. Fix to examine all ports.

Fixes f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks")
---
 drivers/net/dsa/qca8k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/qca8k.c +2 -2
index 53064e0e1618..5bdac669a339 100644
@@ -1219,8 +1219,8 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
 	priv->port_mtu[port] = new_mtu;
 
 	for (i = 0; i < QCA8K_NUM_PORTS; i++)
-		if (priv->port_mtu[port] > mtu)
-			mtu = priv->port_mtu[port];
+		if (priv->port_mtu[i] > mtu)
+			mtu = priv->port_mtu[i];
 
 	/* Include L2 header / FCS length */
 	qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN);
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jonathan McDowell

The qca8k only supports a switch-wide MTU setting, and the code to take the max of all ports was only looking at the port currently being set. Fix to examine all ports.

Fixes f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks")

Andrew

maintainer Applied
#2 lore raw
Quoted 11 lines · On Fri, 30 Oct 2020 19:47:33 +0100 Andrew Lunn wrote:
Quoted 8 lines · Jonathan McDowell

The qca8k only supports a switch-wide MTU setting, and the code to take the max of all ports was only looking at the port currently being set. Fix to examine all ports.

Fixes f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks")

Applied, thanks!