summaryrefslogtreecommitdiffstats
path: root/src/plugins/lisp/lisp-cp
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/lisp-cp
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/lisp-cp')
-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
5 files changed, 53 insertions, 53 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;
}