]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: integrate with SWITCHDEV for HW bridging
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 24 Feb 2015 21:15:33 +0000 (13:15 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Feb 2015 22:03:38 +0000 (17:03 -0500)
commitcafabe61aaae784a065a5fca60160fb43d0b76bf
tree829c9c90cffe94d00a1a7ee568c9464fdcf0efae
parent7b9415d9050b8be5061db4c475f9befa1bbb8a5e
net: dsa: integrate with SWITCHDEV for HW bridging

In order to support bridging offloads in DSA switch drivers, select
NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
NDOs that we are required to implement.

To facilitate the integratation at the DSA driver level, we implement 3
types of operations:

- port_join_bridge
- port_leave_bridge
- port_stp_update

DSA will resolve which switch ports that are currently bridge port
members as some Switch hardware/drivers need to know about that to limit
the register programming to just the relevant registers (especially for
slow MDIO buses).

We also take care of setting the correct STP state when slave network
devices are brought up/down while being bridge members.

Finally, when a port is leaving the bridge, we make sure we set in
BR_STATE_FORWARDING state, otherwise the bridge layer would leave it
disabled as a result of having left the bridge.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/Kconfig
net/dsa/dsa.c
net/dsa/dsa_priv.h
net/dsa/slave.c