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>
This commit is contained in:

committed by
David S. Miller

parent
0e913f28ba
commit
816a3bed95
@@ -2270,6 +2270,8 @@ static void mlxsw_sp_switchdev_event_work(struct work_struct *work)
|
||||
switch (switchdev_work->event) {
|
||||
case SWITCHDEV_FDB_ADD_TO_DEVICE:
|
||||
fdb_info = &switchdev_work->fdb_info;
|
||||
if (!fdb_info->added_by_user)
|
||||
break;
|
||||
err = mlxsw_sp_port_fdb_set(mlxsw_sp_port, fdb_info, true);
|
||||
if (err)
|
||||
break;
|
||||
@@ -2279,6 +2281,8 @@ static void mlxsw_sp_switchdev_event_work(struct work_struct *work)
|
||||
break;
|
||||
case SWITCHDEV_FDB_DEL_TO_DEVICE:
|
||||
fdb_info = &switchdev_work->fdb_info;
|
||||
if (!fdb_info->added_by_user)
|
||||
break;
|
||||
mlxsw_sp_port_fdb_set(mlxsw_sp_port, fdb_info, false);
|
||||
break;
|
||||
case SWITCHDEV_FDB_ADD_TO_BRIDGE: /* fall through */
|
||||
|
@@ -2783,6 +2783,8 @@ static int rocker_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;
|
||||
memcpy(&switchdev_work->fdb_info, ptr,
|
||||
sizeof(switchdev_work->fdb_info));
|
||||
switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC);
|
||||
|
Reference in New Issue
Block a user