]> git.ipfire.org Git - thirdparty/openwrt.git/blob
493aea4295472e2b4b7b0adf5e35b00cab446759
[thirdparty/openwrt.git] /
1 From 7168ec1b06691295db6b335e5f5f6c86c7061213 Mon Sep 17 00:00:00 2001
2 From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
3 Date: Tue, 11 Jun 2024 15:54:29 +0200
4 Subject: net: dsa: lantiq_gswip: Use dsa_is_cpu_port() in
5 gswip_port_change_mtu()
6
7 Make the check for the CPU port in gswip_port_change_mtu() consistent
8 with other areas of the driver by using dsa_is_cpu_port().
9
10 Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
11 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
12 Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
13 Signed-off-by: Martin Schiller <ms@dev.tdt.de>
14 Link: https://lore.kernel.org/r/20240611135434.3180973-8-ms@dev.tdt.de
15 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
16 ---
17 drivers/net/dsa/lantiq_gswip.c | 3 +--
18 1 file changed, 1 insertion(+), 2 deletions(-)
19
20 --- a/drivers/net/dsa/lantiq_gswip.c
21 +++ b/drivers/net/dsa/lantiq_gswip.c
22 @@ -1457,12 +1457,11 @@ static int gswip_port_max_mtu(struct dsa
23 static int gswip_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
24 {
25 struct gswip_priv *priv = ds->priv;
26 - int cpu_port = priv->hw_info->cpu_port;
27
28 /* CPU port always has maximum mtu of user ports, so use it to set
29 * switch frame size, including 8 byte special header.
30 */
31 - if (port == cpu_port) {
32 + if (dsa_is_cpu_port(ds, port)) {
33 new_mtu += 8;
34 gswip_switch_w(priv, VLAN_ETH_HLEN + new_mtu + ETH_FCS_LEN,
35 GSWIP_MAC_FLEN);