From: Jiri Pirko <jiri@resnulli.us>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Ahern <dsahern@kernel.org>,
netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH net-next 02/13] ipv6: annotate data-races around cnf.disable_ipv6
Date: Mon, 26 Feb 2024 17:46:54 +0100 [thread overview]
Message-ID: <ZdzAfhZgY7MuQBj0@nanopsycho> (raw)
In-Reply-To: <CANn89iLXrjT=JpAJNuvtqTxPC+jKto8+j62KOd5nPk25QqoOAg@mail.gmail.com>
Mon, Feb 26, 2024 at 05:24:19PM CET, edumazet@google.com wrote:
>On Mon, Feb 26, 2024 at 5:18 PM Jiri Pirko <jiri@resnulli.us> wrote:
>>
>> Mon, Feb 26, 2024 at 05:14:36PM CET, edumazet@google.com wrote:
>> >On Mon, Feb 26, 2024 at 5:09 PM Jiri Pirko <jiri@resnulli.us> wrote:
>> >>
>> >> Mon, Feb 26, 2024 at 04:50:44PM CET, edumazet@google.com wrote:
>> >> >disable_ipv6 is read locklessly, add appropriate READ_ONCE()
>> >> >and WRITE_ONCE() annotations.
>> >> >
>> >> >Signed-off-by: Eric Dumazet <edumazet@google.com>
>> >> >---
>> >> > net/ipv6/addrconf.c | 12 ++++++------
>> >> > net/ipv6/ip6_input.c | 4 ++--
>> >> > net/ipv6/ip6_output.c | 2 +-
>> >> > 3 files changed, 9 insertions(+), 9 deletions(-)
>> >> >
>> >> >diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> >> >index a280614b37652deee0d1f3c70ba1b41b01cc7d91..0d7746b113cc65303b5c2ec223b3331c3598ded6 100644
>> >> >--- a/net/ipv6/addrconf.c
>> >> >+++ b/net/ipv6/addrconf.c
>> >> >@@ -4214,7 +4214,7 @@ static void addrconf_dad_work(struct work_struct *w)
>> >> > if (!ipv6_generate_eui64(addr.s6_addr + 8, idev->dev) &&
>> >> > ipv6_addr_equal(&ifp->addr, &addr)) {
>> >> > /* DAD failed for link-local based on MAC */
>> >> >- idev->cnf.disable_ipv6 = 1;
>> >> >+ WRITE_ONCE(idev->cnf.disable_ipv6, 1);
>> >> >
>> >> > pr_info("%s: IPv6 being disabled!\n",
>> >> > ifp->idev->dev->name);
>> >> >@@ -6388,7 +6388,8 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
>> >> > idev = __in6_dev_get(dev);
>> >> > if (idev) {
>> >> > int changed = (!idev->cnf.disable_ipv6) ^ (!newf);
>> >> >- idev->cnf.disable_ipv6 = newf;
>> >> >+
>> >> >+ WRITE_ONCE(idev->cnf.disable_ipv6, newf);
>> >> > if (changed)
>> >> > dev_disable_change(idev);
>> >> > }
>> >> >@@ -6397,15 +6398,14 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
>> >> >
>> >> > static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf)
>> >> > {
>> >> >- struct net *net;
>> >> >+ struct net *net = (struct net *)table->extra2;
>> >>
>> >> How is this related to the rest of the patch and why is it okay to
>> >> access table->extra2 without holding rtnl mutex?
>> >
>> >table->extra2 is immutable, it can be fetched before grabbing RTNL.
>> >Everything that can be done before acquiring RTNL is a win under RTNL pressure.
>> >
>> >I had a followup minor patch, but the patch series was already too big.
>>
>> I see, so this hunk should be part of that patch, not this one, I
>> believe.
>>
>
>If I send a V2, I will add the followup patch instead.
>
>IMO this is a minor point.
Yeah, it is minor.
>
>Thank you.
next prev parent reply other threads:[~2024-02-26 16:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 15:50 [PATCH net-next 00/13] ipv6: lockless accesses to devconf Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 01/13] ipv6: add ipv6_devconf_read_txrx cacheline_group Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 02/13] ipv6: annotate data-races around cnf.disable_ipv6 Eric Dumazet
2024-02-26 16:09 ` Jiri Pirko
2024-02-26 16:14 ` Eric Dumazet
2024-02-26 16:18 ` Jiri Pirko
2024-02-26 16:24 ` Eric Dumazet
2024-02-26 16:46 ` Jiri Pirko [this message]
2024-02-26 15:50 ` [PATCH net-next 03/13] ipv6: annotate data-races around cnf.mtu6 Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 04/13] ipv6: annotate data-races around cnf.hop_limit Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 05/13] ipv6: annotate data-races around cnf.forwarding Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 06/13] ipv6: annotate data-races in ndisc_router_discovery() Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 07/13] ipv6: annotate data-races around idev->cnf.ignore_routes_with_linkdown Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 08/13] ipv6: annotate data-races in rt6_probe() Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 09/13] ipv6: annotate data-races around devconf->proxy_ndp Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 10/13] ipv6: annotate data-races around devconf->disable_policy Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 11/13] ipv6/addrconf: annotate data-races around devconf fields (I) Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 12/13] ipv6/addrconf: annotate data-races around devconf fields (II) Eric Dumazet
2024-02-26 15:50 ` [PATCH net-next 13/13] ipv6: use xa_array iterator to implement inet6_netconf_dump_devconf() Eric Dumazet
2024-02-26 16:55 ` Jiri Pirko
2024-02-27 11:49 ` 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=ZdzAfhZgY7MuQBj0@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).