* [PATCH net] net: Remove unused variables in rt_cache_stat
@ 2012-07-30 21:45 Vijay Subramanian
2012-07-30 21:52 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Vijay Subramanian @ 2012-07-30 21:45 UTC (permalink / raw)
To: netdev; +Cc: davem, Vijay Subramanian
With the removal of the routing cache, some variables in rt_cache_stat are no
longer used. Remove them from rt_cache_stat and do not print them out in
/proc/net/stat/rt_cache.
Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
checkpatch complains that the seq_printf line is over 80 chars which was already
the case. I left it as is to aid in grepping the sources.
include/net/route.h | 8 --------
net/ipv4/route.c | 16 +++-------------
2 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/include/net/route.h b/include/net/route.h
index 8c52bc6..69e54f9 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -84,22 +84,14 @@ struct ip_rt_acct {
};
struct rt_cache_stat {
- unsigned int in_hit;
unsigned int in_slow_tot;
unsigned int in_slow_mc;
unsigned int in_no_route;
unsigned int in_brd;
unsigned int in_martian_dst;
unsigned int in_martian_src;
- unsigned int out_hit;
unsigned int out_slow_tot;
unsigned int out_slow_mc;
- unsigned int gc_total;
- unsigned int gc_ignored;
- unsigned int gc_goal_miss;
- unsigned int gc_dst_overflow;
- unsigned int in_hlist_search;
- unsigned int out_hlist_search;
};
extern struct ip_rt_acct __percpu *ip_rt_acct;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index fc1a81c..114a6c9 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -298,14 +298,12 @@ static int rt_cpu_seq_show(struct seq_file *seq, void *v)
struct rt_cache_stat *st = v;
if (v == SEQ_START_TOKEN) {
- seq_printf(seq, "entries in_hit in_slow_tot in_slow_mc in_no_route in_brd in_martian_dst in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search\n");
+ seq_printf(seq, "entries in_slow_tot in_slow_mc in_no_route in_brd in_martian_dst in_martian_src out_slow_tot out_slow_mc\n");
return 0;
}
- seq_printf(seq,"%08x %08x %08x %08x %08x %08x %08x %08x "
- " %08x %08x %08x %08x %08x %08x %08x %08x %08x \n",
+ seq_printf(seq, "%08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
dst_entries_get_slow(&ipv4_dst_ops),
- st->in_hit,
st->in_slow_tot,
st->in_slow_mc,
st->in_no_route,
@@ -313,16 +311,8 @@ static int rt_cpu_seq_show(struct seq_file *seq, void *v)
st->in_martian_dst,
st->in_martian_src,
- st->out_hit,
st->out_slow_tot,
- st->out_slow_mc,
-
- st->gc_total,
- st->gc_ignored,
- st->gc_goal_miss,
- st->gc_dst_overflow,
- st->in_hlist_search,
- st->out_hlist_search
+ st->out_slow_mc
);
return 0;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: Remove unused variables in rt_cache_stat
2012-07-30 21:45 [PATCH net] net: Remove unused variables in rt_cache_stat Vijay Subramanian
@ 2012-07-30 21:52 ` David Miller
2012-08-17 21:59 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-07-30 21:52 UTC (permalink / raw)
To: subramanian.vijay; +Cc: netdev
From: Vijay Subramanian <subramanian.vijay@gmail.com>
Date: Mon, 30 Jul 2012 14:45:50 -0700
> With the removal of the routing cache, some variables in rt_cache_stat are no
> longer used. Remove them from rt_cache_stat and do not print them out in
> /proc/net/stat/rt_cache.
>
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
> ---
> checkpatch complains that the seq_printf line is over 80 chars which was already
> the case. I left it as is to aid in grepping the sources.
You cannot make this change, these fields are exported via procfs and
therefore you will break any application that is parsing the existing
layout.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: Remove unused variables in rt_cache_stat
2012-07-30 21:52 ` David Miller
@ 2012-08-17 21:59 ` Jan Engelhardt
0 siblings, 0 replies; 3+ messages in thread
From: Jan Engelhardt @ 2012-08-17 21:59 UTC (permalink / raw)
To: David Miller; +Cc: subramanian.vijay, netdev
On Monday 2012-07-30 23:52, David Miller wrote:
>From: Vijay Subramanian <subramanian.vijay@gmail.com>
>Date: Mon, 30 Jul 2012 14:45:50 -0700
>
>> With the removal of the routing cache, some variables in rt_cache_stat are no
>> longer used. Remove them from rt_cache_stat and do not print them out in
>> /proc/net/stat/rt_cache.
>>
>> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
>> ---
>> checkpatch complains that the seq_printf line is over 80 chars which was already
>> the case. I left it as is to aid in grepping the sources.
>
>You cannot make this change, these fields are exported via procfs and
>therefore you will break any application that is parsing the existing
>layout.
Then the fields should just be printed with a static zero, like it's
done in procfs.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-17 21:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 21:45 [PATCH net] net: Remove unused variables in rt_cache_stat Vijay Subramanian
2012-07-30 21:52 ` David Miller
2012-08-17 21:59 ` Jan Engelhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).