aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.15
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2023-03-25 10:33:06 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2023-03-25 10:33:06 +0100
commit21b89b06478c65122462813dcc3fe8bbb49cc53d (patch)
treef13bd5cff0d9b7401bd7a5dca2bb4d1c39f84dcc /target/linux/generic/backport-5.15
parent67c28dde09b4ab370971b58e330842247cef0d99 (diff)
downloadupstream-21b89b06478c65122462813dcc3fe8bbb49cc53d.tar.gz
upstream-21b89b06478c65122462813dcc3fe8bbb49cc53d.tar.bz2
upstream-21b89b06478c65122462813dcc3fe8bbb49cc53d.zip
kernel: backport dsa b53 patches
These patches have been merged upstream, so let's move them to backport. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.15')
-rw-r--r--target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-fix-device-tree-support.patch30
-rw-r--r--target/linux/generic/backport-5.15/743-v6.3-0006-net-dsa-tag_brcm-legacy-fix-daisy-chained-switches.patch65
2 files changed, 95 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-fix-device-tree-support.patch b/target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-fix-device-tree-support.patch
new file mode 100644
index 0000000000..8c277e6a3e
--- /dev/null
+++ b/target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-fix-device-tree-support.patch
@@ -0,0 +1,30 @@
+From 30796d0dcb6e41c6558a07950f2ce60c209da867 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Thu, 16 Mar 2023 18:28:07 +0100
+Subject: [PATCH] net: dsa: b53: mmap: fix device tree support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CPU port should also be enabled in order to get a working switch.
+
+Fixes: a5538a777b73 ("net: dsa: b53: mmap: Add device tree support")
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/20230316172807.460146-1-noltari@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/dsa/b53/b53_mmap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/dsa/b53/b53_mmap.c
++++ b/drivers/net/dsa/b53/b53_mmap.c
+@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct plat
+ if (of_property_read_u32(of_port, "reg", &reg))
+ continue;
+
+- if (reg < B53_CPU_PORT)
++ if (reg < B53_N_PORTS)
+ pdata->enabled_ports |= BIT(reg);
+ }
+
diff --git a/target/linux/generic/backport-5.15/743-v6.3-0006-net-dsa-tag_brcm-legacy-fix-daisy-chained-switches.patch b/target/linux/generic/backport-5.15/743-v6.3-0006-net-dsa-tag_brcm-legacy-fix-daisy-chained-switches.patch
new file mode 100644
index 0000000000..fdefa9ffb6
--- /dev/null
+++ b/target/linux/generic/backport-5.15/743-v6.3-0006-net-dsa-tag_brcm-legacy-fix-daisy-chained-switches.patch
@@ -0,0 +1,65 @@
+From 032a954061afd4b7426c3eb6bfd2952ef1e9a384 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Sun, 19 Mar 2023 10:55:40 +0100
+Subject: [PATCH] net: dsa: tag_brcm: legacy: fix daisy-chained switches
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When BCM63xx internal switches are connected to switches with a 4-byte
+Broadcom tag, it does not identify the packet as VLAN tagged, so it adds one
+based on its PVID (which is likely 0).
+Right now, the packet is received by the BCM63xx internal switch and the 6-byte
+tag is properly processed. The next step would to decode the corresponding
+4-byte tag. However, the internal switch adds an invalid VLAN tag after the
+6-byte tag and the 4-byte tag handling fails.
+In order to fix this we need to remove the invalid VLAN tag after the 6-byte
+tag before passing it to the 4-byte tag decoding.
+
+Fixes: 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags")
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/20230319095540.239064-1-noltari@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ net/dsa/tag_brcm.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/net/dsa/tag_brcm.c
++++ b/net/dsa/tag_brcm.c
+@@ -7,6 +7,7 @@
+
+ #include <linux/dsa/brcm.h>
+ #include <linux/etherdevice.h>
++#include <linux/if_vlan.h>
+ #include <linux/list.h>
+ #include <linux/slab.h>
+
+@@ -248,6 +249,7 @@ static struct sk_buff *brcm_leg_tag_xmit
+ static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
+ struct net_device *dev)
+ {
++ int len = BRCM_LEG_TAG_LEN;
+ int source_port;
+ u8 *brcm_tag;
+
+@@ -262,12 +264,16 @@ static struct sk_buff *brcm_leg_tag_rcv(
+ if (!skb->dev)
+ return NULL;
+
++ /* VLAN tag is added by BCM63xx internal switch */
++ if (netdev_uses_dsa(skb->dev))
++ len += VLAN_HLEN;
++
+ /* Remove Broadcom tag and update checksum */
+- skb_pull_rcsum(skb, BRCM_LEG_TAG_LEN);
++ skb_pull_rcsum(skb, len);
+
+ dsa_default_offload_fwd_mark(skb);
+
+- dsa_strip_etype_header(skb, BRCM_LEG_TAG_LEN);
++ dsa_strip_etype_header(skb, len);
+
+ return skb;
+ }