Patch "net: dsa: tag_brcm: legacy: fix daisy-chained switches" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: dsa: tag_brcm: legacy: fix daisy-chained switches

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-dsa-tag_brcm-legacy-fix-daisy-chained-switches.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 74058c1289af3efd5d5fc8d22b91f41935e293aa
Author: Álvaro Fernández Rojas <noltari@xxxxxxxxx>
Date:   Sun Mar 19 10:55:40 2023 +0100

    net: dsa: tag_brcm: legacy: fix daisy-chained switches
    
    [ Upstream commit 032a954061afd4b7426c3eb6bfd2952ef1e9a384 ]
    
    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@xxxxxxxxx>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@xxxxxxxxxxxxxxx>
    Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230319095540.239064-1-noltari@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index 96dbb8ee2fee1..ed5f68c4f1dad 100644
--- 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(struct sk_buff *skb,
 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(struct sk_buff *skb,
 	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;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux