summaryrefslogtreecommitdiff
path: root/net/dsa/switch.c
diff options
context:
space:
mode:
authorArkadi Sharshevsky <arkadis@mellanox.com>2017-08-06 16:15:40 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-07 14:48:47 -0700
commit1b6dd556c3045ca5fa31cc1e98a4a43afa680e1e (patch)
tree157769b86c0cba693eddb32f7a98c64f7e5c806d /net/dsa/switch.c
parent6c2c1dcb185f1e44e1c895781dbaba40195234f9 (diff)
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>
Diffstat (limited to 'net/dsa/switch.c')
-rw-r--r--net/dsa/switch.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index a9edfbad3889..eb20e0fee0e1 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -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;
-
- 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);
+ if (!ds->ops->port_fdb_add)
+ return -EOPNOTSUPP;
- 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,