summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_stp.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-10-14 19:40:50 +0200
committerDavid S. Miller <davem@davemloft.net>2015-10-15 06:09:48 -0700
commit0bc05d585d381c30de3fdf955730df31593d2101 (patch)
tree67c6871b0b123fe73507273b9a50a53f0e0e1010 /net/bridge/br_stp.c
parentf7fadf3047d005d17376da65aa9e5734f45a77d4 (diff)
downloadlinux-0bc05d585d381c30de3fdf955730df31593d2101.tar.bz2
switchdev: allow caller to explicitly request attr_set as deferred
Caller should know if he can call attr_set directly (when holding RTNL) or if he has to defer the att_set processing for later. This also allows drivers to sleep inside attr_set and report operation status back to switchdev core. Switchdev core then warns if status is not ok, instead of silent errors happening in drivers. Benefit from newly introduced switchdev deferred ops infrastructure. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_stp.c')
-rw-r--r--net/bridge/br_stp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index db6d243defb2..80c34d70218c 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -41,13 +41,14 @@ void br_set_state(struct net_bridge_port *p, unsigned int state)
{
struct switchdev_attr attr = {
.id = SWITCHDEV_ATTR_ID_PORT_STP_STATE,
+ .flags = SWITCHDEV_F_DEFER,
.u.stp_state = state,
};
int err;
p->state = state;
err = switchdev_port_attr_set(p->dev, &attr);
- if (err && err != -EOPNOTSUPP)
+ if (err)
br_warn(p->br, "error setting offload STP state on port %u(%s)\n",
(unsigned int) p->port_no, p->dev->name);
}