Skip to content

Commit bbe14f5

Browse files
idoschdavem330
authored andcommitted
switchdev: bridge: Check return code is not EOPNOTSUPP
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 <[email protected]> Tested-by: Christian Borntraeger <[email protected]> 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 <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d5d3098 commit bbe14f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/bridge/br_stp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void br_set_state(struct net_bridge_port *p, unsigned int state)
4848

4949
p->state = state;
5050
err = switchdev_port_attr_set(p->dev, &attr);
51-
if (err)
51+
if (err && err != -EOPNOTSUPP)
5252
br_warn(p->br, "error setting offload STP state on port %u(%s)\n",
5353
(unsigned int) p->port_no, p->dev->name);
5454
}

net/bridge/br_stp_if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void br_init_port(struct net_bridge_port *p)
5050
p->config_pending = 0;
5151

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

0 commit comments

Comments
 (0)