All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>, Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org, Nikolay Aleksandrov <razor@blackwall.org>
Subject: Re: [PATCH v5 net-next 12/15] neighbour: Namespacify neigh_tables.
Date: Wed, 2 Sep 2026 16:29:06 +0300	[thread overview]
Message-ID: <20260902132906.GA3929399@shredder> (raw)
In-Reply-To: <20260901183327.3332855-13-kuniyu@google.com>

On Tue, Sep 01, 2026 at 06:33:01PM +0000, Kuniyuki Iwashima wrote:
> +static void neigh_table_inherit(struct net *net, struct neigh_table *tbl,
> +				int index)
> +{
> +	const struct neigh_table *init_tbl = init_net.neigh_tables[index];
> +	bool inherit = READ_ONCE(sysctl_neigh_inherit_init_net);
> +	int i;
> +
> +	if (net_eq(net, &init_net) || !inherit)
> +		return;
> +
> +	tbl->gc_interval = READ_ONCE(init_tbl->gc_interval);
> +	tbl->gc_thresh1 = READ_ONCE(init_tbl->gc_thresh1);
> +	tbl->gc_thresh2 = READ_ONCE(init_tbl->gc_thresh2);
> +	tbl->gc_thresh3 = READ_ONCE(init_tbl->gc_thresh3);
> +
> +	for (i = 0; i < NEIGH_VAR_DATA_MAX; i++)
> +		tbl->parms.data[i] = READ_ONCE(init_tbl->parms.data[i]);
>  }

[...]

> diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> index eb35da3556f4..53e044fc53b0 100644
> --- a/net/core/sysctl_net_core.c
> +++ b/net/core/sysctl_net_core.c
> @@ -21,6 +21,7 @@
>  
>  #include <net/ip.h>
>  #include <net/sock.h>
> +#include <net/neighbour.h>
>  #include <net/net_ratelimit.h>
>  #include <net/busy_poll.h>
>  #include <net/pkt_sched.h>
> @@ -53,6 +54,8 @@ EXPORT_SYMBOL(sysctl_fb_tunnels_only_for_init_net);
>  int sysctl_devconf_inherit_init_net __read_mostly;
>  EXPORT_SYMBOL(sysctl_devconf_inherit_init_net);
>  
> +int sysctl_neigh_inherit_init_net __read_mostly = 1;

This fails to build with CONFIG_SYSCTL=n (yes, unlikely config):

$ vng -b
/usr/bin/x86_64-linux-gnu-ld.bfd: vmlinux.o: in function `neigh_table_inherit':
/home/idosch/.virtme/net/core/neighbour.c:1920:(.text+0xc8ddd9): undefined reference to `sysctl_neigh_inherit_init_net'
make[2]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 1
make[1]: *** [/data/idosch/virtme-build/Makefile:1376: vmlinux] Error 2
make: *** [Makefile:248: __sub-make] Error 2

$ grep CONFIG_SYSCTL .config
CONFIG_SYSCTL_EXCEPTION_TRACE=y
# CONFIG_SYSCTL is not set

Can be fixed with the following diff:

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 9b28f40b019a..27602bcbeb69 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1913,6 +1913,8 @@ static void neigh_table_clear(struct net *net, struct neigh_table *tbl)
 	neigh_table_put(tbl);
 }
 
+int sysctl_neigh_inherit_init_net __read_mostly = 1;
+
 static void neigh_table_inherit(struct net *net, struct neigh_table *tbl,
 				int index)
 {
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 53e044fc53b0..23310581f494 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -54,8 +54,6 @@ EXPORT_SYMBOL(sysctl_fb_tunnels_only_for_init_net);
 int sysctl_devconf_inherit_init_net __read_mostly;
 EXPORT_SYMBOL(sysctl_devconf_inherit_init_net);
 
-int sysctl_neigh_inherit_init_net __read_mostly = 1;
-
 #if IS_ENABLED(CONFIG_NET_FLOW_LIMIT) || IS_ENABLED(CONFIG_RPS)
 static int dump_cpumask(void *buffer, size_t *lenp, loff_t *ppos,
 			struct cpumask *mask)

  reply	other threads:[~2026-09-02 13:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 18:32 [PATCH v5 net-next 00/15] neighbour: Namespacify arp_tbl and nd_tbl Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 01/15] selftest: net: Deflake Periodic GC test in test_neigh.sh Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 02/15] neighbour: Remove __neigh_for_each_release() Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 03/15] neighbour: Remove lock dance for neigh_update_{gc,managed}_list() Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 04/15] neighbour: Remove unnecessary EXPORT_SYMBOL() Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 05/15] neighbour: Remove __rcu from neigh_tables[] Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 06/15] neighbour: Store arp_tbl and nd_tbl in net->neigh_tables[] Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 07/15] neighbour: Remove neigh_tables[] Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 08/15] ipv4: Replace &arp_tbl with arp_table(net) Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 09/15] ipv6: Replace &nd_tbl with nd_table(net) Kuniyuki Iwashima
2026-09-01 18:32 ` [PATCH v5 net-next 10/15] neighbour: Clean up neigh_table_init() and neigh_table_clear() Kuniyuki Iwashima
2026-09-01 18:33 ` [PATCH v5 net-next 11/15] neighbour: Convert neigh_table.entries to refcount_t Kuniyuki Iwashima
2026-09-01 18:33 ` [PATCH v5 net-next 12/15] neighbour: Namespacify neigh_tables Kuniyuki Iwashima
2026-09-02 13:29   ` Ido Schimmel [this message]
2026-09-02 16:53     ` Kuniyuki Iwashima
2026-09-01 18:33 ` [PATCH v5 net-next 13/15] neighbour: Don't store net in struct pneigh_entry Kuniyuki Iwashima
2026-09-01 18:33 ` [PATCH v5 net-next 14/15] neighbour: Remove unnecessary net_eq() Kuniyuki Iwashima
2026-09-01 18:33 ` [PATCH v5 net-next 15/15] selftest: net: Specify netns for ip ntable in test_neigh.sh Kuniyuki Iwashima
2026-09-02 14:30 ` [PATCH v5 net-next 00/15] neighbour: Namespacify arp_tbl and nd_tbl Ido Schimmel
2026-09-02 16:56   ` Kuniyuki Iwashima

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=20260902132906.GA3929399@shredder \
    --to=idosch@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    /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.