lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89i+5jz7sB5UShxB+PDMaMCWpy2rA1LRocAWi5rAXV95HWA@mail.gmail.com>
Date: Tue, 1 Jul 2025 23:07:52 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>, 
	Simon Horman <horms@...nel.org>, Kuniyuki Iwashima <kuniyu@...gle.com>, netdev@...r.kernel.org, 
	eric.dumazet@...il.com
Subject: Re: [PATCH net-next] net: remove RTNL use for /proc/sys/net/core/rps_default_mask

On Tue, Jul 1, 2025 at 5:46 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Fri, 27 Jun 2025 13:08:39 +0000 Eric Dumazet wrote:
> > diff --git a/net/core/net-sysfs.h b/net/core/net-sysfs.h
> > index 8a5b04c2699aaee13ccc3a5b1543eecd0fc10d29..ff3440d721963b2f90b6a83666a63b3f95e61421 100644
> > --- a/net/core/net-sysfs.h
> > +++ b/net/core/net-sysfs.h
> > @@ -11,4 +11,8 @@ int netdev_queue_update_kobjects(struct net_device *net,
> >  int netdev_change_owner(struct net_device *, const struct net *net_old,
> >                       const struct net *net_new);
> >
> > +#if IS_ENABLED(CONFIG_SYSCTL) && IS_ENABLED(CONFIG_RPS)
> > +extern struct mutex rps_default_mask_mutex;
> > +#endif
>
> Perhaps subjective but hiding definitions under ifdefs often forces
> the ifdef to spread, IOW it prevents us from using:
>
>         if (IS_ENABLED(CONFIG_..))
>
> and relying on compiler to remove the dead code. So I'd skip the ifdef.

Yes, I will remove it in V2.

>
> >  #endif
> > diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> > index 5dbb2c6f371defbf79d4581f9b6c1c3fb13fa9d9..672520e43fefadf4c8c667ff6c77acf3935bc567 100644
> > --- a/net/core/sysctl_net_core.c
> > +++ b/net/core/sysctl_net_core.c
> > @@ -96,50 +96,40 @@ static int dump_cpumask(void *buffer, size_t *lenp, loff_t *ppos,
> >
> >  #ifdef CONFIG_RPS
> >
> > -static struct cpumask *rps_default_mask_cow_alloc(struct net *net)
> > -{
> > -     struct cpumask *rps_default_mask;
> > -
> > -     if (net->core.rps_default_mask)
> > -             return net->core.rps_default_mask;
> > -
> > -     rps_default_mask = kzalloc(cpumask_size(), GFP_KERNEL);
> > -     if (!rps_default_mask)
> > -             return NULL;
> > -
> > -     /* pairs with READ_ONCE in rx_queue_default_mask() */
> > -     WRITE_ONCE(net->core.rps_default_mask, rps_default_mask);
> > -     return rps_default_mask;
> > -}
> > +DEFINE_MUTEX(rps_default_mask_mutex);
>
> nit: sparse says ../sysfs.h is not included here so it doesn't see the
> declaration for the header:
>
> net/core/sysctl_net_core.c:99:1: warning: symbol 'rps_default_mask_mutex' was not declared. Should it be static?

Thanks, I will fix this in V2.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ