switchdev: Pass original device to port netdev driver
authorIdo Schimmel <idosch@mellanox.com>
Tue, 15 Dec 2015 15:03:35 +0000 (16:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Dec 2015 16:58:20 +0000 (11:58 -0500)
commit6ff64f6f9242d7e50f3e99cb280f69d1927a5fa6
tree85d9661650c22ab27fe654433360f9e33172f7b9
parent9d547833f02fb8b52ab824adae8f850f3c22fd4f
switchdev: Pass original device to port netdev driver

switchdev drivers need to know the netdev on which the switchdev op was
invoked. For example, the STP state of a VLAN interface configured on top
of a port can change while being member in a bridge. In this case, the
underlying driver should only change the STP state of that particular
VLAN and not of all the VLANs configured on the port.

However, current switchdev infrastructure only passes the port netdev down
to the driver. Solve that by passing the original device down to the
driver as part of the required switchdev object / attribute.

This doesn't entail any change in current switchdev drivers. It simply
enables those supporting stacked devices to know the originating device
and act accordingly.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/switchdev.h
net/bridge/br_fdb.c
net/bridge/br_stp.c
net/bridge/br_stp_if.c
net/bridge/br_vlan.c
net/core/net-sysfs.c
net/core/rtnetlink.c
net/switchdev/switchdev.c