Skip to content

Commit

Permalink
net: dsa: qca8k: Fix port MTU setting
Browse files Browse the repository at this point in the history
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: f58d259 ("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>
  • Loading branch information
Jonathan McDowell authored and Jakub Kicinski committed Nov 2, 2020
1 parent b6df8c8 commit 99cab71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/dsa/qca8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 99cab71

Please sign in to comment.