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

Re: [PATCH net-next 06/11] bridge: provide lockless access to p->designated_cost

From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-05-24 12:50:33

On Thu, May 21, 2026 at 01:19:11PM +0000, Eric Dumazet wrote:
quoted hunk ↗ jump to hunk
@@ -299,9 +299,10 @@ static int br_should_become_designated_port(const struct net_bridge_port *p)
 	if (memcmp(&p->designated_root, &br->designated_root, 8))
 		return 1;
 
-	if (br->root_path_cost < p->designated_cost)
+	t = br->root_path_cost - READ_ONCE(p->designated_cost);
+	if (t < 0)
 		return 1;
-	else if (br->root_path_cost > p->designated_cost)
+	else if (t > 0)
 		return 0;
Same as previous patch.
quoted hunk ↗ jump to hunk
 
 	t = memcmp(&br->bridge_id, &p->designated_bridge, 8);
@@ -341,9 +342,10 @@ static int br_supersedes_port_info(const struct net_bridge_port *p,
 	else if (t > 0)
 		return 0;
 
-	if (bpdu->root_path_cost < p->designated_cost)
+	t = bpdu->root_path_cost < READ_ONCE(p->designated_cost);
+	if (t < 0)
 		return 1;
-	else if (bpdu->root_path_cost > p->designated_cost)
+	else if (t > 0)
 		return 0;
Same.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help