net: dsa: add port_fdb_dump function

Not all switch chips support a Get Next operation to iterate on its FDB.
So add a more simple port_fdb_dump function for them.

Signed-off-by: Vivien Didelot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Vivien Didelot 2015-10-22 09:34:38 -04:00 • committed by David S. Miller
commit ea70ba9806
2 changed files with 7 additions and 0 deletions

View file

@ -382,6 +382,9 @@ static int dsa_slave_port_fdb_dump(struct net_device *dev,
u16 vid = 0;
int ret;
if (ds->drv->port_fdb_dump)
return ds->drv->port_fdb_dump(ds, p->port, fdb, cb);
if (!ds->drv->port_fdb_getnext)
return -EOPNOTSUPP;