All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL
@ 2026-11-15 13:24 Oleg Nesterov
  2026-11-15 13:25 ` [PATCH v2 net-next 1/5] net/rds/sysctl.c: " Oleg Nesterov
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Oleg Nesterov @ 2026-11-15 13:24 UTC (permalink / raw)
  To: Allison Henderson, Jakub Kicinski, Paolo Abeni
  Cc: Joel Granados, edumazet, horms, netdev, linux-rdma

Compile tested with CONFIG_RDS CONFIG_RDS_RDMA CONFIG_RDS_TCP CONFIG_RDS_DEBUG,
the kernel builds with or without CONFIG_SYSCTL.

v2: rebased on net-next/main, added the acks from Allison (thanks!)

Oleg.
---

 net/rds/ib.h        |   1 -
 net/rds/ib_sysctl.c |  33 +++++---
 net/rds/rds.h       |   5 --
 net/rds/sysctl.c    |  26 ++++--
 net/rds/tcp.c       | 230 ++++++++++++++++++++++++++++------------------------
 net/rds/tcp.h       |   2 +
 6 files changed, 168 insertions(+), 129 deletions(-)
---
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 net-next 1/5] net/rds/sysctl.c: move sysctl-only code under CONFIG_SYSCTL
  2026-11-15 13:24 [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
@ 2026-11-15 13:25 ` Oleg Nesterov
  2026-11-15 13:32   ` sashiko-bot
  2026-11-15 13:25 ` [PATCH v2 net-next 2/5] net/rds/ib_sysctl.c: " Oleg Nesterov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2026-11-15 13:25 UTC (permalink / raw)
  To: Allison Henderson, Jakub Kicinski, Paolo Abeni
  Cc: Joel Granados, edumazet, horms, netdev, linux-rdma

Collect all code used only when CONFIG_SYSCTL=y into a single block and
wrap it in #ifdef CONFIG_SYSCTL. rds_sysctl_init() no longer needs the
IS_ENABLED() check.

Add the corresponding init/exit stubs for the CONFIG_SYSCTL=n case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Tested-by: Allison Henderson <achender@kernel.org>
---
 net/rds/sysctl.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index 968d6279bbd3..47e8782b1aa3 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -36,11 +36,6 @@
 
 #include "rds.h"
 
-static struct ctl_table_header *rds_sysctl_reg_table;
-
-static unsigned long rds_sysctl_reconnect_min = 1;
-static unsigned long rds_sysctl_reconnect_max = ~0UL;
-
 unsigned long rds_sysctl_reconnect_min_jiffies;
 unsigned long rds_sysctl_reconnect_max_jiffies = HZ;
 
@@ -49,6 +44,10 @@ unsigned int  rds_sysctl_max_unacked_bytes = (16 << 20);
 
 unsigned int rds_sysctl_ping_enable = 1;
 
+#ifdef CONFIG_SYSCTL
+static unsigned long rds_sysctl_reconnect_min = 1;
+static unsigned long rds_sysctl_reconnect_max = ~0UL;
+
 static struct ctl_table rds_sysctl_rds_table[] = {
 	{
 		.procname       = "reconnect_min_delay_ms",
@@ -91,6 +90,8 @@ static struct ctl_table rds_sysctl_rds_table[] = {
 	},
 };
 
+static struct ctl_table_header *rds_sysctl_reg_table;
+
 void rds_sysctl_exit(void)
 {
 	unregister_net_sysctl_table(rds_sysctl_reg_table);
@@ -103,7 +104,20 @@ int rds_sysctl_init(void)
 
 	rds_sysctl_reg_table =
 		register_net_sysctl(&init_net, "net/rds", rds_sysctl_rds_table);
-	if (!rds_sysctl_reg_table && IS_ENABLED(CONFIG_SYSCTL))
+	if (!rds_sysctl_reg_table)
 		return -ENOMEM;
 	return 0;
 }
+
+#else
+
+int rds_sysctl_init(void)
+{
+	rds_sysctl_reconnect_min_jiffies = msecs_to_jiffies(1);
+	return 0;
+}
+
+void rds_sysctl_exit(void)
+{
+}
+#endif
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 net-next 2/5] net/rds/ib_sysctl.c: move sysctl-only code under CONFIG_SYSCTL
  2026-11-15 13:24 [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
  2026-11-15 13:25 ` [PATCH v2 net-next 1/5] net/rds/sysctl.c: " Oleg Nesterov
@ 2026-11-15 13:25 ` Oleg Nesterov
  2026-11-15 13:32   ` sashiko-bot
  2026-11-15 13:25 ` [PATCH v2 net-next 3/5] net/rds/tcp.c: introduce rds_tcp_{init,exit}_net_sysctl() helpers Oleg Nesterov
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2026-11-15 13:25 UTC (permalink / raw)
  To: Allison Henderson, Jakub Kicinski, Paolo Abeni
  Cc: Joel Granados, edumazet, horms, netdev, linux-rdma

Collect all code used only when CONFIG_SYSCTL=y into a single block and
wrap it in #ifdef CONFIG_SYSCTL. rds_ib_sysctl_init() no longer needs the
IS_ENABLED() check.

Add the corresponding init/exit stubs for the CONFIG_SYSCTL=n case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Tested-by: Allison Henderson <achender@kernel.org>
---
 net/rds/ib_sysctl.c | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c
index bc97a3eecad6..0b336ff03ae9 100644
--- a/net/rds/ib_sysctl.c
+++ b/net/rds/ib_sysctl.c
@@ -36,19 +36,10 @@
 
 #include "ib.h"
 
-static struct ctl_table_header *rds_ib_sysctl_hdr;
-
 unsigned long rds_ib_sysctl_max_send_wr = RDS_IB_DEFAULT_SEND_WR;
 unsigned long rds_ib_sysctl_max_recv_wr = RDS_IB_DEFAULT_RECV_WR;
 unsigned long rds_ib_sysctl_max_recv_allocation = (128 * 1024 * 1024) / RDS_FRAG_SIZE;
-static unsigned long rds_ib_sysctl_max_wr_min = 1;
-/* hardware will fail CQ creation long before this */
-static unsigned long rds_ib_sysctl_max_wr_max = (u32)~0;
-
 unsigned long rds_ib_sysctl_max_unsig_wrs = 16;
-static unsigned long rds_ib_sysctl_max_unsig_wr_min = 1;
-static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64;
-
 /*
  * This sysctl does nothing.
  *
@@ -61,6 +52,14 @@ static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64;
  */
 unsigned int rds_ib_sysctl_flow_control = 0;
 
+#ifdef CONFIG_SYSCTL
+static unsigned long rds_ib_sysctl_max_wr_min = 1;
+/* hardware will fail CQ creation long before this */
+static unsigned long rds_ib_sysctl_max_wr_max = (u32)~0;
+
+static unsigned long rds_ib_sysctl_max_unsig_wr_min = 1;
+static unsigned long rds_ib_sysctl_max_unsig_wr_max = 64;
+
 static struct ctl_table rds_ib_sysctl_table[] = {
 	{
 		.procname       = "max_send_wr",
@@ -105,6 +104,8 @@ static struct ctl_table rds_ib_sysctl_table[] = {
 	},
 };
 
+static struct ctl_table_header *rds_ib_sysctl_hdr;
+
 void rds_ib_sysctl_exit(void)
 {
 	if (rds_ib_sysctl_hdr)
@@ -114,7 +115,19 @@ void rds_ib_sysctl_exit(void)
 int rds_ib_sysctl_init(void)
 {
 	rds_ib_sysctl_hdr = register_net_sysctl(&init_net, "net/rds/ib", rds_ib_sysctl_table);
-	if (!rds_ib_sysctl_hdr && IS_ENABLED(CONFIG_SYSCTL))
+	if (!rds_ib_sysctl_hdr)
 		return -ENOMEM;
 	return 0;
 }
+
+#else
+
+int rds_ib_sysctl_init(void)
+{
+	return 0;
+}
+
+void rds_ib_sysctl_exit(void)
+{
+}
+#endif
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 net-next 3/5] net/rds/tcp.c: introduce rds_tcp_{init,exit}_net_sysctl() helpers
  2026-11-15 13:24 [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
  2026-11-15 13:25 ` [PATCH v2 net-next 1/5] net/rds/sysctl.c: " Oleg Nesterov
  2026-11-15 13:25 ` [PATCH v2 net-next 2/5] net/rds/ib_sysctl.c: " Oleg Nesterov
@ 2026-11-15 13:25 ` Oleg Nesterov
  2026-11-15 13:32   ` sashiko-bot
  2026-11-15 13:25 ` [PATCH v2 net-next 4/5] net/rds/tcp.c: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
  2026-11-15 13:25 ` [PATCH v2 net-next 5/5] net/rds: remove dead sysctl declarations Oleg Nesterov
  4 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2026-11-15 13:25 UTC (permalink / raw)
  To: Allison Henderson, Jakub Kicinski, Paolo Abeni
  Cc: Joel Granados, edumazet, horms, netdev, linux-rdma

Preparation to simplify the next change.

Extract the net namespace sysctl registration and unregistration logic
from rds_tcp_init_net() and rds_tcp_exit_net() into new helpers.

This also simplifies the error paths in rds_tcp_init_net(); it can use
rds_tcp_exit_net_sysctl() too.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Tested-by: Allison Henderson <achender@kernel.org>
---
 net/rds/tcp.c | 93 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 52 insertions(+), 41 deletions(-)

diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index c1ad37505417..d6c542371611 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -82,6 +82,52 @@ static struct ctl_table rds_tcp_sysctl_table[] = {
 	},
 };
 
+static __net_init int rds_tcp_init_net_sysctl(struct net *net)
+{
+	struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
+	struct ctl_table *tbl;
+
+	/* {snd, rcv}buf_size default to 0, which implies we let the
+	 * stack pick the value, and permit auto-tuning of buffer size.
+	 */
+	if (net == &init_net) {
+		tbl = rds_tcp_sysctl_table;
+	} else {
+		tbl = kmemdup(rds_tcp_sysctl_table,
+			      sizeof(rds_tcp_sysctl_table), GFP_KERNEL);
+		if (!tbl) {
+			pr_warn("could not allocate sysctl table\n");
+			return -ENOMEM;
+		}
+		rtn->ctl_table = tbl;
+	}
+	tbl[RDS_TCP_SNDBUF].data = &rtn->sndbuf_size;
+	tbl[RDS_TCP_RCVBUF].data = &rtn->rcvbuf_size;
+	rtn->rds_tcp_sysctl = register_net_sysctl_sz(net, "net/rds/tcp", tbl,
+						     ARRAY_SIZE(rds_tcp_sysctl_table));
+	if (!rtn->rds_tcp_sysctl && IS_ENABLED(CONFIG_SYSCTL)) {
+		pr_warn("could not register sysctl\n");
+		if (net != &init_net)
+			kfree(tbl);
+		return -ENOMEM;
+	}
+
+	return 0;
+}
+
+static void __net_exit rds_tcp_exit_net_sysctl(struct net *net)
+{
+	struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
+
+	if (rtn->rds_tcp_sysctl) {
+		unregister_net_sysctl_table(rtn->rds_tcp_sysctl);
+		rtn->rds_tcp_sysctl = NULL;
+	}
+
+	if (net != &init_net)
+		kfree(rtn->ctl_table);
+}
+
 u32 rds_tcp_write_seq(struct rds_tcp_connection *tc)
 {
 	/* seq# of the last byte of data in tcp send buffer */
@@ -612,36 +658,15 @@ void rds_tcp_accept_work(struct rds_tcp_net *rtn)
 static __net_init int rds_tcp_init_net(struct net *net)
 {
 	struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
-	struct ctl_table *tbl;
 	int err = 0;
 
 	memset(rtn, 0, sizeof(*rtn));
 
 	mutex_init(&rtn->rds_tcp_accept_lock);
 
-	/* {snd, rcv}buf_size default to 0, which implies we let the
-	 * stack pick the value, and permit auto-tuning of buffer size.
-	 */
-	if (net == &init_net) {
-		tbl = rds_tcp_sysctl_table;
-	} else {
-		tbl = kmemdup(rds_tcp_sysctl_table,
-			      sizeof(rds_tcp_sysctl_table), GFP_KERNEL);
-		if (!tbl) {
-			pr_warn("could not set allocate sysctl table\n");
-			return -ENOMEM;
-		}
-		rtn->ctl_table = tbl;
-	}
-	tbl[RDS_TCP_SNDBUF].data = &rtn->sndbuf_size;
-	tbl[RDS_TCP_RCVBUF].data = &rtn->rcvbuf_size;
-	rtn->rds_tcp_sysctl = register_net_sysctl_sz(net, "net/rds/tcp", tbl,
-						     ARRAY_SIZE(rds_tcp_sysctl_table));
-	if (!rtn->rds_tcp_sysctl && IS_ENABLED(CONFIG_SYSCTL)) {
-		pr_warn("could not register sysctl\n");
-		err = -ENOMEM;
-		goto fail;
-	}
+	err = rds_tcp_init_net_sysctl(net);
+	if (err)
+		return err;
 
 #if IS_ENABLED(CONFIG_IPV6)
 	rtn->rds_tcp_listen_sock = rds_tcp_listen_init(net, true);
@@ -656,21 +681,14 @@ static __net_init int rds_tcp_init_net(struct net *net)
 		rtn->rds_tcp_listen_sock = rds_tcp_listen_init(net, false);
 		if (!rtn->rds_tcp_listen_sock) {
 #endif
-			unregister_net_sysctl_table(rtn->rds_tcp_sysctl);
-			rtn->rds_tcp_sysctl = NULL;
-			err = -EAFNOSUPPORT;
-			goto fail;
+			rds_tcp_exit_net_sysctl(net);
+			return -EAFNOSUPPORT;
 #if IS_ENABLED(CONFIG_IPV6)
 		}
 #endif
 	}
 	INIT_WORK(&rtn->rds_tcp_accept_w, rds_tcp_accept_worker);
 	return 0;
-
-fail:
-	if (net != &init_net)
-		kfree(tbl);
-	return err;
 }
 
 static void rds_tcp_kill_sock(struct net *net)
@@ -704,14 +722,7 @@ static void rds_tcp_kill_sock(struct net *net)
 
 static void __net_exit rds_tcp_exit_net(struct net *net)
 {
-	struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
-
-	if (rtn->rds_tcp_sysctl)
-		unregister_net_sysctl_table(rtn->rds_tcp_sysctl);
-
-	if (net != &init_net)
-		kfree(rtn->ctl_table);
-
+	rds_tcp_exit_net_sysctl(net);
 	rds_tcp_kill_sock(net);
 }
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 net-next 4/5] net/rds/tcp.c: move sysctl-only code under CONFIG_SYSCTL
  2026-11-15 13:24 [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
                   ` (2 preceding siblings ...)
  2026-11-15 13:25 ` [PATCH v2 net-next 3/5] net/rds/tcp.c: introduce rds_tcp_{init,exit}_net_sysctl() helpers Oleg Nesterov
@ 2026-11-15 13:25 ` Oleg Nesterov
  2026-11-15 13:32   ` sashiko-bot
  2026-11-15 13:25 ` [PATCH v2 net-next 5/5] net/rds: remove dead sysctl declarations Oleg Nesterov
  4 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2026-11-15 13:25 UTC (permalink / raw)
  To: Allison Henderson, Jakub Kicinski, Paolo Abeni
  Cc: Joel Granados, edumazet, horms, netdev, linux-rdma

Collect all code used only when CONFIG_SYSCTL=y into a single block and
wrap it in #ifdef CONFIG_SYSCTL. rds_tcp_init_net_sysctl no longer needs
the IS_ENABLED() check.

Add the corresponding init/exit stubs for the CONFIG_SYSCTL=n case.

Also #ifdef the rds_tcp_sysctl and ctl_table fields in struct rds_tcp_net.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Tested-by: Allison Henderson <achender@kernel.org>
---
 net/rds/tcp.c | 139 ++++++++++++++++++++++++++------------------------
 net/rds/tcp.h |   2 +
 2 files changed, 74 insertions(+), 67 deletions(-)

diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index d6c542371611..9f18c4f4a406 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -53,13 +53,71 @@ static atomic_t rds_tcp_unloading = ATOMIC_INIT(0);
 
 static struct kmem_cache *rds_tcp_conn_slab;
 
+#ifdef CONFIG_SYSCTL
+static int rds_tcp_min_sndbuf = SOCK_MIN_SNDBUF;
+static int rds_tcp_min_rcvbuf = SOCK_MIN_RCVBUF;
+
+/* when sysctl is used to modify some kernel socket parameters,this
+ * function  resets the RDS connections in that netns  so that we can
+ * restart with new parameters.  The assumption is that such reset
+ * events are few and far-between.
+ */
+static void rds_tcp_sysctl_reset(struct net *net)
+{
+	struct rds_tcp_connection *tc, *_tc;
+
+	spin_lock_irq(&rds_tcp_conn_lock);
+	list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) {
+		struct net *c_net = read_pnet(&tc->t_cpath->cp_conn->c_net);
+
+		if (net != c_net || !tc->t_sock)
+			continue;
+
+		/* reconnect with new parameters */
+		rds_conn_path_drop(tc->t_cpath, false);
+	}
+	spin_unlock_irq(&rds_tcp_conn_lock);
+}
+
+static int rds_tcp_skbuf_handler(struct rds_tcp_net *rtn,
+				 const struct ctl_table *ctl, int write,
+				 void *buffer, size_t *lenp, loff_t *fpos)
+{
+	int err;
+
+	err = proc_dointvec_minmax(ctl, write, buffer, lenp, fpos);
+	if (err < 0) {
+		pr_warn("Invalid input. Must be >= %d\n",
+			*(int *)(ctl->extra1));
+		return err;
+	}
+
+	if (write && rtn->rds_tcp_listen_sock && rtn->rds_tcp_listen_sock->sk) {
+		struct net *net = sock_net(rtn->rds_tcp_listen_sock->sk);
+
+		rds_tcp_sysctl_reset(net);
+	}
+
+	return 0;
+}
+
 static int rds_tcp_sndbuf_handler(const struct ctl_table *ctl, int write,
-				  void *buffer, size_t *lenp, loff_t *fpos);
+				  void *buffer, size_t *lenp, loff_t *fpos)
+{
+	struct rds_tcp_net *rtn = container_of(ctl->data, struct rds_tcp_net,
+					       sndbuf_size);
+
+	return rds_tcp_skbuf_handler(rtn, ctl, write, buffer, lenp, fpos);
+}
+
 static int rds_tcp_rcvbuf_handler(const struct ctl_table *ctl, int write,
-				  void *buffer, size_t *lenp, loff_t *fpos);
+				  void *buffer, size_t *lenp, loff_t *fpos)
+{
+	struct rds_tcp_net *rtn = container_of(ctl->data, struct rds_tcp_net,
+					       rcvbuf_size);
 
-static int rds_tcp_min_sndbuf = SOCK_MIN_SNDBUF;
-static int rds_tcp_min_rcvbuf = SOCK_MIN_RCVBUF;
+	return rds_tcp_skbuf_handler(rtn, ctl, write, buffer, lenp, fpos);
+}
 
 static struct ctl_table rds_tcp_sysctl_table[] = {
 #define	RDS_TCP_SNDBUF	0
@@ -105,7 +163,7 @@ static __net_init int rds_tcp_init_net_sysctl(struct net *net)
 	tbl[RDS_TCP_RCVBUF].data = &rtn->rcvbuf_size;
 	rtn->rds_tcp_sysctl = register_net_sysctl_sz(net, "net/rds/tcp", tbl,
 						     ARRAY_SIZE(rds_tcp_sysctl_table));
-	if (!rtn->rds_tcp_sysctl && IS_ENABLED(CONFIG_SYSCTL)) {
+	if (!rtn->rds_tcp_sysctl) {
 		pr_warn("could not register sysctl\n");
 		if (net != &init_net)
 			kfree(tbl);
@@ -127,6 +185,15 @@ static void __net_exit rds_tcp_exit_net_sysctl(struct net *net)
 	if (net != &init_net)
 		kfree(rtn->ctl_table);
 }
+#else
+static inline int rds_tcp_init_net_sysctl(struct net *net)
+{
+	return 0;
+}
+static inline void rds_tcp_exit_net_sysctl(struct net *net)
+{
+}
+#endif
 
 u32 rds_tcp_write_seq(struct rds_tcp_connection *tc)
 {
@@ -744,68 +811,6 @@ void *rds_tcp_listen_sock_def_readable(struct net *net)
 	return lsock->sk->sk_user_data;
 }
 
-/* when sysctl is used to modify some kernel socket parameters,this
- * function  resets the RDS connections in that netns  so that we can
- * restart with new parameters.  The assumption is that such reset
- * events are few and far-between.
- */
-static void rds_tcp_sysctl_reset(struct net *net)
-{
-	struct rds_tcp_connection *tc, *_tc;
-
-	spin_lock_irq(&rds_tcp_conn_lock);
-	list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) {
-		struct net *c_net = read_pnet(&tc->t_cpath->cp_conn->c_net);
-
-		if (net != c_net || !tc->t_sock)
-			continue;
-
-		/* reconnect with new parameters */
-		rds_conn_path_drop(tc->t_cpath, false);
-	}
-	spin_unlock_irq(&rds_tcp_conn_lock);
-}
-
-static int rds_tcp_skbuf_handler(struct rds_tcp_net *rtn,
-				 const struct ctl_table *ctl, int write,
-				 void *buffer, size_t *lenp, loff_t *fpos)
-{
-	int err;
-
-	err = proc_dointvec_minmax(ctl, write, buffer, lenp, fpos);
-	if (err < 0) {
-		pr_warn("Invalid input. Must be >= %d\n",
-			*(int *)(ctl->extra1));
-		return err;
-	}
-
-	if (write && rtn->rds_tcp_listen_sock && rtn->rds_tcp_listen_sock->sk) {
-		struct net *net = sock_net(rtn->rds_tcp_listen_sock->sk);
-
-		rds_tcp_sysctl_reset(net);
-	}
-
-	return 0;
-}
-
-static int rds_tcp_sndbuf_handler(const struct ctl_table *ctl, int write,
-				  void *buffer, size_t *lenp, loff_t *fpos)
-{
-	struct rds_tcp_net *rtn = container_of(ctl->data, struct rds_tcp_net,
-					       sndbuf_size);
-
-	return rds_tcp_skbuf_handler(rtn, ctl, write, buffer, lenp, fpos);
-}
-
-static int rds_tcp_rcvbuf_handler(const struct ctl_table *ctl, int write,
-				  void *buffer, size_t *lenp, loff_t *fpos)
-{
-	struct rds_tcp_net *rtn = container_of(ctl->data, struct rds_tcp_net,
-					       rcvbuf_size);
-
-	return rds_tcp_skbuf_handler(rtn, ctl, write, buffer, lenp, fpos);
-}
-
 static void rds_tcp_exit(void)
 {
 	rds_tcp_set_unloading();
diff --git a/net/rds/tcp.h b/net/rds/tcp.h
index 39c86347188c..12b58d76c089 100644
--- a/net/rds/tcp.h
+++ b/net/rds/tcp.h
@@ -13,8 +13,10 @@ struct rds_tcp_net {
 	struct socket		*rds_tcp_listen_sock;
 	struct socket		*rds_tcp_accepted_sock;
 	struct work_struct	rds_tcp_accept_w;
+#ifdef CONFIG_SYSCTL
 	struct ctl_table_header	*rds_tcp_sysctl;
 	const struct ctl_table	*ctl_table;
+#endif
 	int			sndbuf_size;
 	int			rcvbuf_size;
 };
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 net-next 5/5] net/rds: remove dead sysctl declarations
  2026-11-15 13:24 [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
                   ` (3 preceding siblings ...)
  2026-11-15 13:25 ` [PATCH v2 net-next 4/5] net/rds/tcp.c: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
@ 2026-11-15 13:25 ` Oleg Nesterov
  2026-11-15 13:32   ` sashiko-bot
  4 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2026-11-15 13:25 UTC (permalink / raw)
  To: Allison Henderson, Jakub Kicinski, Paolo Abeni
  Cc: Joel Granados, edumazet, horms, netdev, linux-rdma

Several sysctl variables are declared in ib.h and rds.h but are never
defined or used; git-grep finds nothing.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Tested-by: Allison Henderson <achender@kernel.org>
---
 net/rds/ib.h  | 1 -
 net/rds/rds.h | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/net/rds/ib.h b/net/rds/ib.h
index 1901226368c9..a7f0005c5a0f 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -448,7 +448,6 @@ void rds_ib_sysctl_exit(void);
 extern unsigned long rds_ib_sysctl_max_send_wr;
 extern unsigned long rds_ib_sysctl_max_recv_wr;
 extern unsigned long rds_ib_sysctl_max_unsig_wrs;
-extern unsigned long rds_ib_sysctl_max_unsig_bytes;
 extern unsigned long rds_ib_sysctl_max_recv_allocation;
 extern unsigned int rds_ib_sysctl_flow_control;
 
diff --git a/net/rds/rds.h b/net/rds/rds.h
index e3937c1ff3a1..2d061b16966e 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -1027,16 +1027,11 @@ void rds_stats_info_copy(struct rds_info_iterator *iter,
 /* sysctl.c */
 int rds_sysctl_init(void);
 void rds_sysctl_exit(void);
-extern unsigned long rds_sysctl_sndbuf_min;
-extern unsigned long rds_sysctl_sndbuf_default;
-extern unsigned long rds_sysctl_sndbuf_max;
 extern unsigned long rds_sysctl_reconnect_min_jiffies;
 extern unsigned long rds_sysctl_reconnect_max_jiffies;
 extern unsigned int  rds_sysctl_max_unacked_packets;
 extern unsigned int  rds_sysctl_max_unacked_bytes;
 extern unsigned int  rds_sysctl_ping_enable;
-extern unsigned long rds_sysctl_trace_flags;
-extern unsigned int  rds_sysctl_trace_level;
 
 /* threads.c */
 int rds_threads_init(void);
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 net-next 1/5] net/rds/sysctl.c: move sysctl-only code under CONFIG_SYSCTL
  2026-11-15 13:25 ` [PATCH v2 net-next 1/5] net/rds/sysctl.c: " Oleg Nesterov
@ 2026-11-15 13:32   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-15 13:32 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-rdma

> Collect all code used only when CONFIG_SYSCTL=y into a single block and
> wrap it in #ifdef CONFIG_SYSCTL. rds_sysctl_init() no longer needs the
> IS_ENABLED() check.
> 
> Add the corresponding init/exit stubs for the CONFIG_SYSCTL=n case.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/avmymGvelu00X5EH@redhat.com?part=1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 net-next 2/5] net/rds/ib_sysctl.c: move sysctl-only code under CONFIG_SYSCTL
  2026-11-15 13:25 ` [PATCH v2 net-next 2/5] net/rds/ib_sysctl.c: " Oleg Nesterov
@ 2026-11-15 13:32   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-15 13:32 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-rdma

> Collect all code used only when CONFIG_SYSCTL=y into a single block and
> wrap it in #ifdef CONFIG_SYSCTL. rds_ib_sysctl_init() no longer needs the
> IS_ENABLED() check.
> 
> Add the corresponding init/exit stubs for the CONFIG_SYSCTL=n case.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/avmymGvelu00X5EH@redhat.com?part=2


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 net-next 3/5] net/rds/tcp.c: introduce rds_tcp_{init,exit}_net_sysctl() helpers
  2026-11-15 13:25 ` [PATCH v2 net-next 3/5] net/rds/tcp.c: introduce rds_tcp_{init,exit}_net_sysctl() helpers Oleg Nesterov
@ 2026-11-15 13:32   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-15 13:32 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-rdma

> Preparation to simplify the next change.
> 
> Extract the net namespace sysctl registration and unregistration logic
> from rds_tcp_init_net() and rds_tcp_exit_net() into new helpers.
> 
> This also simplifies the error paths in rds_tcp_init_net(); it can use
> rds_tcp_exit_net_sysctl() too.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/avmymGvelu00X5EH@redhat.com?part=3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 net-next 4/5] net/rds/tcp.c: move sysctl-only code under CONFIG_SYSCTL
  2026-11-15 13:25 ` [PATCH v2 net-next 4/5] net/rds/tcp.c: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
@ 2026-11-15 13:32   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-15 13:32 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-rdma

> Collect all code used only when CONFIG_SYSCTL=y into a single block and
> wrap it in #ifdef CONFIG_SYSCTL. rds_tcp_init_net_sysctl no longer needs
> the IS_ENABLED() check.
> 
> Add the corresponding init/exit stubs for the CONFIG_SYSCTL=n case.
> 
> Also #ifdef the rds_tcp_sysctl and ctl_table fields in struct rds_tcp_net.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/avmymGvelu00X5EH@redhat.com?part=4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 net-next 5/5] net/rds: remove dead sysctl declarations
  2026-11-15 13:25 ` [PATCH v2 net-next 5/5] net/rds: remove dead sysctl declarations Oleg Nesterov
@ 2026-11-15 13:32   ` sashiko-bot
  0 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-15 13:32 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-rdma

> Several sysctl variables are declared in ib.h and rds.h but are never
> defined or used; git-grep finds nothing.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/avmymGvelu00X5EH@redhat.com?part=5


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-15 13:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 13:24 [PATCH v2 net-next 0/5] net/rds: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
2026-11-15 13:25 ` [PATCH v2 net-next 1/5] net/rds/sysctl.c: " Oleg Nesterov
2026-11-15 13:32   ` sashiko-bot
2026-11-15 13:25 ` [PATCH v2 net-next 2/5] net/rds/ib_sysctl.c: " Oleg Nesterov
2026-11-15 13:32   ` sashiko-bot
2026-11-15 13:25 ` [PATCH v2 net-next 3/5] net/rds/tcp.c: introduce rds_tcp_{init,exit}_net_sysctl() helpers Oleg Nesterov
2026-11-15 13:32   ` sashiko-bot
2026-11-15 13:25 ` [PATCH v2 net-next 4/5] net/rds/tcp.c: move sysctl-only code under CONFIG_SYSCTL Oleg Nesterov
2026-11-15 13:32   ` sashiko-bot
2026-11-15 13:25 ` [PATCH v2 net-next 5/5] net/rds: remove dead sysctl declarations Oleg Nesterov
2026-11-15 13:32   ` sashiko-bot

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.