Skip to content

Commit

Permalink
dpaa2-switch: keep track of the current learning state per port
Browse files Browse the repository at this point in the history
Keep track of the current learning state per port so that we can
reference it in the next patches when setting up a STP state.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ioana Ciornei authored and David S. Miller committed Mar 31, 2021
1 parent 90f0710 commit 62734c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@ static int dpaa2_switch_port_bridge_flags(struct net_device *netdev,
err = dpaa2_switch_port_set_learning(port_priv, learn_ena);
if (err)
return err;
port_priv->learn_ena = learn_ena;
}

if (flags.mask & (BR_BCAST_FLOOD | BR_FLOOD | BR_MCAST_FLOOD)) {
Expand Down Expand Up @@ -1637,6 +1638,7 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev,
/* Inherit the initial bridge port learning state */
learn_ena = br_port_flag_is_set(netdev, BR_LEARNING);
err = dpaa2_switch_port_set_learning(port_priv, learn_ena);
port_priv->learn_ena = learn_ena;

/* Setup the egress flood policy (broadcast, unknown unicast) */
err = dpaa2_switch_fdb_set_egress_flood(ethsw, port_priv->fdb->fdb_id);
Expand Down Expand Up @@ -1719,6 +1721,7 @@ static int dpaa2_switch_port_bridge_leave(struct net_device *netdev)
err = dpaa2_switch_port_set_learning(port_priv, false);
if (err)
return err;
port_priv->learn_ena = false;

/* Add the VLAN 1 as PVID when not under a bridge. We need this since
* the dpaa2 switch interfaces are not capable to be VLAN unaware
Expand Down Expand Up @@ -2839,6 +2842,7 @@ static int dpaa2_switch_probe_port(struct ethsw_core *ethsw,
err = dpaa2_switch_port_set_learning(port_priv, false);
if (err)
goto err_port_probe;
port_priv->learn_ena = false;

return 0;

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct ethsw_port_priv {
struct dpaa2_switch_fdb *fdb;
bool bcast_flood;
bool ucast_flood;
bool learn_ena;

u16 acl_tbl;
};
Expand Down

0 comments on commit 62734c7

Please sign in to comment.