aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-10-11 08:28:57 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-11 08:28:57 -0400
commit5010ea59e1b986d89023c0552fa38e32b519a617 (patch)
tree079695ca71bcde8fcb2b7ce89beec414d64082ce /net
parent6e86ac120e144154d345ebb5839d50b6f713149b (diff)
parent8057b3e7a1cfb4da61717ba609e1ea642bb82f9b (diff)
Merge branch 'dsa-next'
Vivien Didelot says: ==================== net: dsa: push switchdev prepare phase in FDB ops This patchset pushes the switchdev prepare phase for the FDB add and del operations down to the DSA drivers. Currently only mv88e6xxx is affected. Since the dump requires a bit of refactoring in the driver, it'll come in a future patchset. Changes in v2: * forward declare switchdev structs instead of fixing the dsa.h include. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/dsa/slave.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 4f607bc2a845..bb2bd3b56b16 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -346,12 +346,15 @@ static int dsa_slave_port_fdb_add(struct net_device *dev,
346{ 346{
347 struct dsa_slave_priv *p = netdev_priv(dev); 347 struct dsa_slave_priv *p = netdev_priv(dev);
348 struct dsa_switch *ds = p->parent; 348 struct dsa_switch *ds = p->parent;
349 int ret = -EOPNOTSUPP; 349 int ret;
350
351 if (!ds->drv->port_fdb_prepare || !ds->drv->port_fdb_add)
352 return -EOPNOTSUPP;
350 353
351 if (switchdev_trans_ph_prepare(trans)) 354 if (switchdev_trans_ph_prepare(trans))
352 ret = ds->drv->port_fdb_add ? 0 : -EOPNOTSUPP; 355 ret = ds->drv->port_fdb_prepare(ds, p->port, fdb, trans);
353 else 356 else
354 ret = ds->drv->port_fdb_add(ds, p->port, fdb->addr, fdb->vid); 357 ret = ds->drv->port_fdb_add(ds, p->port, fdb, trans);
355 358
356 return ret; 359 return ret;
357} 360}
@@ -364,7 +367,7 @@ static int dsa_slave_port_fdb_del(struct net_device *dev,
364 int ret = -EOPNOTSUPP; 367 int ret = -EOPNOTSUPP;
365 368
366 if (ds->drv->port_fdb_del) 369 if (ds->drv->port_fdb_del)
367 ret = ds->drv->port_fdb_del(ds, p->port, fdb->addr, fdb->vid); 370 ret = ds->drv->port_fdb_del(ds, p->port, fdb);
368 371
369 return ret; 372 return ret;
370} 373}