aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/one_api.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-04-07 10:41:42 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-04-13 08:43:06 +0000
commit2151191e064e7a1fa37df436c0f771ee46fce3b0 (patch)
tree8d84816aedf0403cf9a9931f2346f48ece5be2d8 /src/vnet/lisp-cp/one_api.c
parent30d857cd07785461f993ec4a935d99af75673f4a (diff)
LISP: make statistics thread safe
Change-Id: I056dc6246f79d887d69ad459a6b8b3092a099baa Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/lisp-cp/one_api.c')
-rw-r--r--src/vnet/lisp-cp/one_api.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/vnet/lisp-cp/one_api.c b/src/vnet/lisp-cp/one_api.c
index 28924091fd3..23549afa68b 100644
--- a/src/vnet/lisp-cp/one_api.c
+++ b/src/vnet/lisp-cp/one_api.c
@@ -108,6 +108,7 @@ _(SHOW_ONE_USE_PETR, show_one_use_petr) \
_(SHOW_ONE_STATS_ENABLE_DISABLE, show_one_stats_enable_disable) \
_(ONE_STATS_ENABLE_DISABLE, one_stats_enable_disable) \
_(ONE_STATS_DUMP, one_stats_dump) \
+_(ONE_STATS_FLUSH, one_stats_flush) \
static locator_t *
@@ -1347,6 +1348,16 @@ lisp_fid_addr_to_api (fid_address_t * fid, u8 * dst, u8 * api_eid_type,
}
static void
+vl_api_one_stats_flush_t_handler (vl_api_one_stats_flush_t * mp)
+{
+ vl_api_one_stats_flush_reply_t *rmp;
+ u8 rv;
+
+ rv = vnet_lisp_flush_stats ();
+ REPLY_MACRO (VL_API_ONE_STATS_FLUSH_REPLY);
+}
+
+static void
vl_api_one_stats_dump_t_handler (vl_api_one_stats_dump_t * mp)
{
vl_api_one_stats_details_t *rmp;
@@ -1369,8 +1380,8 @@ vl_api_one_stats_dump_t_handler (vl_api_one_stats_dump_t * mp)
ip_address_copy_addr (rmp->rloc, &stat->rmt_rloc);
ip_address_copy_addr (rmp->lloc, &stat->loc_rloc);
- rmp->pkt_count = clib_host_to_net_u32 (stat->stats.pkt_count);
- rmp->bytes = clib_host_to_net_u32 (stat->stats.bytes);
+ rmp->pkt_count = clib_host_to_net_u32 (stat->counters.packets);
+ rmp->bytes = clib_host_to_net_u32 (stat->counters.bytes);
}));
/* *INDENT-ON* */
}