summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@netfilter.org>2004-09-27 07:57:01 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-09-27 07:57:01 -0700
commitbf19f71b39b2aeef87aa75d97ce079377ae5ecd7 (patch)
treeb0aa8fdd558a52ba652239abc568d390513d5248 /include/net
parent363c9612c2f286204248a57aafd87c089fdbd83a (diff)
[NET]: Neighbour cache statistics like rt_stat.
Add rtstat-like per-cpu statistics to the neighbour cache core. Signed-off-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/neighbour.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index e66c71da2357..40073cf19863 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -7,6 +7,11 @@
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
* Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
+ *
+ * Changes:
+ *
+ * Harald Welte: <laforge@gnumonks.org>
+ * - Add neighbour cache statistics like rtstat
*/
/* The following flags & states are exported to user space,
@@ -90,12 +95,25 @@ struct neigh_parms
struct neigh_statistics
{
- unsigned long allocs;
- unsigned long res_failed;
- unsigned long rcv_probes_mcast;
- unsigned long rcv_probes_ucast;
+ unsigned long allocs; /* number of allocated neighs */
+ unsigned long destroys; /* number of destroyed neighs */
+ unsigned long hash_grows; /* number of hash resizes */
+
+ unsigned long res_failed; /* nomber of failed resolutions */
+
+ unsigned long lookups; /* number of lookups */
+ unsigned long hits; /* number of hits (among lookups) */
+
+ unsigned long rcv_probes_mcast; /* number of received mcast ipv6 */
+ unsigned long rcv_probes_ucast; /* number of received ucast ipv6 */
+
+ unsigned long periodic_gc_runs; /* number of periodic GC runs */
+ unsigned long forced_gc_runs; /* number of forced GC runs */
};
+#define NEIGH_CACHE_STAT_INC(tbl, field) \
+ (per_cpu_ptr((tbl)->stats, smp_processor_id())->field++)
+
struct neighbour
{
struct neighbour *next;
@@ -172,12 +190,15 @@ struct neigh_table
unsigned long last_rand;
struct neigh_parms *parms_list;
kmem_cache_t *kmem_cachep;
- struct neigh_statistics stats;
+ struct neigh_statistics *stats;
struct neighbour **hash_buckets;
unsigned int hash_mask;
__u32 hash_rnd;
unsigned int hash_chain_gc;
struct pneigh_entry **phash_buckets;
+#ifdef CONFIG_PROC_FS
+ struct proc_dir_entry *pde;
+#endif
};
/* flags for neigh_update() */