[PATCH 4.14 058/148] net: dsa: Fix duplicate frames flooded by learning

From: Greg Kroah-Hartman
Date: Wed Apr 01 2020 - 12:42:53 EST


From: Florian Fainelli <f.fainelli@xxxxxxxxx>

[ Upstream commit 0e62f543bed03a64495bd2651d4fe1aa4bcb7fe5 ]

When both the switch and the bridge are learning about new addresses,
switch ports attached to the bridge would see duplicate ARP frames
because both entities would attempt to send them.

Fixes: 5037d532b83d ("net: dsa: add Broadcom tag RX/TX handler")
Reported-by: Maxime Bizon <mbizon@xxxxxxxxxx>
Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
Reviewed-by: Vivien Didelot <vivien.didelot@xxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
net/dsa/tag_brcm.c | 2 ++
1 file changed, 2 insertions(+)

--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -134,6 +134,8 @@ static struct sk_buff *brcm_tag_rcv(stru

skb->dev = ds->ports[source_port].netdev;

+ skb->offload_fwd_mark = 1;
+
return skb;
}