Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v2 net-next 06/11] bridge: provide lockless access to p->designated_cost
Date: Thu, 4 Jun 2026 13:50:30 +0300	[thread overview]
Message-ID: <20260604105030.GA775294@shredder> (raw)
In-Reply-To: <20260603062043.3911278-7-edumazet@google.com>

On Wed, Jun 03, 2026 at 06:20:38AM +0000, Eric Dumazet wrote:
> @@ -302,9 +304,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;

Eric, I think you meant:

p_designated_cost = READ_ONCE(p->designated_cost);

if (br->root_path_cost < p_designated_cost)
	return 1;
else if (br->root_path_cost > p_designated_cost)
	return 0;

?

>  
>  	t = memcmp(&br->bridge_id, &p->designated_bridge, 8);
> @@ -344,9 +347,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;

Similarly here?

  parent reply	other threads:[~2026-06-04 10:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03  6:20 [PATCH v2 net-next 00/11] bridge: prepare lockless br_port_fill_attrs() (I) Eric Dumazet
2026-06-03  6:20 ` [PATCH v2 net-next 01/11] bridge: add a READ_ONCE() in br_timer_value() Eric Dumazet
2026-06-03  7:42   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 02/11] bridge: add bridge_flags_bit enum Eric Dumazet
2026-06-03  7:42   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 03/11] bridge: use BR_PROMISC_BIT Eric Dumazet
2026-06-03  7:42   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 04/11] bridge: use BR_ADMIN_COST_BIT Eric Dumazet
2026-06-03  7:43   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 05/11] bridge: provide lockless access to p->path_cost Eric Dumazet
2026-06-03  7:44   ` Nikolay Aleksandrov
2026-06-04 10:50   ` Ido Schimmel
2026-06-03  6:20 ` [PATCH v2 net-next 06/11] bridge: provide lockless access to p->designated_cost Eric Dumazet
2026-06-03  7:46   ` Nikolay Aleksandrov
2026-06-04 10:50   ` Ido Schimmel [this message]
2026-06-03  6:20 ` [PATCH v2 net-next 07/11] bridge: provide lockless access to p->designated_port Eric Dumazet
2026-06-03  7:47   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 08/11] bridge: provide lockless access to p->priority Eric Dumazet
2026-06-03  7:49   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 09/11] bridge: provide lockless access to p->port_id Eric Dumazet
2026-06-03  7:50   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 10/11] bridge: provide lockless access to p->config_pending Eric Dumazet
2026-06-03  7:51   ` Nikolay Aleksandrov
2026-06-03  6:20 ` [PATCH v2 net-next 11/11] bridge: read p->flags once in br_port_fill_attrs() Eric Dumazet
2026-06-03  7:52   ` Nikolay Aleksandrov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260604105030.GA775294@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox