summaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorArkadi Sharshevsky <arkadis@mellanox.com>2017-08-06 15:15:40 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-07 23:48:47 +0200
commit1b6dd556c3045ca5fa31cc1e98a4a43afa680e1e (patch)
tree157769b86c0cba693eddb32f7a98c64f7e5c806d /net/dsa/slave.c
parentnet: dsa: Change DSA slave FDB API to be switchdev independent (diff)
downloadlinux-1b6dd556c3045ca5fa31cc1e98a4a43afa680e1e.tar.xz
linux-1b6dd556c3045ca5fa31cc1e98a4a43afa680e1e.zip
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/slave.c')
-rw-r--r--net/dsa/slave.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 3b36c47472c6..bb7ab26ef768 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -251,7 +251,9 @@ static int dsa_slave_port_obj_add(struct net_device *dev,
switch (obj->id) {
case SWITCHDEV_OBJ_ID_PORT_FDB:
- err = dsa_port_fdb_add(dp, SWITCHDEV_OBJ_PORT_FDB(obj), trans);
+ if (switchdev_trans_ph_prepare(trans))
+ return 0;
+ err = dsa_port_fdb_add(dp, SWITCHDEV_OBJ_PORT_FDB(obj));
break;
case SWITCHDEV_OBJ_ID_PORT_MDB:
err = dsa_port_mdb_add(dp, SWITCHDEV_OBJ_PORT_MDB(obj), trans);