Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next] ip6_tunnel: annotate data-races around t->err_count and t->err_time
Date: Wed, 10 Jun 2026 09:05:40 -0700	[thread overview]
Message-ID: <20260610090540.507cd300@kernel.org> (raw)
In-Reply-To: <20260609093154.2733956-1-edumazet@google.com>

On Tue,  9 Jun 2026 09:31:53 +0000 Eric Dumazet wrote:
> -	if (time_before(jiffies, t->err_time + IP6TUNNEL_ERR_TIMEO))
> -		t->err_count++;
> +	if (time_before(jiffies, READ_ONCE(t->err_time) + IP6TUNNEL_ERR_TIMEO))
> +		WRITE_ONCE(t->err_count, t->err_count + 1);

Sashiko complains about the bare t->err_count read. Is there a reason
you added the temp variable in xmit but not on the error side?

Maybe an extra sentence in the commit message on why the approximate
correctness is okay here would also be good?

>  	else
> -		t->err_count = 1;
> -	t->err_time = jiffies;
> +		WRITE_ONCE(t->err_count, 1);
> +	WRITE_ONCE(t->err_time, jiffies);

  reply	other threads:[~2026-06-10 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  9:31 [PATCH net-next] ip6_tunnel: annotate data-races around t->err_count and t->err_time Eric Dumazet
2026-06-10 16:05 ` Jakub Kicinski [this message]
2026-06-10 16:20   ` Eric Dumazet

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=20260610090540.507cd300@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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