Thread (26 messages) 26 messages, 3 authors, 23d ago

Re: [PATCH v2 net-next 04/11] bridge: use BR_ADMIN_COST_BIT

From: Nikolay Aleksandrov <razor@blackwall.org>
Date: 2026-06-03 07:43:06

On 03/06/2026 09:20, Eric Dumazet wrote:
quoted hunk ↗ jump to hunk
Use set_bit() and test_bit() lockless functions.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
  net/bridge/br_if.c     | 2 +-
  net/bridge/br_stp_if.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 3169fab686a534cf2a6458ff228eee2b6fc7e7e4..0bd5cf925fa321b785e3578d6e99d8d7003fa89f 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -75,7 +75,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);
  
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 28c1d3f7e22f6e0a0edd8b3b3f501ea7acc31394..b29dc97b9ad8a5b5c56517d34fe426abd00e2ad6 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -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);
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help