diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-11-22 16:23:46 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-22 15:35:16 +0000 |
commit | 4592538bfb0d5d3c3c8a1d7071724d081412ac91 (patch) | |
tree | 1e2f934296a6f27c530d2b1de787a43983b64ea0 /drivers | |
parent | c126f118b330ccf0db0dda4a4bd6c729865a205f (diff) | |
download | linux-4592538bfb0d5d3c3c8a1d7071724d081412ac91.tar.bz2 |
net: dsa: qca8k: add support for port fast aging
The switch supports fast aging by flushing any rule in the ARL
table for a specific port.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dsa/qca8k.c | 11 | ||||
-rw-r--r-- | drivers/net/dsa/qca8k.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index bedaaa6b9a1d..d988df913ae0 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -1786,6 +1786,16 @@ qca8k_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *br) QCA8K_PORT_LOOKUP_MEMBER, BIT(cpu_port)); } +static void +qca8k_port_fast_age(struct dsa_switch *ds, int port) +{ + struct qca8k_priv *priv = ds->priv; + + mutex_lock(&priv->reg_mutex); + qca8k_fdb_access(priv, QCA8K_FDB_FLUSH_PORT, port); + mutex_unlock(&priv->reg_mutex); +} + static int qca8k_port_enable(struct dsa_switch *ds, int port, struct phy_device *phy) @@ -1994,6 +2004,7 @@ static const struct dsa_switch_ops qca8k_switch_ops = { .port_stp_state_set = qca8k_port_stp_state_set, .port_bridge_join = qca8k_port_bridge_join, .port_bridge_leave = qca8k_port_bridge_leave, + .port_fast_age = qca8k_port_fast_age, .port_fdb_add = qca8k_port_fdb_add, .port_fdb_del = qca8k_port_fdb_del, .port_fdb_dump = qca8k_port_fdb_dump, diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h index 91c94dfc9789..a533b8cf143b 100644 --- a/drivers/net/dsa/qca8k.h +++ b/drivers/net/dsa/qca8k.h @@ -262,6 +262,7 @@ enum qca8k_fdb_cmd { QCA8K_FDB_FLUSH = 1, QCA8K_FDB_LOAD = 2, QCA8K_FDB_PURGE = 3, + QCA8K_FDB_FLUSH_PORT = 5, QCA8K_FDB_NEXT = 6, QCA8K_FDB_SEARCH = 7, }; |