diff mbox series

[net-next] ipv4: delete sysctls about routing cache

Message ID 20211223122010.569553-1-xu.xin16@zte.com.cn (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ipv4: delete sysctls about routing cache | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 17891 this patch: 17892
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang fail Errors and warnings before: 3297 this patch: 3299
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 17248 this patch: 17249
netdev/checkpatch fail ERROR: spaces required around that '=' (ctx:VxV)
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

CGEL Dec. 23, 2021, 12:20 p.m. UTC
From: xu xin <xu.xin16@zte.com.cn>

Since routing cache in ipv4 has been deleted in 2012, the sysctls about
it are useless.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
---
 include/uapi/linux/sysctl.h | 10 ++++----
 net/ipv4/route.c            | 48 -------------------------------------
 2 files changed, 5 insertions(+), 53 deletions(-)

Comments

Jakub Kicinski Dec. 23, 2021, 4:47 p.m. UTC | #1
On Thu, 23 Dec 2021 12:20:10 +0000 cgel.zte@gmail.com wrote:
> From: xu xin <xu.xin16@zte.com.cn>
> 
> Since routing cache in ipv4 has been deleted in 2012, the sysctls about
> it are useless.

Search for those on GitHub. Useless or not, there is software which
expects those files to exist and which may break if they disappear.
That's why they were left in place.
CGEL Dec. 24, 2021, 2:02 a.m. UTC | #2
On Thu, Dec 23, 2021 at 08:47:02AM -0800, Jakub Kicinski wrote:
> On Thu, 23 Dec 2021 12:20:10 +0000 cgel.zte@gmail.com wrote:
> > From: xu xin <xu.xin16@zte.com.cn>
> > 
> > Since routing cache in ipv4 has been deleted in 2012, the sysctls about
> > it are useless.
> 
> Search for those on GitHub. Useless or not, there is software which
> expects those files to exist and which may break if they disappear.
> That's why they were left in place.
Maybe we can note these inoperative interfaces in ip-sysctl.rst or
somewhere else, suggesting users not to use them any longer.

Wish you merry christmas in advance.
Xu Xin
diff mbox series

Patch

diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
index 6a3b194c50fe..72ecdf38c4ed 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -432,9 +432,9 @@  enum {
 	NET_IPV4_ROUTE_FLUSH=1,
 	NET_IPV4_ROUTE_MIN_DELAY=2, /* obsolete since 2.6.25 */
 	NET_IPV4_ROUTE_MAX_DELAY=3, /* obsolete since 2.6.25 */
-	NET_IPV4_ROUTE_GC_THRESH=4,
-	NET_IPV4_ROUTE_MAX_SIZE=5,
-	NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
+	NET_IPV4_ROUTE_GC_THRESH=4, /* obsolete */
+	NET_IPV4_ROUTE_MAX_SIZE=5,  /* obsolete */
+	NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, /* obsolete */
 	NET_IPV4_ROUTE_GC_TIMEOUT=7,
 	NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
 	NET_IPV4_ROUTE_REDIRECT_LOAD=9,
@@ -442,12 +442,12 @@  enum {
 	NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
 	NET_IPV4_ROUTE_ERROR_COST=12,
 	NET_IPV4_ROUTE_ERROR_BURST=13,
-	NET_IPV4_ROUTE_GC_ELASTICITY=14,
+	NET_IPV4_ROUTE_GC_ELASTICITY=14, /* obsolete */
 	NET_IPV4_ROUTE_MTU_EXPIRES=15,
 	NET_IPV4_ROUTE_MIN_PMTU=16,
 	NET_IPV4_ROUTE_MIN_ADVMSS=17,
 	NET_IPV4_ROUTE_SECRET_INTERVAL=18,
-	NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
+	NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19, /* obsolete */
 };
 
 enum
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 843a7a3699fe..4b0d7d654859 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -110,7 +110,6 @@ 
 
 #define RT_GC_TIMEOUT (300*HZ)
 
-static int ip_rt_max_size;
 static int ip_rt_redirect_number __read_mostly	= 9;
 static int ip_rt_redirect_load __read_mostly	= HZ / 50;
 static int ip_rt_redirect_silence __read_mostly	= ((HZ / 50) << (9 + 1));
@@ -3428,8 +3427,6 @@  void ip_rt_multicast_event(struct in_device *in_dev)
 }
 
 #ifdef CONFIG_SYSCTL
-static int ip_rt_gc_interval __read_mostly  = 60 * HZ;
-static int ip_rt_gc_min_interval __read_mostly	= HZ / 2;
 static int ip_rt_gc_elasticity __read_mostly	= 8;
 static int ip_min_valid_pmtu __read_mostly	= IPV4_MIN_MTU;
 
@@ -3448,36 +3445,6 @@  static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write,
 }
 
 static struct ctl_table ipv4_route_table[] = {
-	{
-		.procname	= "gc_thresh",
-		.data		= &ipv4_dst_ops.gc_thresh,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	},
-	{
-		.procname	= "max_size",
-		.data		= &ip_rt_max_size,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	},
-	{
-		/*  Deprecated. Use gc_min_interval_ms */
-
-		.procname	= "gc_min_interval",
-		.data		= &ip_rt_gc_min_interval,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec_jiffies,
-	},
-	{
-		.procname	= "gc_min_interval_ms",
-		.data		= &ip_rt_gc_min_interval,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec_ms_jiffies,
-	},
 	{
 		.procname	= "gc_timeout",
 		.data		= &ip_rt_gc_timeout,
@@ -3485,13 +3452,6 @@  static struct ctl_table ipv4_route_table[] = {
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_jiffies,
 	},
-	{
-		.procname	= "gc_interval",
-		.data		= &ip_rt_gc_interval,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec_jiffies,
-	},
 	{
 		.procname	= "redirect_load",
 		.data		= &ip_rt_redirect_load,
@@ -3527,13 +3487,6 @@  static struct ctl_table ipv4_route_table[] = {
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
-	{
-		.procname	= "gc_elasticity",
-		.data		= &ip_rt_gc_elasticity,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	},
 	{
 		.procname	= "mtu_expires",
 		.data		= &ip_rt_mtu_expires,
@@ -3705,7 +3658,6 @@  int __init ip_rt_init(void)
 		panic("IP: failed to allocate ipv4_dst_blackhole_ops counter\n");
 
 	ipv4_dst_ops.gc_thresh = ~0;
-	ip_rt_max_size = INT_MAX;
 
 	devinet_init();
 	ip_fib_init();