switchdev: bridge: Check return code is not EOPNOTSUPP
authorIdo Schimmel <idosch@mellanox.com>
Fri, 13 Nov 2015 11:06:12 +0000 (13:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Nov 2015 19:56:03 +0000 (14:56 -0500)
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: 0bc05d585d38 ("switchdev: allow caller to explicitly request
attr_set as deferred")
Fixes: 6ac311ae8bfb ("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>
net/bridge/br_stp.c
net/bridge/br_stp_if.c

index f7e8dee64fc80ec04152788c945dea1b346b3dcd..5f3f6455317924e0e74281d23075d2af68d72d73 100644 (file)
@@ -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);
 }
index fa53d7a89f485ac9039b6168db3063512c4d9d42..5396ff08af3215d1a532b853c8859fb64dfc6a1f 100644 (file)
@@ -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");
 }