Skip to contentSkip to conversation

net: dsa: microchip: add switch offload forwarding support

PATCH Applied [email protected] 2 participants 2 messages Feb 8, 2019 – Feb 11, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: microchip: add switch offload forwarding support

From: Tristram Ha <[email protected]>

The flag offload_fwd_mark is set as the switch can forward frames by itself.

This can be considered a fix to a problem introduced in commit c2e866911e254067 where the port membership are not set in sync. The flag offload_fwd_mark just needs to be set in tag_ksz.c to prevent the software bridge from forwarding duplicate multicast frames.

Fixes c2e866911e254067 ("microchip: break KSZ9477 DSA driver into two files")
---
 drivers/net/dsa/microchip/ksz9477.c | 7 ++++---
 net/dsa/tag_ksz.c                   | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/dsa/microchip/ksz9477.c +4 -3
index 89ed059..674d77e 100644
@@ -397,6 +397,7 @@ static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port,
 	struct ksz_port *p = &dev->ports[port];
 	u8 data;
 	int member = -1;
+	int forward = dev->member;
 
 	ksz_pread8(dev, port, P_STP_CTRL, &data);
 	data &= ~(PORT_TX_ENABLE | PORT_RX_ENABLE | PORT_LEARN_DISABLE);
@@ -464,10 +465,10 @@ static void ksz9477_port_stp_state_set(struct dsa_switch *ds, int port,
 	}
 
 	/* When topology has changed the function ksz_update_port_member
-	 * should be called to modify port forwarding behavior.  However
-	 * as the offload_fwd_mark indication cannot be reported here
-	 * the switch forwarding function is not enabled.
+	 * should be called to modify port forwarding behavior.
 	 */
+	if (forward != dev->member)
+		ksz_update_port_member(dev, port);
 }
 
 static void ksz9477_flush_dyn_mac_table(struct ksz_device *dev, int port)
net/dsa/tag_ksz.c +2 -0
index da71b9e..927e9c8 100644
@@ -67,6 +67,8 @@ static struct sk_buff *ksz_common_rcv(struct sk_buff *skb,
 
 	pskb_trim_rcsum(skb, skb->len - len);
 
+	skb->offload_fwd_mark = true;
+
 	return skb;
 }
 
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw

From: <[email protected]>
Date: Thu, 7 Feb 2019 20:05:58 -0800

Quoted 5 lines

From: Tristram Ha <[email protected]>

The flag offload_fwd_mark is set as the switch can forward frames by itself.

Quoted 7 lines

This can be considered a fix to a problem introduced in commit c2e866911e254067 where the port membership are not set in sync. The flag offload_fwd_mark just needs to be set in tag_ksz.c to prevent the software bridge from forwarding duplicate multicast frames.

Fixes c2e866911e254067 ("microchip: break KSZ9477 DSA driver into two files")

Applied, thank you.