summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-03-26 11:38:01 +0100
committerDamjan Marion <damarion@cisco.com>2021-03-26 16:35:22 +0100
commit92ccf9bcd2692b4b415f31044560c735d639a35c (patch)
treef5308e25329d6853921b7ea4a74d5c3b6f149b25 /src/vnet/session
parentfd8deb48c7ad63b47c5d7465ceefcadef0316f93 (diff)
vlib: convert foreach_vlib_main macro to be more gdb and clang-format friendly
Type: improvement Change-Id: I1152e58d7bfcb3c4347147f87a834d45ad51cdfe Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 469ec0ed529..2400a19a351 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1590,16 +1590,14 @@ session_register_transport (transport_proto_t transport_proto,
vec_validate (smm->session_type_to_next, session_type);
vec_validate (smm->session_tx_fns, session_type);
- /* *INDENT-OFF* */
if (output_node != ~0)
{
- foreach_vlib_main (({
- next_index = vlib_node_add_next (this_vlib_main,
- session_queue_node.index,
- output_node);
- }));
+ foreach_vlib_main ()
+ {
+ next_index = vlib_node_add_next (
+ this_vlib_main, session_queue_node.index, output_node);
+ }
}
- /* *INDENT-ON* */
smm->session_type_to_next[session_type] = next_index;
smm->session_tx_fns[session_type] =
@@ -1755,31 +1753,29 @@ session_node_enable_disable (u8 is_en)
vlib_thread_main_t *vtm = vlib_get_thread_main ();
u8 have_workers = vtm->n_threads != 0;
- /* *INDENT-OFF* */
- foreach_vlib_main (({
- if (have_workers && ii == 0)
- {
- if (is_en)
- {
- vlib_node_set_state (this_vlib_main,
- session_queue_process_node.index, state);
- vlib_node_t *n = vlib_get_node (this_vlib_main,
- session_queue_process_node.index);
- vlib_start_process (this_vlib_main, n->runtime_index);
- }
- else
- {
- vlib_process_signal_event_mt (this_vlib_main,
- session_queue_process_node.index,
- SESSION_Q_PROCESS_STOP, 0);
- }
- if (!session_main.poll_main)
- continue;
- }
- vlib_node_set_state (this_vlib_main, session_queue_node.index,
- state);
- }));
- /* *INDENT-ON* */
+ foreach_vlib_main ()
+ {
+ if (have_workers && ii == 0)
+ {
+ if (is_en)
+ {
+ vlib_node_set_state (this_vlib_main,
+ session_queue_process_node.index, state);
+ vlib_node_t *n = vlib_get_node (
+ this_vlib_main, session_queue_process_node.index);
+ vlib_start_process (this_vlib_main, n->runtime_index);
+ }
+ else
+ {
+ vlib_process_signal_event_mt (this_vlib_main,
+ session_queue_process_node.index,
+ SESSION_Q_PROCESS_STOP, 0);
+ }
+ if (!session_main.poll_main)
+ continue;
+ }
+ vlib_node_set_state (this_vlib_main, session_queue_node.index, state);
+ }
}
clib_error_t *