diff options
author | Damjan Marion <damarion@cisco.com> | 2020-12-13 23:26:56 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-12-14 12:14:21 +0000 |
commit | f0ca1e8d92114582ec9142bd15a40f1eb0102793 (patch) | |
tree | aba56d88d909387605ba7fdaf7fc0fd5d3ff565c /src/vnet | |
parent | b2c31b685fd2cf28436ca32bc93e23eb24c74878 (diff) |
misc: refactor clib_bitmap_foreach macro
Type: refactor
Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/crypto/node.c | 4 | ||||
-rw-r--r-- | src/vnet/fib/ip6_fib.c | 6 | ||||
-rw-r--r-- | src/vnet/handoff.c | 6 | ||||
-rw-r--r-- | src/vnet/interface_api.c | 6 | ||||
-rw-r--r-- | src/vnet/interface_cli.c | 12 | ||||
-rw-r--r-- | src/vnet/interface_format.c | 8 | ||||
-rw-r--r-- | src/vnet/l2/l2_rw.c | 4 | ||||
-rw-r--r-- | src/vnet/mfib/ip6_mfib.c | 6 | ||||
-rw-r--r-- | src/vnet/pg/input.c | 4 | ||||
-rw-r--r-- | src/vnet/span/node.c | 4 | ||||
-rw-r--r-- | src/vnet/span/span.c | 4 | ||||
-rw-r--r-- | src/vnet/span/span_api.c | 4 |
12 files changed, 34 insertions, 34 deletions
diff --git a/src/vnet/crypto/node.c b/src/vnet/crypto/node.c index 12e6033ad80..63ed95e7d93 100644 --- a/src/vnet/crypto/node.c +++ b/src/vnet/crypto/node.c @@ -161,10 +161,10 @@ VLIB_NODE_FN (crypto_dispatch_node) (vlib_main_t * vm, u32 index; /* *INDENT-OFF* */ - clib_bitmap_foreach (index, cm->async_active_ids, ({ + clib_bitmap_foreach (index, cm->async_active_ids) { n_cache = crypto_dequeue_frame (vm, node, ct, cm->dequeue_handlers[index], n_cache, &n_dispatched); - })); + } /* *INDENT-ON* */ if (n_cache) vlib_buffer_enqueue_to_next (vm, node, ct->buffer_indice, ct->nexts, diff --git a/src/vnet/fib/ip6_fib.c b/src/vnet/fib/ip6_fib.c index 6943166663f..62bf16f0efc 100644 --- a/src/vnet/fib/ip6_fib.c +++ b/src/vnet/fib/ip6_fib.c @@ -264,11 +264,11 @@ compute_prefix_lengths_in_search_order (ip6_fib_table_instance_t *table) old = table->prefix_lengths_in_search_order; /* Note: bitmap reversed so this is in fact a longest prefix match */ - clib_bitmap_foreach (i, table->non_empty_dst_address_length_bitmap, - ({ + clib_bitmap_foreach (i, table->non_empty_dst_address_length_bitmap) + { int dst_address_length = 128 - i; vec_add1(prefix_lengths_in_search_order, dst_address_length); - })); + } table->prefix_lengths_in_search_order = prefix_lengths_in_search_order; diff --git a/src/vnet/handoff.c b/src/vnet/handoff.c index ca46b5a7ab6..cbdc5289243 100644 --- a/src/vnet/handoff.c +++ b/src/vnet/handoff.c @@ -213,10 +213,10 @@ interface_handoff_enable_disable (vlib_main_t * vm, u32 sw_if_index, { d->workers_bitmap = bitmap; /* *INDENT-OFF* */ - clib_bitmap_foreach (i, bitmap, - ({ + clib_bitmap_foreach (i, bitmap) + { vec_add1(d->workers, i); - })); + } /* *INDENT-ON* */ } diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c index 240f13fa418..a06f02fe0ac 100644 --- a/src/vnet/interface_api.c +++ b/src/vnet/interface_api.c @@ -1078,8 +1078,8 @@ static void vl_api_sw_interface_rx_placement_dump_t_handler /* *INDENT-OFF* */ foreach_vlib_main (({ - clib_bitmap_foreach (si, pn->sibling_bitmap, - ({ + clib_bitmap_foreach (si, pn->sibling_bitmap) + { rt = vlib_node_get_runtime_data (this_vlib_main, si); vec_foreach (dq, rt->devices_and_queues) { @@ -1088,7 +1088,7 @@ static void vl_api_sw_interface_rx_placement_dump_t_handler send_interface_rx_placement_details (am, reg, hw->sw_if_index, index, dq->queue_id, dq->mode, mp->context); } - })); + } index++; })); /* *INDENT-ON* */ diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c index 73f70cf5b1b..c9f11546b31 100644 --- a/src/vnet/interface_cli.c +++ b/src/vnet/interface_cli.c @@ -139,12 +139,12 @@ show_or_clear_hw_interfaces (vlib_main_t * vm, hi, verbose); /* *INDENT-OFF* */ - clib_bitmap_foreach (hw_idx, hi->bond_info, - ({ + clib_bitmap_foreach (hw_idx, hi->bond_info) + { shi = vnet_get_hw_interface(vnm, hw_idx); vlib_cli_output (vm, "%U\n", format_vnet_hw_interface, vnm, shi, verbose); - })); + } /* *INDENT-ON* */ } } @@ -1663,8 +1663,8 @@ show_interface_rx_placement_fn (vlib_main_t * vm, unformat_input_t * input, /* *INDENT-OFF* */ foreach_vlib_main (({ - clib_bitmap_foreach (si, pn->sibling_bitmap, - ({ + clib_bitmap_foreach (si, pn->sibling_bitmap) + { rt = vlib_node_get_runtime_data (this_vlib_main, si); if (vec_len (rt->devices_and_queues)) @@ -1679,7 +1679,7 @@ show_interface_rx_placement_fn (vlib_main_t * vm, unformat_input_t * input, dq->queue_id, format_vnet_hw_if_rx_mode, dq->mode); } - })); + } if (vec_len (s) > 0) { vlib_cli_output(vm, "Thread %u (%s):\n%v", index, diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c index a2adc9bbb02..9038e5d96e7 100644 --- a/src/vnet/interface_format.c +++ b/src/vnet/interface_format.c @@ -142,9 +142,9 @@ format_vnet_hw_interface_rss_queues (u8 * s, va_list * args) if (bitmap) { /* *INDENT-OFF* */ - clib_bitmap_foreach (i, bitmap, ({ + clib_bitmap_foreach (i, bitmap) { s = format (s, "%u ", i); - })); + } /* *INDENT-ON* */ } @@ -181,8 +181,8 @@ format_vnet_hw_interface (u8 * s, va_list * args) { int hw_idx; s = format (s, "Slave-Idx:"); - clib_bitmap_foreach (hw_idx, hi->bond_info, s = - format (s, " %d", hw_idx)); + clib_bitmap_foreach (hw_idx, hi->bond_info) + s = format (s, " %d", hw_idx); } else if (dev_class->format_device_name) s = format (s, "%U", dev_class->format_device_name, hi->dev_instance); diff --git a/src/vnet/l2/l2_rw.c b/src/vnet/l2/l2_rw.c index 59b7de91279..a7c95fe1a77 100644 --- a/src/vnet/l2/l2_rw.c +++ b/src/vnet/l2/l2_rw.c @@ -498,9 +498,9 @@ l2_rw_show_interfaces_cli_fn (vlib_main_t * vm, uword i; /* *INDENT-OFF* */ - clib_bitmap_foreach(i, rw->configs_bitmap, { + clib_bitmap_foreach (i, rw->configs_bitmap) { vlib_cli_output (vm, "sw_if_index:%d %U\n", i, format_l2_rw_config, &rw->configs[i]); - }); + } /* *INDENT-ON* */ return 0; } diff --git a/src/vnet/mfib/ip6_mfib.c b/src/vnet/mfib/ip6_mfib.c index b5e5bce8ffc..bbab7ae2214 100644 --- a/src/vnet/mfib/ip6_mfib.c +++ b/src/vnet/mfib/ip6_mfib.c @@ -457,10 +457,10 @@ compute_prefix_lengths_in_search_order (ip6_mfib_table_instance_t *table) int i; vec_reset_length (table->prefix_lengths_in_search_order); /* Note: bitmap reversed so this is in fact a longest prefix match */ - clib_bitmap_foreach (i, table->non_empty_dst_address_length_bitmap, - ({ + clib_bitmap_foreach (i, table->non_empty_dst_address_length_bitmap) + { vec_add1(table->prefix_lengths_in_search_order, (256 - i)); - })); + } } void diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c index 63031cef35d..940bf124c56 100644 --- a/src/vnet/pg/input.c +++ b/src/vnet/pg/input.c @@ -1808,10 +1808,10 @@ pg_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) worker_index = vlib_get_current_worker_index (); /* *INDENT-OFF* */ - clib_bitmap_foreach (i, pg->enabled_streams[worker_index], ({ + clib_bitmap_foreach (i, pg->enabled_streams[worker_index]) { pg_stream_t *s = vec_elt_at_index (pg->streams, i); n_packets += pg_input_stream (node, pg, s); - })); + } /* *INDENT-ON* */ return n_packets; diff --git a/src/vnet/span/node.c b/src/vnet/span/node.c index 1a9d1bae724..ca5ea68ae90 100644 --- a/src/vnet/span/node.c +++ b/src/vnet/span/node.c @@ -85,7 +85,7 @@ span_mirror (vlib_main_t * vm, vlib_node_runtime_t * node, u32 sw_if_index0, return; /* *INDENT-OFF* */ - clib_bitmap_foreach (i, sm0->mirror_ports, ( + clib_bitmap_foreach (i, sm0->mirror_ports) { if (mirror_frames[i] == 0) { @@ -121,7 +121,7 @@ span_mirror (vlib_main_t * vm, vlib_node_runtime_t * node, u32 sw_if_index0, #endif } } - })); + } /* *INDENT-ON* */ } diff --git a/src/vnet/span/span.c b/src/vnet/span/span.c index fc923e0ce31..ec47920504a 100644 --- a/src/vnet/span/span.c +++ b/src/vnet/span/span.c @@ -212,7 +212,7 @@ show_interfaces_span_command_fn (vlib_main_t * vm, } s = format (s, "%U", format_vnet_sw_if_index_name, vnm, si - sm->interfaces); - clib_bitmap_foreach (i, b, ( + clib_bitmap_foreach (i, b) { int device = (clib_bitmap_get (drxm->mirror_ports, i) + clib_bitmap_get (dtxm->mirror_ports, i) * 2); @@ -223,7 +223,7 @@ show_interfaces_span_command_fn (vlib_main_t * vm, format_vnet_sw_if_index_name, vnm, i, states[device], states[l2]); vec_reset_length (s); - })); + } clib_bitmap_free (b); clib_bitmap_free (l); clib_bitmap_free (d); diff --git a/src/vnet/span/span_api.c b/src/vnet/span/span_api.c index dacbe2e0aa9..96d1facc2df 100644 --- a/src/vnet/span/span_api.c +++ b/src/vnet/span/span_api.c @@ -86,7 +86,7 @@ vl_api_sw_interface_span_dump_t_handler (vl_api_sw_interface_span_dump_t * mp) clib_bitmap_t *b; u32 i; b = clib_bitmap_dup_or (rxm->mirror_ports, txm->mirror_ports); - clib_bitmap_foreach (i, b, ( + clib_bitmap_foreach (i, b) { rmp = vl_msg_api_alloc (sizeof (*rmp)); clib_memset (rmp, 0, sizeof (*rmp)); @@ -100,7 +100,7 @@ vl_api_sw_interface_span_dump_t_handler (vl_api_sw_interface_span_dump_t * mp) rmp->is_l2 = mp->is_l2; vl_api_send_msg (reg, (u8 *) rmp); - })); + } clib_bitmap_free (b); } } |