dpaa2-switch: add support for configuring learning state per port
authorIoana Ciornei <ioana.ciornei@nxp.com>
Mon, 22 Mar 2021 20:58:56 +0000 (22:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2021 23:37:44 +0000 (16:37 -0700)
commit1e7cbabfdb12aa944ae0cb03871f8b55ede1341a
tree5835454d5da8c9ad2d3ccbf3e85e4e28e4286725
parentf054e3e217e40ed343a0cea8c68cc053d40f81bd
dpaa2-switch: add support for configuring learning state per port

Add support for configuring the learning state of a switch port.
When the user requests the HW learning to be disabled, a fast-age
procedure on that specific port is run so that previously learnt
addresses do not linger.

At device probe as well as on a bridge leave action, the ports are
configured with HW learning disabled since they are basically a
standalone port.

At the same time, at bridge join we inherit the bridge port BR_LEARNING
flag state and configure it on the switch port.

There were already some MC firmware ABI functions for changing the
learning state, but those were per FDB (bridging domain) and not per
port so we need to adjust those to use the new MC fw command which is
per port.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
drivers/net/ethernet/freescale/dpaa2/dpsw-cmd.h
drivers/net/ethernet/freescale/dpaa2/dpsw.c
drivers/net/ethernet/freescale/dpaa2/dpsw.h