All of lore.kernel.org
 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>,
	netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
	David Ahern <dsahern@kernel.org>,
	eric.dumazet@gmail.com
Subject: Re: [PATCH net-next] inet: ipmr: fix data-races
Date: Tue, 14 Jan 2025 13:36:48 -0800	[thread overview]
Message-ID: <20250114133648.36702172@kernel.org> (raw)
In-Reply-To: <20250113171509.3491883-1-edumazet@google.com>

On Mon, 13 Jan 2025 17:15:09 +0000 Eric Dumazet wrote:
> Following fields of 'struct mr_mfc' can be updated
> concurrently (no lock protection) from ip_mr_forward()
> and ip6_mr_forward()
> 
> - bytes
> - pkt
> - wrong_if
> - lastuse
> 
> They also can be read from other functions.
> 
> Convert bytes, pkt and wrong_if to atomic_long_t,
> and use READ_ONCE()/WRITE_ONCE() for lastuse.

Drivers poke into this:

drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c:1006:43: error: invalid operands to binary != (have ‘atomic_long_t’ {aka ‘atomic64_t’} and ‘u64’ {aka ‘long long unsigned int’})
+ 1006 |         if (mr_route->mfc->mfc_un.res.pkt != packets)
+      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~
+      |                                      |
+      |                                      atomic_long_t {aka atomic64_t}
-- 
pw-bot: cr

  parent reply	other threads:[~2025-01-14 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 17:15 [PATCH net-next] inet: ipmr: fix data-races Eric Dumazet
2025-01-14  0:35 ` David Ahern
2025-01-14 21:36 ` Jakub Kicinski [this message]
2025-01-14 21:59   ` 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=20250114133648.36702172@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.