summaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-05-10 09:47:51 -0700
committerDavid S. Miller <davem@davemloft.net>2015-05-12 18:43:53 -0400
commit3563606258cf3b8f02eabddb1cb45a94c44d9611 (patch)
treee8c03f3d9274f5dac86490342f9f46016e660113 /net/bridge
parentc4f20321d9680760a291991d77bc5b6d0eb2ed78 (diff)
switchdev: convert STP update to switchdev attr set
STP update is just a settable port attribute, so convert switchdev_port_stp_update to an attr set. For DSA, the prepare phase is skipped and STP updates are only done in the commit phase. This is because currently the DSA drivers don't need to allocate any memory for STP updates and the STP update will not fail to HW (unless something horrible goes wrong on the MDIO bus, in which case the prepare phase wouldn't have been able to predict anyway). Signed-off-by: Scott Feldman <sfeldma@gmail.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_stp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index 28e3f4bc01e0..b9300da31565 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -39,10 +39,14 @@ void br_log_state(const struct net_bridge_port *p)
void br_set_state(struct net_bridge_port *p, unsigned int state)
{
+ struct switchdev_attr attr = {
+ .id = SWITCHDEV_ATTR_PORT_STP_STATE,
+ .stp_state = state,
+ };
int err;
p->state = state;
- err = switchdev_port_stp_update(p->dev, state);
+ err = switchdev_port_attr_set(p->dev, &attr);
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);