aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lisp
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-12-13 21:47:40 +0100
committerDave Barach <openvpp@barachs.net>2020-12-14 12:14:21 +0000
commitb2c31b685fd2cf28436ca32bc93e23eb24c74878 (patch)
treedc0a1b1ff784445b2cbb0f9b2c07b5bcb4f5a5d0 /src/plugins/lisp
parent62c25abaa3e93be5815172d391295a6ab0390122 (diff)
misc: move to new pool_foreach macros
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/lisp')
-rw-r--r--src/plugins/lisp/lisp-cp/control.c58
-rw-r--r--src/plugins/lisp/lisp-cp/lisp_api.c12
-rw-r--r--src/plugins/lisp/lisp-cp/lisp_cli.c12
-rw-r--r--src/plugins/lisp/lisp-cp/one_api.c12
-rw-r--r--src/plugins/lisp/lisp-cp/one_cli.c12
-rw-r--r--src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c6
-rw-r--r--src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c24
-rw-r--r--src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c6
-rw-r--r--src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c12
-rw-r--r--src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c6
10 files changed, 80 insertions, 80 deletions
diff --git a/src/plugins/lisp/lisp-cp/control.c b/src/plugins/lisp/lisp-cp/control.c
index 6eee74ac7d0..446a8d7e2cb 100644
--- a/src/plugins/lisp/lisp-cp/control.c
+++ b/src/plugins/lisp/lisp-cp/control.c
@@ -581,15 +581,15 @@ vnet_lisp_adjacencies_get_by_vni (u32 vni)
lisp_adjacency_t *adjs = 0, adj;
/* *INDENT-OFF* */
- pool_foreach(fwd, lcm->fwd_entry_pool,
- ({
+ pool_foreach (fwd, lcm->fwd_entry_pool)
+ {
if (gid_address_vni (&fwd->reid) != vni)
continue;
gid_address_copy (&adj.reid, &fwd->reid);
gid_address_copy (&adj.leid, &fwd->leid);
vec_add1 (adjs, adj);
- }));
+ }
/* *INDENT-ON* */
return adjs;
@@ -804,8 +804,8 @@ vnet_lisp_map_cache_add_del (vnet_lisp_add_del_mapping_args_t * a,
* TODO: Address this in a more efficient way.
*/
/* *INDENT-OFF* */
- pool_foreach (rmts, lcm->lcl_to_rmt_adjacencies,
- ({
+ pool_foreach (rmts, lcm->lcl_to_rmt_adjacencies)
+ {
vec_foreach_index (rmts_itr, rmts[0])
{
remote_idx = vec_elt (rmts[0], rmts_itr);
@@ -815,7 +815,7 @@ vnet_lisp_map_cache_add_del (vnet_lisp_add_del_mapping_args_t * a,
break;
}
}
- }));
+ }
/* *INDENT-ON* */
}
@@ -1392,10 +1392,10 @@ vnet_lisp_clear_all_remote_adjacencies (void)
vnet_lisp_add_del_locator_set_args_t _ls, *ls = &_ls;
/* *INDENT-OFF* */
- pool_foreach_index (mi, lcm->mapping_pool,
- ({
+ pool_foreach_index (mi, lcm->mapping_pool)
+ {
vec_add1 (map_indices, mi);
- }));
+ }
/* *INDENT-ON* */
vec_foreach (map_indexp, map_indices)
@@ -2191,10 +2191,10 @@ lisp_cp_disable_l2_l3_ifaces (lisp_cp_main_t * lcm)
pool_free (lcm->fwd_entry_pool);
/* Clear state tracking rmt-lcl fwd entries */
/* *INDENT-OFF* */
- pool_foreach(rmts, lcm->lcl_to_rmt_adjacencies,
+ pool_foreach (rmts, lcm->lcl_to_rmt_adjacencies)
{
vec_free(rmts[0]);
- });
+ }
/* *INDENT-ON* */
hash_free (lcm->lcl_to_rmt_adjs_by_lcl_idx);
pool_free (lcm->lcl_to_rmt_adjacencies);
@@ -2672,7 +2672,7 @@ build_map_register_record_list (lisp_cp_main_t * lcm)
mapping_t *recs = 0, rec, *m;
/* *INDENT-OFF* */
- pool_foreach(m, lcm->mapping_pool,
+ pool_foreach (m, lcm->mapping_pool)
{
/* for now build only local mappings */
if (!m->local)
@@ -2681,7 +2681,7 @@ build_map_register_record_list (lisp_cp_main_t * lcm)
rec = m[0];
add_locators (lcm, &rec, m->locator_set_index, NULL);
vec_add1 (recs, rec);
- });
+ }
/* *INDENT-ON* */
return recs;
@@ -2902,7 +2902,7 @@ send_rloc_probes (lisp_cp_main_t * lcm)
u32 si, rloc_probes_sent = 0;
/* *INDENT-OFF* */
- pool_foreach (e, lcm->fwd_entry_pool,
+ pool_foreach (e, lcm->fwd_entry_pool)
{
if (vec_len (e->locator_pairs) == 0)
continue;
@@ -2930,7 +2930,7 @@ send_rloc_probes (lisp_cp_main_t * lcm)
&lp->rmt_loc);
rloc_probes_sent++;
}
- });
+ }
/* *INDENT-ON* */
vlib_node_increment_counter (vlib_get_main (), lisp_cp_output_node.index,
@@ -3041,15 +3041,15 @@ _send_encapsulated_map_request (lisp_cp_main_t * lcm,
/* if there is already a pending request remember it */
/* *INDENT-OFF* */
- pool_foreach(pmr, lcm->pending_map_requests_pool,
- ({
+ pool_foreach (pmr, lcm->pending_map_requests_pool)
+ {
if (!gid_address_cmp (&pmr->src, seid)
&& !gid_address_cmp (&pmr->dst, deid))
{
duplicate_pmr = pmr;
break;
}
- }));
+ }
/* *INDENT-ON* */
if (!is_resend && duplicate_pmr)
@@ -4066,10 +4066,10 @@ map_record_args_get ()
/* Cleanup first */
/* *INDENT-OFF* */
- pool_foreach (rec, lcm->map_records_args_pool[vlib_get_thread_index()], ({
+ pool_foreach (rec, lcm->map_records_args_pool[vlib_get_thread_index()]) {
if (rec->is_free)
map_records_arg_free (rec);
- }));
+ }
/* *INDENT-ON* */
pool_get (lcm->map_records_args_pool[vlib_get_thread_index ()], rec);
@@ -4656,8 +4656,8 @@ remove_dead_pending_map_requests (lisp_cp_main_t * lcm)
u32 *to_be_removed = 0, *pmr_index;
/* *INDENT-OFF* */
- pool_foreach (pmr, lcm->pending_map_requests_pool,
- ({
+ pool_foreach (pmr, lcm->pending_map_requests_pool)
+ {
if (pmr->to_be_removed)
{
clib_fifo_foreach (nonce, pmr->nonces, ({
@@ -4666,7 +4666,7 @@ remove_dead_pending_map_requests (lisp_cp_main_t * lcm)
vec_add1 (to_be_removed, pmr - lcm->pending_map_requests_pool);
}
- }));
+ }
/* *INDENT-ON* */
vec_foreach (pmr_index, to_be_removed)
@@ -4754,15 +4754,15 @@ update_map_register (lisp_cp_main_t * lcm, f64 dt)
return;
/* *INDENT-OFF* */
- pool_foreach (pmr, lcm->pending_map_registers_pool,
- ({
+ pool_foreach (pmr, lcm->pending_map_registers_pool)
+ {
if (!update_pending_map_register (pmr, dt, &del_all))
{
if (del_all)
break;
vec_add1 (to_be_removed, pmr - lcm->pending_map_registers_pool);
}
- }));
+ }
/* *INDENT-ON* */
if (del_all)
@@ -4814,11 +4814,11 @@ send_map_resolver_service (vlib_main_t * vm,
(void) vlib_process_get_events (vm, 0);
/* *INDENT-OFF* */
- pool_foreach (pmr, lcm->pending_map_requests_pool,
- ({
+ pool_foreach (pmr, lcm->pending_map_requests_pool)
+ {
if (!pmr->to_be_removed)
update_pending_request (pmr, period);
- }));
+ }
/* *INDENT-ON* */
remove_dead_pending_map_requests (lcm);
diff --git a/src/plugins/lisp/lisp-cp/lisp_api.c b/src/plugins/lisp/lisp-cp/lisp_api.c
index 041069d5613..d8f889a24fa 100644
--- a/src/plugins/lisp/lisp-cp/lisp_api.c
+++ b/src/plugins/lisp/lisp-cp/lisp_api.c
@@ -590,8 +590,8 @@ vl_api_lisp_locator_set_dump_t_handler (vl_api_lisp_locator_set_dump_t * mp)
filter = mp->filter;
/* *INDENT-OFF* */
- pool_foreach (lsit, lcm->locator_set_pool,
- ({
+ pool_foreach (lsit, lcm->locator_set_pool)
+ {
if (filter && !((1 == filter && lsit->local) ||
(2 == filter && !lsit->local)))
{
@@ -599,7 +599,7 @@ vl_api_lisp_locator_set_dump_t_handler (vl_api_lisp_locator_set_dump_t * mp)
}
send_lisp_locator_set_details (lcm, lsit, reg, mp->context,
lsit - lcm->locator_set_pool);
- }));
+ }
/* *INDENT-ON* */
}
@@ -704,11 +704,11 @@ vl_api_lisp_eid_table_dump_t_handler (vl_api_lisp_eid_table_dump_t * mp)
else
{
/* *INDENT-OFF* */
- pool_foreach (mapit, lcm->mapping_pool,
- ({
+ pool_foreach (mapit, lcm->mapping_pool)
+ {
send_lisp_eid_table_details(mapit, reg, mp->context,
mp->filter);
- }));
+ }
/* *INDENT-ON* */
}
}
diff --git a/src/plugins/lisp/lisp-cp/lisp_cli.c b/src/plugins/lisp/lisp-cp/lisp_cli.c
index 8685c1cc04a..569d695b033 100644
--- a/src/plugins/lisp/lisp-cp/lisp_cli.c
+++ b/src/plugins/lisp/lisp-cp/lisp_cli.c
@@ -841,8 +841,8 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm,
if (print_all)
{
/* *INDENT-OFF* */
- pool_foreach (mapit, lcm->mapping_pool,
- ({
+ pool_foreach (mapit, lcm->mapping_pool)
+ {
if (mapit->pitr_set)
continue;
@@ -855,7 +855,7 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm,
}
vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
lcm, mapit, ls);
- }));
+ }
/* *INDENT-ON* */
}
else
@@ -1300,8 +1300,8 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm,
"Priority", "Weight");
/* *INDENT-OFF* */
- pool_foreach (lsit, lcm->locator_set_pool,
- ({
+ pool_foreach (lsit, lcm->locator_set_pool)
+ {
u8 * msg = 0;
int next_line = 0;
if (lsit->local)
@@ -1330,7 +1330,7 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm,
}
vlib_cli_output (vm, "%v", msg);
vec_free (msg);
- }));
+ }
/* *INDENT-ON* */
return 0;
}
diff --git a/src/plugins/lisp/lisp-cp/one_api.c b/src/plugins/lisp/lisp-cp/one_api.c
index eb0b4c691b7..3969dd245ab 100644
--- a/src/plugins/lisp/lisp-cp/one_api.c
+++ b/src/plugins/lisp/lisp-cp/one_api.c
@@ -791,8 +791,8 @@ vl_api_one_locator_set_dump_t_handler (vl_api_one_locator_set_dump_t * mp)
filter = mp->filter;
/* *INDENT-OFF* */
- pool_foreach (lsit, lcm->locator_set_pool,
- ({
+ pool_foreach (lsit, lcm->locator_set_pool)
+ {
if (filter && !((1 == filter && lsit->local) ||
(2 == filter && !lsit->local)))
{
@@ -800,7 +800,7 @@ vl_api_one_locator_set_dump_t_handler (vl_api_one_locator_set_dump_t * mp)
}
send_one_locator_set_details (lcm, lsit, reg, mp->context,
lsit - lcm->locator_set_pool);
- }));
+ }
/* *INDENT-ON* */
}
@@ -921,11 +921,11 @@ vl_api_one_eid_table_dump_t_handler (vl_api_one_eid_table_dump_t * mp)
else
{
/* *INDENT-OFF* */
- pool_foreach (mapit, lcm->mapping_pool,
- ({
+ pool_foreach (mapit, lcm->mapping_pool)
+ {
send_one_eid_table_details(mapit, reg, mp->context,
mp->filter);
- }));
+ }
/* *INDENT-ON* */
}
}
diff --git a/src/plugins/lisp/lisp-cp/one_cli.c b/src/plugins/lisp/lisp-cp/one_cli.c
index b43532684ef..b85fea16ea7 100644
--- a/src/plugins/lisp/lisp-cp/one_cli.c
+++ b/src/plugins/lisp/lisp-cp/one_cli.c
@@ -1157,8 +1157,8 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm,
if (print_all)
{
/* *INDENT-OFF* */
- pool_foreach (mapit, lcm->mapping_pool,
- ({
+ pool_foreach (mapit, lcm->mapping_pool)
+ {
if (mapit->pitr_set || mapit->nsh_set)
continue;
@@ -1171,7 +1171,7 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm,
}
vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
lcm, mapit, ls);
- }));
+ }
/* *INDENT-ON* */
}
else
@@ -1841,8 +1841,8 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm,
"Priority", "Weight");
/* *INDENT-OFF* */
- pool_foreach (lsit, lcm->locator_set_pool,
- ({
+ pool_foreach (lsit, lcm->locator_set_pool)
+ {
u8 * msg = 0;
int next_line = 0;
if (lsit->local)
@@ -1871,7 +1871,7 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm,
}
vlib_cli_output (vm, "%v", msg);
vec_free (msg);
- }));
+ }
/* *INDENT-ON* */
return 0;
}
diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c
index d93f3abaad2..8d20412a1f2 100644
--- a/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c
+++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c
@@ -559,13 +559,13 @@ lisp_gpe_adjacency_show (vlib_main_t * vm,
else
{
/* *INDENT-OFF* */
- pool_foreach (ladj, lisp_adj_pool,
- ({
+ pool_foreach (ladj, lisp_adj_pool)
+ {
vlib_cli_output (vm, "[%d] %U\n",
ladj - lisp_adj_pool,
format_lisp_gpe_adjacency, ladj,
LISP_GPE_ADJ_FORMAT_FLAG_NONE);
- }));
+ }
/* *INDENT-ON* */
}
diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c
index 00d5af4922a..5f196fb22e3 100644
--- a/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c
+++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c
@@ -1357,8 +1357,8 @@ vnet_lisp_gpe_fwd_entry_flush (void)
lisp_gpe_fwd_entry_t *lfe;
/* *INDENT-OFF* */
- pool_foreach (lfe, lgm->lisp_fwd_entry_pool,
- ({
+ pool_foreach (lfe, lgm->lisp_fwd_entry_pool)
+ {
switch (fid_addr_type(&lfe->key->rmt))
{
case FID_ADDR_MAC:
@@ -1371,7 +1371,7 @@ vnet_lisp_gpe_fwd_entry_flush (void)
del_nsh_fwd_entry_i (lgm, lfe);
break;
}
- }));
+ }
/* *INDENT-ON* */
}
@@ -1477,13 +1477,13 @@ lisp_gpe_fwd_entry_show (vlib_main_t * vm,
}
/* *INDENT-OFF* */
- pool_foreach (lfe, lgm->lisp_fwd_entry_pool,
- ({
+ pool_foreach (lfe, lgm->lisp_fwd_entry_pool)
+ {
if ((vni == ~0) ||
(lfe->key->vni == vni))
vlib_cli_output (vm, "%U", format_lisp_gpe_fwd_entry, lfe,
LISP_GPE_FWD_ENTRY_FORMAT_NONE);
- }));
+ }
/* *INDENT-ON* */
return (NULL);
@@ -1522,10 +1522,10 @@ vnet_lisp_gpe_get_fwd_entry_vnis (void)
u32 *vnis = 0;
/* *INDENT-OFF* */
- pool_foreach (lfe, lgm->lisp_fwd_entry_pool,
- ({
+ pool_foreach (lfe, lgm->lisp_fwd_entry_pool)
+ {
hash_set (vnis, lfe->key->vni, 0);
- }));
+ }
/* *INDENT-ON* */
return vnis;
@@ -1539,8 +1539,8 @@ vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni)
lisp_api_gpe_fwd_entry_t *entries = 0, e;
/* *INDENT-OFF* */
- pool_foreach (lfe, lgm->lisp_fwd_entry_pool,
- ({
+ pool_foreach (lfe, lgm->lisp_fwd_entry_pool)
+ {
if (lfe->key->vni == vni)
{
clib_memset (&e, 0, sizeof (e));
@@ -1553,7 +1553,7 @@ vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni)
memcpy (&e.leid, &lfe->key->lcl, sizeof (e.leid));
vec_add1 (entries, e);
}
- }));
+ }
/* *INDENT-ON* */
return entries;
diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c
index b84c76f0103..9c48c0064ca 100644
--- a/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c
+++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c
@@ -245,10 +245,10 @@ lisp_gpe_sub_interface_show (vlib_main_t * vm,
"local RLOC");
/* *INDENT-OFF* */
- pool_foreach (l3s, lisp_gpe_sub_interface_pool,
- ({
+ pool_foreach (l3s, lisp_gpe_sub_interface_pool)
+ {
vlib_cli_output (vm, "%U", format_lisp_gpe_sub_interface, l3s);
- }));
+ }
/* *INDENT-ON* */
return 0;
diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c
index fb6aa1ac1d5..b6173b273c0 100644
--- a/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c
+++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c
@@ -263,11 +263,11 @@ lisp_gpe_tenant_flush (void)
lisp_gpe_tenant_t *lt;
/* *INDENT-OFF* */
- pool_foreach(lt, lisp_gpe_tenant_pool,
- ({
+ pool_foreach (lt, lisp_gpe_tenant_pool)
+ {
lisp_gpe_tenant_l2_iface_unlock(lt->lt_vni);
lisp_gpe_tenant_l3_iface_unlock(lt->lt_vni);
- }));
+ }
/* *INDENT-ON* */
}
@@ -306,10 +306,10 @@ lisp_gpe_tenant_show (vlib_main_t * vm,
lisp_gpe_tenant_t *lt;
/* *INDENT-OFF* */
- pool_foreach (lt, lisp_gpe_tenant_pool,
- ({
+ pool_foreach (lt, lisp_gpe_tenant_pool)
+ {
vlib_cli_output (vm, "%U", format_lisp_gpe_tenant, lt);
- }));
+ }
/* *INDENT-ON* */
return 0;
diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c
index b2426429322..14ee095d2de 100644
--- a/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c
+++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c
@@ -254,10 +254,10 @@ show_lisp_gpe_tunnel_command_fn (vlib_main_t * vm,
else
{
/* *INDENT-OFF* */
- pool_foreach (lgt, lisp_gpe_tunnel_pool,
- ({
+ pool_foreach (lgt, lisp_gpe_tunnel_pool)
+ {
vlib_cli_output (vm, "%U", format_lisp_gpe_tunnel, lgt);
- }));
+ }
/* *INDENT-ON* */
}