Skip to content

Commit

Permalink
net: bridge: use switchdev for port flags set through sysfs too
Browse files Browse the repository at this point in the history
commit 8043c84 upstream.

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: 3922285 ("net: bridge: Add support for offloading port attributes")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
vladimiroltean authored and gregkh committed Mar 7, 2021
1 parent 5ab779a commit b742060
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/bridge/br_sysfs_if.c
Expand Up @@ -55,16 +55,19 @@ static BRPORT_ATTR(_name, 0644, \
static int store_flag(struct net_bridge_port *p, unsigned long v,
unsigned long mask)
{
unsigned long flags;

flags = p->flags;
unsigned long flags = p->flags;
int err;

if (v)
flags |= mask;
else
flags &= ~mask;

if (flags != p->flags) {
err = br_switchdev_set_port_flag(p, flags, mask);
if (err)
return err;

p->flags = flags;
br_port_flags_change(p, mask);
}
Expand Down

0 comments on commit b742060

Please sign in to comment.