Commit 8043c845 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: bridge: use switchdev for port flags set through sysfs too

Looking through patchwork I don't see that there was any consensus to
use switchdev notifiers only in case of netlink provided port flags but
not sysfs (as a sort of deprecation, punishment or anything like that),
so we should probably keep the user interface consistent in terms of
functionality.

http://patchwork.ozlabs.org/project/netdev/patch/20170605092043.3523-3-jiri@resnulli.us/
http://patchwork.ozlabs.org/project/netdev/patch/20170608064428.4785-3-jiri@resnulli.us/

Fixes: 3922285d ("net: bridge: Add support for offloading port attributes")
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 373e13bc
...@@ -59,9 +59,8 @@ static BRPORT_ATTR(_name, 0644, \ ...@@ -59,9 +59,8 @@ static BRPORT_ATTR(_name, 0644, \
static int store_flag(struct net_bridge_port *p, unsigned long v, static int store_flag(struct net_bridge_port *p, unsigned long v,
unsigned long mask) unsigned long mask)
{ {
unsigned long flags; unsigned long flags = p->flags;
int err;
flags = p->flags;
if (v) if (v)
flags |= mask; flags |= mask;
...@@ -69,6 +68,10 @@ static int store_flag(struct net_bridge_port *p, unsigned long v, ...@@ -69,6 +68,10 @@ static int store_flag(struct net_bridge_port *p, unsigned long v,
flags &= ~mask; flags &= ~mask;
if (flags != p->flags) { if (flags != p->flags) {
err = br_switchdev_set_port_flag(p, flags, mask);
if (err)
return err;
p->flags = flags; p->flags = flags;
br_port_flags_change(p, mask); br_port_flags_change(p, mask);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment