net: dsa: Change DSA slave FDB API to be switchdev independent

In order to support FDB add/del to be on a notifier chain the slave
API need to be changed to be switchdev independent.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arkadi Sharshevsky
2017-08-06 16:15:39 +03:00
committed by David S. Miller
parent 511aeaf466
commit 6c2c1dcb18
8 changed files with 49 additions and 62 deletions

View File

@@ -94,10 +94,11 @@ static int dsa_switch_fdb_add(struct dsa_switch *ds,
if (!ds->ops->port_fdb_prepare || !ds->ops->port_fdb_add)
return -EOPNOTSUPP;
return ds->ops->port_fdb_prepare(ds, info->port, fdb, trans);
return ds->ops->port_fdb_prepare(ds, info->port, fdb->addr,
fdb->vid);
}
ds->ops->port_fdb_add(ds, info->port, fdb, trans);
ds->ops->port_fdb_add(ds, info->port, fdb->addr, fdb->vid);
return 0;
}
@@ -114,7 +115,8 @@ static int dsa_switch_fdb_del(struct dsa_switch *ds,
if (!ds->ops->port_fdb_del)
return -EOPNOTSUPP;
return ds->ops->port_fdb_del(ds, info->port, fdb);
return ds->ops->port_fdb_del(ds, info->port, fdb->addr,
fdb->vid);
}
static int dsa_switch_mdb_add(struct dsa_switch *ds,