diff options
author | Damjan Marion <damarion@cisco.com> | 2020-12-13 21:47:40 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-12-14 12:14:21 +0000 |
commit | b2c31b685fd2cf28436ca32bc93e23eb24c74878 (patch) | |
tree | dc0a1b1ff784445b2cbb0f9b2c07b5bcb4f5a5d0 /src/vnet/session | |
parent | 62c25abaa3e93be5815172d391295a6ab0390122 (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/vnet/session')
-rw-r--r-- | src/vnet/session/application.c | 40 | ||||
-rw-r--r-- | src/vnet/session/application_namespace.c | 8 | ||||
-rw-r--r-- | src/vnet/session/segment_manager.c | 22 | ||||
-rw-r--r-- | src/vnet/session/session_api.c | 8 | ||||
-rw-r--r-- | src/vnet/session/session_cli.c | 12 | ||||
-rw-r--r-- | src/vnet/session/session_rules_table.c | 8 | ||||
-rw-r--r-- | src/vnet/session/session_table.h | 2 |
7 files changed, 50 insertions, 50 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index 975239e563d..20b0a9e137b 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -622,11 +622,11 @@ application_detach_process (application_t * app, u32 api_client_index) app->app_index, api_client_index); /* *INDENT-OFF* */ - pool_foreach (wrk_map, app->worker_maps, ({ + pool_foreach (wrk_map, app->worker_maps) { app_wrk = app_worker_get (wrk_map->wrk_index); if (app_wrk->api_client_index == api_client_index) vec_add1 (wrks, app_wrk->wrk_index); - })); + } /* *INDENT-ON* */ if (!vec_len (wrks)) @@ -1357,7 +1357,7 @@ application_format_listeners (application_t * app, int verbose) } /* *INDENT-OFF* */ - pool_foreach (wrk_map, app->worker_maps, ({ + pool_foreach (wrk_map, app->worker_maps) { app_wrk = app_worker_get (wrk_map->wrk_index); if (hash_elts (app_wrk->listeners_table) == 0) continue; @@ -1365,7 +1365,7 @@ application_format_listeners (application_t * app, int verbose) vlib_cli_output (vm, "%U", format_app_worker_listener, app_wrk, handle, sm_index, verbose); })); - })); + } /* *INDENT-ON* */ } @@ -1382,10 +1382,10 @@ application_format_connects (application_t * app, int verbose) } /* *INDENT-OFF* */ - pool_foreach (wrk_map, app->worker_maps, ({ + pool_foreach (wrk_map, app->worker_maps) { app_wrk = app_worker_get (wrk_map->wrk_index); app_worker_format_connects (app_wrk, verbose); - })); + } /* *INDENT-ON* */ } @@ -1488,10 +1488,10 @@ format_application (u8 * s, va_list * args) format_memory_size, props->tx_fifo_size); /* *INDENT-OFF* */ - pool_foreach (wrk_map, app->worker_maps, ({ + pool_foreach (wrk_map, app->worker_maps) { app_wrk = app_worker_get (wrk_map->wrk_index); s = format (s, "%U", format_app_worker, app_wrk); - })); + } /* *INDENT-ON* */ return s; @@ -1511,9 +1511,9 @@ application_format_all_listeners (vlib_main_t * vm, int verbose) application_format_listeners (0, verbose); /* *INDENT-OFF* */ - pool_foreach (app, app_main.app_pool, ({ + pool_foreach (app, app_main.app_pool) { application_format_listeners (app, verbose); - })); + } /* *INDENT-ON* */ } @@ -1531,9 +1531,9 @@ application_format_all_clients (vlib_main_t * vm, int verbose) application_format_connects (0, verbose); /* *INDENT-OFF* */ - pool_foreach (app, app_main.app_pool, ({ + pool_foreach (app, app_main.app_pool) { application_format_connects (app, verbose); - })); + } /* *INDENT-ON* */ } @@ -1545,9 +1545,9 @@ show_certificate_command_fn (vlib_main_t * vm, unformat_input_t * input, session_cli_return_if_not_enabled (); /* *INDENT-OFF* */ - pool_foreach (ckpair, app_main.cert_key_pair_store, ({ + pool_foreach (ckpair, app_main.cert_key_pair_store) { vlib_cli_output (vm, "%U", format_cert_key_pair, ckpair); - })); + } /* *INDENT-ON* */ return 0; } @@ -1558,12 +1558,12 @@ appliction_format_app_mq (vlib_main_t * vm, application_t * app) app_worker_map_t *map; app_worker_t *wrk; /* *INDENT-OFF* */ - pool_foreach (map, app->worker_maps, ({ + pool_foreach (map, app->worker_maps) { wrk = app_worker_get (map->wrk_index); vlib_cli_output (vm, "[A%d][%d]%U", app->app_index, map->wrk_index, format_svm_msg_q, wrk->event_queue); - })); + } /* *INDENT-ON* */ } @@ -1582,9 +1582,9 @@ appliction_format_all_app_mq (vlib_main_t * vm) } /* *INDENT-OFF* */ - pool_foreach (app, app_main.app_pool, ({ + pool_foreach (app, app_main.app_pool) { appliction_format_app_mq (vm, app); - })); + } /* *INDENT-ON* */ return 0; } @@ -1660,9 +1660,9 @@ show_app_command_fn (vlib_main_t * vm, unformat_input_t * input, { vlib_cli_output (vm, "%U", format_application, 0, 0); /* *INDENT-OFF* */ - pool_foreach (app, app_main.app_pool, ({ + pool_foreach (app, app_main.app_pool) { vlib_cli_output (vm, "%U", format_application, app, 0); - })); + } /* *INDENT-ON* */ } diff --git a/src/vnet/session/application_namespace.c b/src/vnet/session/application_namespace.c index 1c43c79ce47..b9674bed94a 100644 --- a/src/vnet/session/application_namespace.c +++ b/src/vnet/session/application_namespace.c @@ -297,7 +297,7 @@ app_namespace_show_api (vlib_main_t * vm, app_namespace_t * app_ns) /* *INDENT-OFF* */ - pool_foreach (cs, app_ns->app_sockets, ({ + pool_foreach (cs, app_ns->app_sockets) { handle = (app_ns_api_handle_t *) &cs->private_data; cf = clib_file_get (&file_main, handle->aah_file_index); if (handle->aah_app_wrk_index == APP_INVALID_INDEX) @@ -308,7 +308,7 @@ app_namespace_show_api (vlib_main_t * vm, app_namespace_t * app_ns) app_wrk = app_worker_get (handle->aah_app_wrk_index); vlib_cli_output (vm, "%12d%12d%5u", app_wrk->app_index, app_wrk->wrk_map_index, cf->file_descriptor); - })); + } /* *INDENT-ON* */ } @@ -378,9 +378,9 @@ do_ns_list: "sw_if_index", "Name"); /* *INDENT-OFF* */ - pool_foreach (app_ns, app_namespace_pool, ({ + pool_foreach (app_ns, app_namespace_pool) { vlib_cli_output (vm, "%U", format_app_namespace, app_ns); - })); + } /* *INDENT-ON* */ done: diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index 1d648f9e410..65f3f08370e 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -39,7 +39,7 @@ static segment_manager_main_t sm_main; #define segment_manager_foreach_segment_w_lock(VAR, SM, BODY) \ do { \ clib_rwlock_reader_lock (&(SM)->segments_rwlock); \ - pool_foreach((VAR), ((SM)->segments), (BODY)); \ + pool_foreach((VAR), ((SM)->segments)) (BODY); \ clib_rwlock_reader_unlock (&(SM)->segments_rwlock); \ } while (0) @@ -482,9 +482,9 @@ segment_manager_free (segment_manager_t * sm) clib_rwlock_writer_lock (&sm->segments_rwlock); /* *INDENT-OFF* */ - pool_foreach (fifo_segment, sm->segments, ({ + pool_foreach (fifo_segment, sm->segments) { segment_manager_del_segment (sm, fifo_segment); - })); + } /* *INDENT-ON* */ clib_rwlock_writer_unlock (&sm->segments_rwlock); @@ -667,14 +667,14 @@ segment_manager_alloc_session_fifos (segment_manager_t * sm, segment_manager_segment_reader_lock (sm); /* *INDENT-OFF* */ - pool_foreach (cur, sm->segments, ({ + pool_foreach (cur, sm->segments) { free_bytes = fifo_segment_available_bytes (cur); if (free_bytes > max_free_bytes) { max_free_bytes = free_bytes; fs = cur; } - })); + } /* *INDENT-ON* */ if (fs) @@ -955,7 +955,7 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input, "HighWater", "LowWater", "FifoTuning"); /* *INDENT-OFF* */ - pool_foreach (sm, smm->segment_managers, ({ + pool_foreach (sm, smm->segment_managers) { app_wrk = app_worker_get_if_valid (sm->app_wrk_index); app = app_wrk ? application_get (app_wrk->app_index) : 0; custom_logic = (app && (app->cb_fns.fifo_tuning_callback)) ? 1 : 0; @@ -967,7 +967,7 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input, format_memory_size, max_fifo_size, sm->high_watermark, sm->low_watermark, custom_logic ? "custom" : "none"); - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "\n"); @@ -977,11 +977,11 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_output (vm, "%U", format_fifo_segment, 0, verbose); /* *INDENT-OFF* */ - pool_foreach (sm, smm->segment_managers, ({ + pool_foreach (sm, smm->segment_managers) { segment_manager_foreach_segment_w_lock (seg, sm, ({ vlib_cli_output (vm, "%U", format_fifo_segment, seg, verbose); })); - })); + } /* *INDENT-ON* */ } @@ -1024,7 +1024,7 @@ segment_manager_format_sessions (segment_manager_t * sm, int verbose) clib_rwlock_reader_lock (&sm->segments_rwlock); /* *INDENT-OFF* */ - pool_foreach (fs, sm->segments, ({ + pool_foreach (fs, sm->segments) { for (slice_index = 0; slice_index < fs->n_slices; slice_index++) { f = fifo_segment_get_slice_fifo_list (fs, slice_index); @@ -1053,7 +1053,7 @@ segment_manager_format_sessions (segment_manager_t * sm, int verbose) } vec_free (s); } - })); + } /* *INDENT-ON* */ clib_rwlock_reader_unlock (&sm->segments_rwlock); diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index 90c0772493a..d080ae44925 100644 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -969,12 +969,12 @@ send_session_rules_table_details (session_rules_table_t * srt, u8 fib_proto, u8 *tag = 0; /* *INDENT-OFF* */ srt16 = &srt->session_rules_tables_16; - pool_foreach (rule16, srt16->rules, ({ + pool_foreach (rule16, srt16->rules) { ri = mma_rules_table_rule_index_16 (srt16, rule16); tag = session_rules_table_rule_tag (srt, ri, 1); send_session_rule_details4 (rule16, is_local, tp, appns_index, tag, reg, context); - })); + } /* *INDENT-ON* */ } if (is_local || fib_proto == FIB_PROTOCOL_IP6) @@ -982,12 +982,12 @@ send_session_rules_table_details (session_rules_table_t * srt, u8 fib_proto, u8 *tag = 0; /* *INDENT-OFF* */ srt40 = &srt->session_rules_tables_40; - pool_foreach (rule40, srt40->rules, ({ + pool_foreach (rule40, srt40->rules) { ri = mma_rules_table_rule_index_40 (srt40, rule40); tag = session_rules_table_rule_tag (srt, ri, 1); send_session_rule_details6 (rule40, is_local, tp, appns_index, tag, reg, context); - })); + } /* *INDENT-ON* */ } } diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c index ade76ef4e60..a9197547501 100644 --- a/src/vnet/session/session_cli.c +++ b/src/vnet/session/session_cli.c @@ -337,14 +337,14 @@ session_cli_show_all_sessions (vlib_main_t * vm, int verbose) n_closed = 0; /* *INDENT-OFF* */ - pool_foreach(s, pool, ({ + pool_foreach (s, pool) { if (s->session_state >= SESSION_STATE_TRANSPORT_DELETED) { n_closed += 1; continue; } vlib_cli_output (vm, "%U", format_session, s, verbose); - })); + } /* *INDENT-ON* */ if (!n_closed) @@ -622,7 +622,7 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input, "App"); /* *INDENT-OFF* */ - pool_foreach (s, smm->wrk[0].sessions, ({ + pool_foreach (s, smm->wrk[0].sessions) { if (s->session_state != SESSION_STATE_LISTENING || s->session_type != sst) continue; @@ -630,7 +630,7 @@ show_session_command_fn (vlib_main_t * vm, unformat_input_t * input, app_name = application_name_from_index (app_wrk->app_index); vlib_cli_output (vm, "%U%-25v%", format_session, s, 0, app_name); - })); + } /* *INDENT-ON* */ goto done; } @@ -727,9 +727,9 @@ clear_session_command_fn (vlib_main_t * vm, unformat_input_t * input, /* *INDENT-OFF* */ vec_foreach (wrk, smm->wrk) { - pool_foreach(session, wrk->sessions, ({ + pool_foreach (session, wrk->sessions) { clear_session (session); - })); + } }; /* *INDENT-ON* */ } diff --git a/src/vnet/session/session_rules_table.c b/src/vnet/session/session_rules_table.c index 7f5c7bb3bbb..34bd6a38676 100644 --- a/src/vnet/session/session_rules_table.c +++ b/src/vnet/session/session_rules_table.c @@ -599,9 +599,9 @@ session_rules_table_cli_dump (vlib_main_t * vm, session_rules_table_t * srt, vlib_cli_output (vm, "IP4 rules"); /* *INDENT-OFF* */ - pool_foreach(sr4, srt4->rules, ({ + pool_foreach (sr4, srt4->rules) { vlib_cli_output (vm, "%U", format_session_rule4, srt, sr4); - })); + } /* *INDENT-ON* */ } @@ -613,9 +613,9 @@ session_rules_table_cli_dump (vlib_main_t * vm, session_rules_table_t * srt, vlib_cli_output (vm, "IP6 rules"); /* *INDENT-OFF* */ - pool_foreach(sr6, srt6->rules, ({ + pool_foreach (sr6, srt6->rules) { vlib_cli_output (vm, "%U", format_session_rule6, srt, sr6); - })); + } /* *INDENT-ON* */ } diff --git a/src/vnet/session/session_table.h b/src/vnet/session/session_table.h index cf4e9698e3a..ead3c302681 100644 --- a/src/vnet/session/session_table.h +++ b/src/vnet/session/session_table.h @@ -72,7 +72,7 @@ void session_table_init (session_table_t * slt, u8 fib_proto); session_table_t *_get_session_tables (); #define session_table_foreach(VAR, BODY) \ - pool_foreach(VAR, _get_session_tables (), BODY) + pool_foreach (VAR, _get_session_tables ()) BODY #endif /* SRC_VNET_SESSION_SESSION_TABLE_H_ */ /* *INDENT-ON* */ |