Skip to content

Commit 71150d9

Browse files
IoanaCiorneidavem330
authored andcommitted
dpaa2-switch: cleanup the egress flood of an unused FDB
In case a DPAA2 switch interface joins a bridge, the FDB used on the port will be changed to the one associated with the bridge. What this means exactly is that any VLAN installed on the port will need to be removed and then installed back so that it points to the new FDB. Once this is done, the previous FDB will become unused (no VLAN to point to it). Even though no traffic will reach this FDB, it's best to just cleanup the state of the FDB by zeroing its egress flood domain. Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Ioana Ciornei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6d46a4f commit 71150d9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,7 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
20042004
struct netlink_ext_ack *extack)
20052005
{
20062006
struct ethsw_port_priv *port_priv = netdev_priv(netdev);
2007+
struct dpaa2_switch_fdb *old_fdb = port_priv->fdb;
20072008
struct ethsw_core *ethsw = port_priv->ethsw_data;
20082009
bool learn_ena;
20092010
int err;
@@ -2025,6 +2026,11 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
20252026
if (err)
20262027
goto err_egress_flood;
20272028

2029+
/* Recreate the egress flood domain of the FDB that we just left. */
2030+
err = dpaa2_switch_fdb_set_egress_flood(ethsw, old_fdb->fdb_id);
2031+
if (err)
2032+
goto err_egress_flood;
2033+
20282034
err = switchdev_bridge_port_offload(netdev, netdev, NULL,
20292035
NULL, NULL, false, extack);
20302036
if (err)

0 commit comments

Comments
 (0)