[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89i+G_GfMCYwbYEq7+XHbqjxPWDrA9dRJ35pTQji1xuB+Rw@mail.gmail.com>
Date: Tue, 14 Jan 2025 22:59:13 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Simon Horman <horms@...nel.org>, David Ahern <dsahern@...nel.org>, eric.dumazet@...il.com
Subject: Re: [PATCH net-next] inet: ipmr: fix data-races
On Tue, Jan 14, 2025 at 10:36 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> 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}
Oops, oh well, thanks, I will send a V2.
Powered by blists - more mailing lists