Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Change l2_patch from dual-loop to quad-loop
[vpp.git]
/
src
/
vnet
/
lisp-gpe
/
lisp_gpe_adjacency.c
diff --git
a/src/vnet/lisp-gpe/lisp_gpe_adjacency.c
b/src/vnet/lisp-gpe/lisp_gpe_adjacency.c
index
79b2a07
..
6f85dc4
100644
(file)
--- a/
src/vnet/lisp-gpe/lisp_gpe_adjacency.c
+++ b/
src/vnet/lisp-gpe/lisp_gpe_adjacency.c
@@
-115,7
+115,7
@@
ip46_address_to_ip_address (const ip46_address_t * a, ip_address_t * b)
{
if (ip46_address_is_ip4 (a))
{
{
if (ip46_address_is_ip4 (a))
{
- memset (b, 0, sizeof (*b));
+
clib_
memset (b, 0, sizeof (*b));
ip_address_set (b, &a->ip4, IP4);
}
else
ip_address_set (b, &a->ip4, IP4);
}
else
@@
-250,7
+250,6
@@
lisp_gpe_increment_stats_counters (lisp_cp_main_t * lcm, ip_adjacency_t * adj,
index_t lai;
u32 si, di;
gid_address_t src, dst;
index_t lai;
u32 si, di;
gid_address_t src, dst;
- lisp_stats_t *stats;
uword *feip;
ip46_address_to_ip_address (&adj->sub_type.nbr.next_hop, &rloc);
uword *feip;
ip46_address_to_ip_address (&adj->sub_type.nbr.next_hop, &rloc);
@@
-294,32
+293,22
@@
lisp_gpe_increment_stats_counters (lisp_cp_main_t * lcm, ip_adjacency_t * adj,
return;
lisp_stats_key_t key;
return;
lisp_stats_key_t key;
- memset (&key, 0, sizeof (key));
+
clib_
memset (&key, 0, sizeof (key));
key.fwd_entry_index = feip[0];
key.tunnel_index = ladj->tunnel_index;
uword *p = hash_get_mem (lgm->lisp_stats_index_by_key, &key);
key.fwd_entry_index = feip[0];
key.tunnel_index = ladj->tunnel_index;
uword *p = hash_get_mem (lgm->lisp_stats_index_by_key, &key);
- if (p)
- {
- stats = pool_elt_at_index (lgm->lisp_stats_pool, p[0]);
- }
- else
- {
- pool_get (lgm->lisp_stats_pool, stats);
- memset (stats, 0, sizeof (*stats));
+ ASSERT (p);
- lisp_stats_key_t *key_copy = clib_mem_alloc (sizeof (*key_copy));
- memcpy (key_copy, &key, sizeof (*key_copy));
- hash_set_mem (lgm->lisp_stats_index_by_key, key_copy,
- stats - lgm->lisp_stats_pool);
- }
- stats->pkt_count++;
/* compute payload length starting after GPE */
/* compute payload length starting after GPE */
- stats->bytes += b->current_length - (lisp_data - b->data - b->current_data);
+ u32 bytes = b->current_length - (lisp_data - b->data - b->current_data);
+ vlib_increment_combined_counter (&lgm->counters, vlib_get_thread_index (),
+ p[0], 1, bytes);
}
static void
}
static void
-lisp_gpe_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b)
+lisp_gpe_fixup (vlib_main_t * vm,
+ ip_adjacency_t * adj, vlib_buffer_t * b, const void *data)
{
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
{
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
@@
-360,6
+349,7
@@
lisp_gpe_update_adjacency (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
linkt = adj_get_link_type (ai);
adj_nbr_midchain_update_rewrite
(ai, lisp_gpe_fixup,
linkt = adj_get_link_type (ai);
adj_nbr_midchain_update_rewrite
(ai, lisp_gpe_fixup,
+ NULL,
(VNET_LINK_ETHERNET == linkt ?
ADJ_FLAG_MIDCHAIN_NO_COUNT :
ADJ_FLAG_NONE),
(VNET_LINK_ETHERNET == linkt ?
ADJ_FLAG_MIDCHAIN_NO_COUNT :
ADJ_FLAG_NONE),
@@
-405,7
+395,7
@@
lisp_gpe_adjacency_find_or_create_and_lock (const locator_pair_t * pair,
{
pool_get (lisp_adj_pool, ladj);
{
pool_get (lisp_adj_pool, ladj);
- memset (ladj, 0, sizeof (*ladj));
+
clib_
memset (ladj, 0, sizeof (*ladj));
lai = (ladj - lisp_adj_pool);
ip_address_copy (&ladj->remote_rloc, &pair->rmt_loc);
lai = (ladj - lisp_adj_pool);
ip_address_copy (&ladj->remote_rloc, &pair->rmt_loc);