]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bridge: use BR_ADMIN_COST_BIT
authorEric Dumazet <edumazet@google.com>
Thu, 4 Jun 2026 14:13:36 +0000 (14:13 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Jun 2026 00:46:17 +0000 (17:46 -0700)
Use set_bit() and test_bit() lockless functions.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260604141343.2124500-5-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_if.c
net/bridge/br_stp_if.c

index 080e61d2414a2e567e50c33306e76836874fa852..630ca7ac962ac1d10fdba6035476955525e2221c 100644 (file)
@@ -76,7 +76,7 @@ void br_port_carrier_check(struct net_bridge_port *p, bool *notified)
        struct net_device *dev = p->dev;
        struct net_bridge *br = p->br;
 
-       if (!(p->flags & BR_ADMIN_COST) &&
+       if (!test_bit(BR_ADMIN_COST_BIT, &p->flags) &&
            netif_running(dev) && netif_oper_up(dev))
                p->path_cost = port_cost(dev);
 
index 28c1d3f7e22f6e0a0edd8b3b3f501ea7acc31394..b29dc97b9ad8a5b5c56517d34fe426abd00e2ad6 100644 (file)
@@ -340,7 +340,7 @@ int br_stp_set_path_cost(struct net_bridge_port *p, unsigned long path_cost)
            path_cost > BR_MAX_PATH_COST)
                return -ERANGE;
 
-       p->flags |= BR_ADMIN_COST;
+       set_bit(BR_ADMIN_COST_BIT, &p->flags);
        p->path_cost = path_cost;
        br_configuration_update(p->br);
        br_port_state_selection(p->br);