aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2008-07-16 23:50:49 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-16 23:50:49 -0400
commit9a6d276e85aa3d8f308fc5e8de6892daeb60ae5f (patch)
treef61e1ad988a037745794fb23004d5bf2f247800f
parented88098e25d77bef3b2ad8c9d8e2ebf454d9ccbf (diff)
core: add stat to track unresolved discards in neighbor cache
in __neigh_event_send, if we have a neighbour entry which is in NUD_INCOMPLETE state, we enqueue any outbound frames to that neighbour to the neighbours arp_queue, which is default capped to a length of 3 skbs. If that queue exceeds its set length, it will drop an skb on the queue to enqueue the newly arrived skb. This results in a drop for which we have no statistics incremented. This patch adds an unresolved_discards stat to /proc/net/stat/ndisc_cache to track these lost frames. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/neighbour.h4
-rw-r--r--net/core/neighbour.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index dc420fecafb9..aa4b708654a4 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -75,7 +75,7 @@ struct neigh_statistics
75 unsigned long destroys; /* number of destroyed neighs */ 75 unsigned long destroys; /* number of destroyed neighs */
76 unsigned long hash_grows; /* number of hash resizes */ 76 unsigned long hash_grows; /* number of hash resizes */
77 77
78 unsigned long res_failed; /* nomber of failed resolutions */ 78 unsigned long res_failed; /* number of failed resolutions */
79 79
80 unsigned long lookups; /* number of lookups */ 80 unsigned long lookups; /* number of lookups */
81 unsigned long hits; /* number of hits (among lookups) */ 81 unsigned long hits; /* number of hits (among lookups) */
@@ -85,6 +85,8 @@ struct neigh_statistics
85 85
86 unsigned long periodic_gc_runs; /* number of periodic GC runs */ 86 unsigned long periodic_gc_runs; /* number of periodic GC runs */
87 unsigned long forced_gc_runs; /* number of forced GC runs */ 87 unsigned long forced_gc_runs; /* number of forced GC runs */
88
89 unsigned long unres_discards; /* number of unresolved drops */
88}; 90};
89 91
90#define NEIGH_CACHE_STAT_INC(tbl, field) \ 92#define NEIGH_CACHE_STAT_INC(tbl, field) \
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 65f01f71b3f3..f62c8af85d38 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -930,6 +930,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
930 buff = neigh->arp_queue.next; 930 buff = neigh->arp_queue.next;
931 __skb_unlink(buff, &neigh->arp_queue); 931 __skb_unlink(buff, &neigh->arp_queue);
932 kfree_skb(buff); 932 kfree_skb(buff);
933 NEIGH_CACHE_STAT_INC(neigh->tbl, unres_discards);
933 } 934 }
934 __skb_queue_tail(&neigh->arp_queue, skb); 935 __skb_queue_tail(&neigh->arp_queue, skb);
935 } 936 }
@@ -2462,12 +2463,12 @@ static int neigh_stat_seq_show(struct seq_file *seq, void *v)
2462 struct neigh_statistics *st = v; 2463 struct neigh_statistics *st = v;
2463 2464
2464 if (v == SEQ_START_TOKEN) { 2465 if (v == SEQ_START_TOKEN) {
2465 seq_printf(seq, "entries allocs destroys hash_grows lookups hits res_failed rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs\n"); 2466 seq_printf(seq, "entries allocs destroys hash_grows lookups hits res_failed rcv_probes_mcast rcv_probes_ucast periodic_gc_runs forced_gc_runs unresolved_discards\n");
2466 return 0; 2467 return 0;
2467 } 2468 }
2468 2469
2469 seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " 2470 seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx "
2470 "%08lx %08lx %08lx %08lx\n", 2471 "%08lx %08lx %08lx %08lx %08lx\n",
2471 atomic_read(&tbl->entries), 2472 atomic_read(&tbl->entries),
2472 2473
2473 st->allocs, 2474 st->allocs,
@@ -2483,7 +2484,8 @@ static int neigh_stat_seq_show(struct seq_file *seq, void *v)
2483 st->rcv_probes_ucast, 2484 st->rcv_probes_ucast,
2484 2485
2485 st->periodic_gc_runs, 2486 st->periodic_gc_runs,
2486 st->forced_gc_runs 2487 st->forced_gc_runs,
2488 st->unres_discards
2487 ); 2489 );
2488 2490
2489 return 0; 2491 return 0;