net: dsa: b53: Fix egress flooding settings
PATCH 1/1 net: dsa: b53: Fix egress flooding settings
There were several issues with 53568438e381 ("net: dsa: b53: Add support for port_egress_floods callback") that resulted in breaking connectivity for standalone ports:
- both user and CPU ports must allow unicast and multicast forwarding by default otherwise this just flat out breaks connectivity for standalone DSA ports
- IP multicast is treated similarly as multicast, but has separate control registers
- the UC, MC and IPMC lookup failure register offsets were wrong, and instead used bit values that are meaningful for the B53_IP_MULTICAST_CTRL register
--- drivers/net/dsa/b53/b53_common.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/net/dsa/b53/b53_common.c +16 -5
@@ -347,7 +347,7 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)* frames should be flooded or not. */ b53_read8 (dev,B53_CTRL_PAGE ,B53_IP_MULTICAST_CTRL , &mgmt); - mgmt |=B53_UC_FWD_EN |B53_MC_FWD_EN ; + mgmt |=B53_UC_FWD_EN |B53_MC_FWD_EN |B53_IPMC_FWD_EN ;b53_write8 (dev,B53_CTRL_PAGE ,B53_IP_MULTICAST_CTRL , mgmt); }
@@ -526,6 +526,8 @@ int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) cpu_port =dsa_to_port (ds, port)->cpu_dp->index; +b53_br_egress_floods (ds, port, true, true); +if (dev->ops->irq_enable) ret = dev->ops->irq_enable (dev, port);if (ret)
@@ -641,6 +643,8 @@ static void b53_enable_cpu_port(struct b53_device *dev, int port)b53_write8 (dev,B53_CTRL_PAGE ,B53_PORT_CTRL (port), port_ctrl);b53_brcm_hdr_setup (dev->ds, port); + +b53_br_egress_floods (dev->ds, port, true, true); }static void b53_enable_mib (struct b53_device *dev)
@@ -1821,19 +1825,26 @@ int b53_br_egress_floods(struct dsa_switch *ds, int port,struct b53_device *dev = ds->priv;u16 uc, mc; -b53_read16 (dev,B53_CTRL_PAGE ,B53_UC_FWD_EN , &uc); +b53_read16 (dev,B53_CTRL_PAGE ,B53_UC_FLOOD_MASK , &uc);if (unicast) uc |=BIT (port);else uc &= ~BIT (port); -b53_write16 (dev,B53_CTRL_PAGE ,B53_UC_FWD_EN , uc); +b53_write16 (dev,B53_CTRL_PAGE ,B53_UC_FLOOD_MASK , uc); + +b53_read16 (dev,B53_CTRL_PAGE ,B53_MC_FLOOD_MASK , &mc); +if (multicast) + mc |=BIT (port); +else + mc &= ~BIT (port); +b53_write16 (dev,B53_CTRL_PAGE ,B53_MC_FLOOD_MASK , mc); -b53_read16 (dev,B53_CTRL_PAGE ,B53_MC_FWD_EN , &mc); +b53_read16 (dev,B53_CTRL_PAGE ,B53_IPMC_FLOOD_MASK , &mc);if (multicast) mc |=BIT (port);else mc &= ~BIT (port); -b53_write16 (dev,B53_CTRL_PAGE ,B53_MC_FWD_EN , mc); +b53_write16 (dev,B53_CTRL_PAGE ,B53_IPMC_FLOOD_MASK , mc);return 0 ;
Signature · 1 line
2.17.1
Quoted 11 lines · Florian Fainelli
There were several issues with
53568438e381("net: dsa: b53: Add support forport_egress_floodscallback") that resulted in breaking connectivity for standalone ports:- both user and CPU ports must allow unicast and multicast forwarding by default otherwise this just flat out breaks connectivity for standalone DSA ports
- IP multicast is treated similarly as multicast, but has separate control registers
- the UC, MC and IPMC lookup failure register offsets were wrong, and instead used bit values that are meaningful for theB53_IP_MULTICAST_CTRLregister
Quoted 2 lines
Fixes 53568438e381 ("net: dsa: b53: Add support for port_egress_floods callback")Signed-off-by Florian Fainelli <[email protected]>
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Fri, 13 Dec 2019 12:00:27 -0800
Quoted 11 lines
There were several issues with
53568438e381("net: dsa: b53: Add support forport_egress_floodscallback") that resulted in breaking connectivity for standalone ports:- both user and CPU ports must allow unicast and multicast forwarding by default otherwise this just flat out breaks connectivity for standalone DSA ports
- IP multicast is treated similarly as multicast, but has separate control registers
- the UC, MC and IPMC lookup failure register offsets were wrong, and instead used bit values that are meaningful for theB53_IP_MULTICAST_CTRLregister
Quoted 2 lines
Fixes 53568438e381 ("net: dsa: b53: Add support for port_egress_floods callback")Signed-off-by Florian Fainelli <[email protected]>
Applied and queued up for v5.4 -stable, thanks.