Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
LISP: make statistics thread safe
[vpp.git]
/
src
/
vnet
/
lisp-cp
/
control.c
diff --git
a/src/vnet/lisp-cp/control.c
b/src/vnet/lisp-cp/control.c
index
5c901f3
..
ebbd1be
100644
(file)
--- a/
src/vnet/lisp-cp/control.c
+++ b/
src/vnet/lisp-cp/control.c
@@
-285,7
+285,7
@@
dp_del_fwd_entry (lisp_cp_main_t * lcm, u32 src_map_index, u32 dst_map_index)
if (fe->is_src_dst)
gid_address_copy (&a->lcl_eid, &fe->leid);
if (fe->is_src_dst)
gid_address_copy (&a->lcl_eid, &fe->leid);
- vnet_lisp_
del_fwd_stat
s (a, feip[0]);
+ vnet_lisp_
gpe_del_fwd_counter
s (a, feip[0]);
vnet_lisp_gpe_add_del_fwd_entry (a, &sw_if_index);
/* delete entry in fwd table */
vnet_lisp_gpe_add_del_fwd_entry (a, &sw_if_index);
/* delete entry in fwd table */
@@
-532,10
+532,18
@@
dp_add_fwd_entry (lisp_cp_main_t * lcm, u32 src_map_index, u32 dst_map_index)
a->action = rmt_map->action;
}
a->action = rmt_map->action;
}
- vnet_lisp_gpe_add_del_fwd_entry (a, &sw_if_index);
+ rv = vnet_lisp_gpe_add_del_fwd_entry (a, &sw_if_index);
+ if (rv)
+ {
+ if (a->locator_pairs)
+ vec_free (a->locator_pairs);
+ return;
+ }
- /* add tunnel to fwd entry table
XXX check return value from DP insertion
*/
+ /* add tunnel to fwd entry table */
pool_get (lcm->fwd_entry_pool, fe);
pool_get (lcm->fwd_entry_pool, fe);
+ vnet_lisp_gpe_add_fwd_counters (a, fe - lcm->fwd_entry_pool);
+
fe->locator_pairs = a->locator_pairs;
gid_address_copy (&fe->reid, &a->rmt_eid);
fe->locator_pairs = a->locator_pairs;
gid_address_copy (&fe->reid, &a->rmt_eid);
@@
-3608,7
+3616,8
@@
lisp_stats_api_fill (lisp_cp_main_t * lcm, lisp_gpe_main_t * lgm,
lisp_api_stats_t * stat, lisp_stats_key_t * key,
u32 stats_index)
{
lisp_api_stats_t * stat, lisp_stats_key_t * key,
u32 stats_index)
{
- lisp_stats_t *s;
+ vlib_counter_t v;
+ vlib_combined_counter_main_t *cm = &lgm->counters;
lisp_gpe_fwd_entry_key_t fwd_key;
const lisp_gpe_tunnel_t *lgt;
fwd_entry_t *fe;
lisp_gpe_fwd_entry_key_t fwd_key;
const lisp_gpe_tunnel_t *lgt;
fwd_entry_t *fe;
@@
-3627,8
+3636,8
@@
lisp_stats_api_fill (lisp_cp_main_t * lcm, lisp_gpe_main_t * lgm,
stat->loc_rloc = lgt->key->lcl;
stat->rmt_rloc = lgt->key->rmt;
stat->loc_rloc = lgt->key->lcl;
stat->rmt_rloc = lgt->key->rmt;
-
s = pool_elt_at_index (lgm->lisp_stats_pool, stats_index
);
- stat->
stats = *s
;
+
vlib_get_combined_counter (cm, stats_index, &v
);
+ stat->
counters = v
;
return 1;
}
return 1;
}