diff options
author | 2018-05-03 14:43:46 +0200 | |
---|---|---|
committer | 2018-05-03 13:46:47 -0400 | |
commit | 816a3bed9549fcc0c90ba97c9077e64e734f0df6 (patch) | |
tree | eff4b54b648c8b9d7c79d1592a4a18c9a435906f /net/dsa | |
parent | Merge branch 'mlxsw-Introduce-support-for-CQEv1-2' (diff) | |
download | linux-816a3bed9549fcc0c90ba97c9077e64e734f0df6.tar.gz linux-816a3bed9549fcc0c90ba97c9077e64e734f0df6.tar.bz2 linux-816a3bed9549fcc0c90ba97c9077e64e734f0df6.zip |
switchdev: Add fdb.added_by_user to switchdev notifications
The following patch enables sending notifications also for events on FDB
entries that weren't added by the user. Give the drivers the information
necessary to distinguish between the two origins of FDB entries.
To maintain the current behavior, have switchdev-implementing drivers
bail out on notifications about non-user-added FDB entries. In case of
mlxsw driver, allow a call to mlxsw_sp_span_respin() so that SPAN over
bridge catches up with the changed FDB.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index f3fb3a0880b1..c287f1ef964c 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1441,6 +1441,7 @@ static int dsa_slave_switchdev_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct net_device *dev = switchdev_notifier_info_to_dev(ptr); + struct switchdev_notifier_fdb_info *fdb_info = ptr; struct dsa_switchdev_event_work *switchdev_work; if (!dsa_slave_dev_check(dev)) @@ -1458,8 +1459,10 @@ static int dsa_slave_switchdev_event(struct notifier_block *unused, switch (event) { case SWITCHDEV_FDB_ADD_TO_DEVICE: /* fall through */ case SWITCHDEV_FDB_DEL_TO_DEVICE: + if (!fdb_info->added_by_user) + break; if (dsa_slave_switchdev_fdb_work_init(switchdev_work, - ptr)) + fdb_info)) goto err_fdb_work_init; dev_hold(dev); break; |