Commit 99cab710 authored by Jonathan McDowell's avatar Jonathan McDowell Committed by Jakub Kicinski

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.
Reported-by: default avatarDENG Qingfang <dqfext@gmail.com>
Fixes: f58d2598 ("net: dsa: qca8k: implement the port MTU callbacks")
Signed-off-by: default avatarJonathan McDowell <noodles@earth.li>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20201030183315.GA6736@earth.liSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b6df8c81
...@@ -1219,8 +1219,8 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) ...@@ -1219,8 +1219,8 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
priv->port_mtu[port] = new_mtu; priv->port_mtu[port] = new_mtu;
for (i = 0; i < QCA8K_NUM_PORTS; i++) for (i = 0; i < QCA8K_NUM_PORTS; i++)
if (priv->port_mtu[port] > mtu) if (priv->port_mtu[i] > mtu)
mtu = priv->port_mtu[port]; mtu = priv->port_mtu[i];
/* Include L2 header / FCS length */ /* Include L2 header / FCS length */
qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN); qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment