diff options
author | Petr Machata <petrm@mellanox.com> | 2018-11-22 23:29:05 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-23 18:02:23 -0800 |
commit | 2b239f678079fd8423c3cd7c5b804abadd2fe898 (patch) | |
tree | 9ed6b0ba6edc42735aea520d8d3adfd9362f5ef8 /net/switchdev/switchdev.c | |
parent | c6fa35b2370aeed280fccbc02ff24b94ab48fcf9 (diff) | |
download | linux-2b239f678079fd8423c3cd7c5b804abadd2fe898.tar.gz linux-2b239f678079fd8423c3cd7c5b804abadd2fe898.tar.bz2 linux-2b239f678079fd8423c3cd7c5b804abadd2fe898.zip |
net: dsa: slave: Handle SWITCHDEV_PORT_OBJ_ADD/_DEL
Following patches will change the way of distributing port object
changes from a switchdev operation to a switchdev notifier. The
switchdev code currently recursively descends through layers of lower
devices, eventually calling the op on a front-panel port device. The
notifier will instead be sent referencing the bridge port device, which
may be a stacking device that's one of front-panel ports uppers, or a
completely unrelated device.
DSA currently doesn't support any other uppers than bridge.
SWITCHDEV_OBJ_ID_HOST_MDB and _PORT_MDB objects are always notified on
the bridge port device. Thus the only case that a stacked device could
be validly referenced by port object notifications are bridge
notifications for VLAN objects added to the bridge itself. But the
driver explicitly rejects such notifications in dsa_port_vlan_add(). It
is therefore safe to assume that the only interesting case is that the
notification is on a front-panel port netdevice. Therefore keep the
filtering by dsa_slave_dev_check() in place.
To handle SWITCHDEV_PORT_OBJ_ADD and _DEL, subscribe to the blocking
notifier chain. Dispatch to rocker_port_obj_add() resp. _del() to
maintain the behavior that the switchdev operation based code currently
has.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions