[PATCH] add fib_discarded_routes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

In accordance with RFC 2465 (IPv6 MIB, Routing objects),
this patch adds a DiscardedRoutes counter.
The counter is exposed in /proc/net/rt6_stats.

I know that you don't want more changes to /proc/net/ files.
netstat doesn't use this file and I don't know of a good
reason to add this 1 counter somewhere else instead of in
/proc/net/rt6_stats.

Please apply to 2.5.70-bk-current (after the net_typos patch
that I just sent).

Thanks,
--
~Randy


patch_name:	discarded_routes.patch
patch_version:	2003-05-29.17:02:19
author:		Randy.Dunlap <rddunlap@osdl.org>
description:	add IPv6 routing table statistic: fib_discarded_routes
		in struct rt6_statistics and in /proc/net/rt6_stats;
product:	Linux
product_versions: linux-2570-602
maintainer:	davem@redhat.com
diffstat:	=
 include/net/ip6_fib.h |    1 +
 net/ipv6/ip6_fib.c    |    1 +
 net/ipv6/route.c      |    5 +++--
 3 files changed, 5 insertions(+), 2 deletions(-)


diff -Naur ./include/net/ip6_fib.h%FDRT ./include/net/ip6_fib.h
--- ./include/net/ip6_fib.h%FDRT	2003-05-29 16:30:44.000000000 -0700
+++ ./include/net/ip6_fib.h	2003-05-29 16:37:31.000000000 -0700
@@ -114,6 +114,7 @@
 	__u32		fib_rt_alloc;		/* permanent routes	*/
 	__u32		fib_rt_entries;		/* rt entries in table	*/
 	__u32		fib_rt_cache;		/* cache routes		*/
+	__u32		fib_discarded_routes;
 };
 
 #define RTN_TL_ROOT	0x0001
diff -Naur ./net/ipv6/route.c%FDRT ./net/ipv6/route.c
--- ./net/ipv6/route.c%FDRT	2003-05-29 16:55:49.000000000 -0700
+++ ./net/ipv6/route.c	2003-05-29 16:56:37.000000000 -0700
@@ -1786,11 +1786,12 @@
 
 static int rt6_stats_seq_show(struct seq_file *seq, void *v)
 {
-	seq_printf(seq, "%04x %04x %04x %04x %04x %04x\n",
+	seq_printf(seq, "%04x %04x %04x %04x %04x %04x %04x\n",
 		      rt6_stats.fib_nodes, rt6_stats.fib_route_nodes,
 		      rt6_stats.fib_rt_alloc, rt6_stats.fib_rt_entries,
 		      rt6_stats.fib_rt_cache,
-		      atomic_read(&ip6_dst_ops.entries));
+		      atomic_read(&ip6_dst_ops.entries),
+		      rt6_stats.fib_discarded_routes);
 
 	return 0;
 }
diff -Naur ./net/ipv6/ip6_fib.c%FDRT ./net/ipv6/ip6_fib.c
--- ./net/ipv6/ip6_fib.c%FDRT	2003-05-29 15:58:11.000000000 -0700
+++ ./net/ipv6/ip6_fib.c	2003-05-29 17:01:18.000000000 -0700
@@ -896,6 +896,7 @@
 	*rtp = rt->u.next;
 	rt->rt6i_node = NULL;
 	rt6_stats.fib_rt_entries--;
+	rt6_stats.fib_discarded_routes++;
 
 	/* Adjust walkers */
 	read_lock(&fib6_walker_lock);
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux