summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/dslite_in2out.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-12-18 01:08:51 -0800
committerOle Trøan <otroan@employees.org>2018-12-20 15:12:11 +0000
commitfd0d50879f475a1b15cedb4ab49059a02c45ccfd (patch)
treecbb86dfe652ec5401492298335c9750cfad482b3 /src/plugins/nat/dslite_in2out.c
parent775f73c6baaf9bc2283e7ab9752c81984823be99 (diff)
NAT: total users and sessions gauges (VPP-1484)
Change-Id: I41a82e21571d5c64d01af72cd88c3983afac26ed Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/dslite_in2out.c')
-rw-r--r--src/plugins/nat/dslite_in2out.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/nat/dslite_in2out.c b/src/plugins/nat/dslite_in2out.c
index 5c1de19b8b2..cbb5d987d01 100644
--- a/src/plugins/nat/dslite_in2out.c
+++ b/src/plugins/nat/dslite_in2out.c
@@ -71,6 +71,10 @@ slow_path (dslite_main_t * dm, dslite_session_key_t * in2out_key,
b4_index = b4_kv.value = b4 - dm->per_thread_data[thread_index].b4s;
clib_bihash_add_del_16_8 (&dm->per_thread_data[thread_index].b4_hash,
&b4_kv, 1);
+
+ vlib_set_simple_counter (&dm->total_b4s, thread_index, 0,
+ pool_elts (dm->
+ per_thread_data[thread_index].b4s));
}
else
{
@@ -139,6 +143,10 @@ slow_path (dslite_main_t * dm, dslite_session_key_t * in2out_key,
clib_dlist_addtail (dm->per_thread_data[thread_index].list_pool,
s->per_b4_list_head_index,
elt - dm->per_thread_data[thread_index].list_pool);
+
+ vlib_set_simple_counter (&dm->total_sessions, thread_index, 0,
+ pool_elts (dm->per_thread_data
+ [thread_index].sessions));
}
s->in2out = *in2out_key;