diff mbox series

[V3,3/3] net: dsa: ksz: Add STP multicast handling

Message ID 20181215005806.3856-4-marex@denx.de
State Accepted, archived
Delegated to: David Miller
Headers show
Series net: dsa: ksz: Clean up the tag code in prep for more switches | expand

Commit Message

Marek Vasut Dec. 15, 2018, 12:58 a.m. UTC
In case the destination address is link local, add override bit into the
switch tag to let such a packet through the switch even if the port is
blocked.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
V2: New patch
V3: - Replace down with blocked in commit message
    - Add R-B
---
 net/dsa/tag_ksz.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Florian Fainelli Dec. 15, 2018, 1:02 a.m. UTC | #1
On 12/14/18 4:58 PM, Marek Vasut wrote:
> In case the destination address is link local, add override bit into the
> switch tag to let such a packet through the switch even if the port is
> blocked.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Tristram Ha <Tristram.Ha@microchip.com>
> Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> Cc: Woojung Huh <woojung.huh@microchip.com>
> Cc: David S. Miller <davem@davemloft.net>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
index c98b53f691bd..da71b9e2af52 100644
--- a/net/dsa/tag_ksz.c
+++ b/net/dsa/tag_ksz.c
@@ -110,6 +110,10 @@  static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
 	addr = skb_mac_header(nskb);
 
 	*tag = BIT(dp->index);
+
+	if (is_link_local_ether_addr(addr))
+		*tag |= KSZ9477_TAIL_TAG_OVERRIDE;
+
 	*tag = cpu_to_be16(*tag);
 
 	return nskb;