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>
This commit is contained in:
committed by
David S. Miller
parent
c4f20321d9
commit
3563606258
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user