bridge: call netdev_sw_port_stp_update when bridge port STP status changes
To notify switch driver of change in STP state of bridge port, add new .ndo op and provide switchdev wrapper func to call ndo op. Use it in bridge code then. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
aecbe01e74
commit
38dcf357ae
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/rculist.h>
|
||||
#include <net/switchdev.h>
|
||||
|
||||
#include "br_private.h"
|
||||
#include "br_private_stp.h"
|
||||
@@ -38,7 +39,13 @@ void br_log_state(const struct net_bridge_port *p)
|
||||
|
||||
void br_set_state(struct net_bridge_port *p, unsigned int state)
|
||||
{
|
||||
int err;
|
||||
|
||||
p->state = state;
|
||||
err = netdev_switch_port_stp_update(p->dev, state);
|
||||
if (err && err != -EOPNOTSUPP)
|
||||
br_warn(p->br, "error setting offload STP state on port %u(%s)\n",
|
||||
(unsigned int) p->port_no, p->dev->name);
|
||||
}
|
||||
|
||||
/* called under bridge lock */
|
||||
|
Reference in New Issue
Block a user