[PATCH net] net: dsa: qca8k: Fix port MTU setting

Subsystems: networking drivers, networking [dsa], the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn, Vladimir Oltean, Linus Torvalds

STALE2184d LANDED

Status: Landed in mainline as 99cab7107d91 on 2020-11-02.

3 messages, 3 authors, 2020-11-02 · open the first message on its own page

[PATCH net] net: dsa: qca8k: Fix port MTU setting

From: Jonathan McDowell <hidden>
Date: 2020-10-30 18:33:29

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")
Cc: <redacted>
Signed-off-by: Jonathan McDowell <redacted>
---
 drivers/net/dsa/qca8k.c | 4 ++--
 1 file 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);
-- 
2.20.1

Re: [PATCH net] net: dsa: qca8k: Fix port MTU setting

From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-10-30 18:47:41

On Fri, Oct 30, 2020 at 06:33:15PM +0000, Jonathan McDowell wrote:
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")
Cc: <redacted>
Signed-off-by: Jonathan McDowell <redacted>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

Re: [PATCH net] net: dsa: qca8k: Fix port MTU setting

From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-11-02 23:17:11

On Fri, 30 Oct 2020 19:47:33 +0100 Andrew Lunn wrote:
On Fri, Oct 30, 2020 at 06:33:15PM +0000, Jonathan McDowell wrote:
quoted
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")
Cc: <redacted>
Signed-off-by: Jonathan McDowell <redacted>  
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help