summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJonathan McDowell <noodles@earth.li>2020-10-30 18:33:15 +0000
committerJakub Kicinski <kuba@kernel.org>2020-11-02 15:14:59 -0800
commit99cab7107d914a71c57f5a4e6d34292425fbbb61 (patch)
tree9470ec8d6641eac446f6cb1eebcc9abde5360d9e /drivers/net
parentb6df8c81412190fbd5eaa3cec7f642142d9c16cd (diff)
downloadlinux-stable-99cab7107d914a71c57f5a4e6d34292425fbbb61.tar.gz
linux-stable-99cab7107d914a71c57f5a4e6d34292425fbbb61.tar.bz2
linux-stable-99cab7107d914a71c57f5a4e6d34292425fbbb61.zip
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: DENG Qingfang <dqfext@gmail.com> Fixes: f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks") Signed-off-by: Jonathan McDowell <noodles@earth.li> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20201030183315.GA6736@earth.li Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/dsa/qca8k.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 53064e0e1618..5bdac669a339 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -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);