}
static inline void
-nat_ipfix_send (u32 thread_index, flow_report_main_t * frm,
- vlib_frame_t * f, vlib_buffer_t * b0, u16 template_id)
+nat_ipfix_send (flow_report_main_t *frm, vlib_frame_t *f, vlib_buffer_t *b0,
+ u16 template_id)
{
ip4_ipfix_template_packet_t *tp;
ipfix_message_header_t *h = 0;
template_id = clib_atomic_fetch_or (
&silm->nat44_session_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->nat44_session_frame = 0;
sitd->nat44_session_buffer = 0;
offset = 0;
template_id = clib_atomic_fetch_or (
&silm->addr_exhausted_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->addr_exhausted_frame = 0;
sitd->addr_exhausted_buffer = 0;
offset = 0;
template_id = clib_atomic_fetch_or (
&silm->max_entries_per_user_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->max_entries_per_user_frame = 0;
sitd->max_entries_per_user_buffer = 0;
offset = 0;
template_id = clib_atomic_fetch_or (
&silm->max_sessions_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->max_sessions_frame = 0;
sitd->max_sessions_buffer = 0;
offset = 0;
template_id = clib_atomic_fetch_or (
&silm->max_bibs_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->max_bibs_frame = 0;
sitd->max_bibs_buffer = 0;
offset = 0;
template_id = clib_atomic_fetch_or (
&silm->nat64_bib_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->nat64_bib_frame = 0;
sitd->nat64_bib_buffer = 0;
offset = 0;
template_id = clib_atomic_fetch_or (
&silm->nat64_ses_template_id,
0);
- nat_ipfix_send (thread_index, frm, f, b0, template_id);
+ nat_ipfix_send (frm, f, b0, template_id);
sitd->nat64_ses_frame = 0;
sitd->nat64_ses_buffer = 0;
offset = 0;
if (PREDICT_FALSE (!silm->worker_vms))
{
- for (i = 1; i < vec_len (vlib_mains); i++)
- {
- worker_vm = vlib_mains[i];
- if (worker_vm)
- vec_add1 (silm->worker_vms, worker_vm);
- }
+ for (i = 1; i < vlib_get_n_threads (); i++)
+ {
+ worker_vm = vlib_get_main_by_index (i);
+ if (worker_vm)
+ vec_add1 (silm->worker_vms, worker_vm);
+ }
}
/* Trigger flush for each worker thread */