Commit 58db9501 authored by Robert Olsson's avatar Robert Olsson Committed by David S. Miller

[IPV4]: Add rtcache hash lookup statistics to rtstat.

parent b9c7862d
......@@ -102,6 +102,8 @@ struct rt_cache_stat
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 rt_cache_stat *rt_cache_stat;
......
......@@ -321,7 +321,7 @@ static int rt_cache_stat_get_info(char *buffer, char **start, off_t offset, int
for (i = 0; i < NR_CPUS; i++) {
if (!cpu_possible(i))
continue;
len += sprintf(buffer+len, "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x \n",
len += sprintf(buffer+len, "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x \n",
dst_entries,
per_cpu_ptr(rt_cache_stat, i)->in_hit,
per_cpu_ptr(rt_cache_stat, i)->in_slow_tot,
......@@ -338,7 +338,9 @@ static int rt_cache_stat_get_info(char *buffer, char **start, off_t offset, int
per_cpu_ptr(rt_cache_stat, i)->gc_total,
per_cpu_ptr(rt_cache_stat, i)->gc_ignored,
per_cpu_ptr(rt_cache_stat, i)->gc_goal_miss,
per_cpu_ptr(rt_cache_stat, i)->gc_dst_overflow
per_cpu_ptr(rt_cache_stat, i)->gc_dst_overflow,
per_cpu_ptr(rt_cache_stat, i)->in_hlist_search,
per_cpu_ptr(rt_cache_stat, i)->out_hlist_search
);
}
......@@ -1786,6 +1788,7 @@ int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr,
skb->dst = (struct dst_entry*)rth;
return 0;
}
RT_CACHE_STAT_INC(in_hlist_search);
}
rcu_read_unlock();
......@@ -2153,6 +2156,7 @@ int __ip_route_output_key(struct rtable **rp, const struct flowi *flp)
*rp = rth;
return 0;
}
RT_CACHE_STAT_INC(out_hlist_search);
}
rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment