mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
net: dsa: Remove prepare phase for FDB
The prepare phase for FDB add is unneeded because most of DSA devices can have failures during bus transactions (SPI, I2C, etc.), thus, the prepare phase cannot guarantee success of the commit stage. The support for learning FDB through notification chain, which will be introduced in the following patches, will provide the ability to notify back the bridge about successful offload. 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:
parent
6c2c1dcb18
commit
1b6dd556c3
12 changed files with 36 additions and 108 deletions
|
@ -84,23 +84,15 @@ static int dsa_switch_fdb_add(struct dsa_switch *ds,
|
|||
struct dsa_notifier_fdb_info *info)
|
||||
{
|
||||
const struct switchdev_obj_port_fdb *fdb = info->fdb;
|
||||
struct switchdev_trans *trans = info->trans;
|
||||
|
||||
/* Do not care yet about other switch chips of the fabric */
|
||||
if (ds->index != info->sw_index)
|
||||
return 0;
|
||||
|
||||
if (switchdev_trans_ph_prepare(trans)) {
|
||||
if (!ds->ops->port_fdb_prepare || !ds->ops->port_fdb_add)
|
||||
return -EOPNOTSUPP;
|
||||
if (!ds->ops->port_fdb_add)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return ds->ops->port_fdb_prepare(ds, info->port, fdb->addr,
|
||||
fdb->vid);
|
||||
}
|
||||
|
||||
ds->ops->port_fdb_add(ds, info->port, fdb->addr, fdb->vid);
|
||||
|
||||
return 0;
|
||||
return ds->ops->port_fdb_add(ds, info->port, fdb->addr, fdb->vid);
|
||||
}
|
||||
|
||||
static int dsa_switch_fdb_del(struct dsa_switch *ds,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue