diff mbox

net: switchdev: ignore unsupported bridge flags

Message ID 1435069564-10241-1-git-send-email-vivien.didelot@savoirfairelinux.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Vivien Didelot June 23, 2015, 2:26 p.m. UTC
switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
attributes, but a driver doesn't need to implement this in order to get
bridge link information.

So error out only on errors different than -EOPNOTSUPP.

(This is a follow-up patch for 7d4f8d8.)

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/switchdev/switchdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Pirko June 23, 2015, 3:09 p.m. UTC | #1
Tue, Jun 23, 2015 at 04:26:04PM CEST, vivien.didelot@savoirfairelinux.com wrote:
>switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
>attributes, but a driver doesn't need to implement this in order to get
>bridge link information.
>
>So error out only on errors different than -EOPNOTSUPP.
>
>(This is a follow-up patch for 7d4f8d8.)
>
>Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Fixes: 8793d0a664a8 ("switchdev: add new switchdev_port_bridge_getlink")
Acked-by: Jiri Pirko <jiri@resnulli.us>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Scott Feldman June 23, 2015, 4:36 p.m. UTC | #2
On Tue, Jun 23, 2015 at 7:26 AM, Vivien Didelot
<vivien.didelot@savoirfairelinux.com> wrote:
> switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
> attributes, but a driver doesn't need to implement this in order to get
> bridge link information.
>
> So error out only on errors different than -EOPNOTSUPP.
>
> (This is a follow-up patch for 7d4f8d8.)
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Thanks for testing Vivien.

Acked-by: Scott Feldman <sfeldma@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller June 24, 2015, 8:07 a.m. UTC | #3
From: Jiri Pirko <jiri@resnulli.us>
Date: Tue, 23 Jun 2015 17:09:20 +0200

> Tue, Jun 23, 2015 at 04:26:04PM CEST, vivien.didelot@savoirfairelinux.com wrote:
>>switchdev_port_bridge_getlink() queries SWITCHDEV_ATTR_PORT_BRIDGE_FLAGS
>>attributes, but a driver doesn't need to implement this in order to get
>>bridge link information.
>>
>>So error out only on errors different than -EOPNOTSUPP.
>>
>>(This is a follow-up patch for 7d4f8d8.)
>>
>>Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> 
> Fixes: 8793d0a664a8 ("switchdev: add new switchdev_port_bridge_getlink")
> Acked-by: Jiri Pirko <jiri@resnulli.us>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index f01d340..84f77a0 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -532,7 +532,7 @@  int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 	int err;
 
 	err = switchdev_port_attr_get(dev, &attr);
-	if (err)
+	if (err && err != -EOPNOTSUPP)
 		return err;
 
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode,