net: dsa: Move FDB dump implementation inside DSA
>From all switchdev devices only DSA requires special FDB dump. This is due to lack of ability for syncing the hardware learned FDBs with the bridge. Due to this it is removed from switchdev and moved inside DSA. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
dc0cbff3ff
commit
2bedde1abb
@@ -801,27 +801,20 @@ qca8k_port_fdb_del(struct dsa_switch *ds, int port,
|
||||
|
||||
static int
|
||||
qca8k_port_fdb_dump(struct dsa_switch *ds, int port,
|
||||
struct switchdev_obj_port_fdb *fdb,
|
||||
switchdev_obj_dump_cb_t *cb)
|
||||
dsa_fdb_dump_cb_t *cb, void *data)
|
||||
{
|
||||
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
|
||||
struct qca8k_fdb _fdb = { 0 };
|
||||
int cnt = QCA8K_NUM_FDB_RECORDS;
|
||||
bool is_static;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&priv->reg_mutex);
|
||||
while (cnt-- && !qca8k_fdb_next(priv, &_fdb, port)) {
|
||||
if (!_fdb.aging)
|
||||
break;
|
||||
|
||||
ether_addr_copy(fdb->addr, _fdb.mac);
|
||||
fdb->vid = _fdb.vid;
|
||||
if (_fdb.aging == QCA8K_ATU_STATUS_STATIC)
|
||||
fdb->ndm_state = NUD_NOARP;
|
||||
else
|
||||
fdb->ndm_state = NUD_REACHABLE;
|
||||
|
||||
ret = cb(&fdb->obj);
|
||||
is_static = (_fdb.aging == QCA8K_ATU_STATUS_STATIC);
|
||||
ret = cb(_fdb.mac, _fdb.vid, is_static, data);
|
||||
if (ret)
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user