Skip to content

Commit

Permalink
switchdev: bridge: Check return code is not EOPNOTSUPP
Browse files Browse the repository at this point in the history
When NET_SWITCHDEV=n, switchdev_port_attr_set simply returns EOPNOTSUPP.
In this case we should not emit errors and warnings to the kernel log.

Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: 0bc05d5 ("switchdev: allow caller to explicitly request
attr_set as deferred")
Fixes: 6ac311a ("Adding switchdev ageing notification on port
bridged")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Nov 16, 2015
1 parent d5d3098 commit bbe14f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/bridge/br_stp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void br_set_state(struct net_bridge_port *p, unsigned int state)

p->state = state;
err = switchdev_port_attr_set(p->dev, &attr);
if (err)
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);
}
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br_stp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void br_init_port(struct net_bridge_port *p)
p->config_pending = 0;

err = switchdev_port_attr_set(p->dev, &attr);
if (err)
if (err && err != -EOPNOTSUPP)
netdev_err(p->dev, "failed to set HW ageing time\n");
}

Expand Down

0 comments on commit bbe14f5

Please sign in to comment.