aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2023-12-27 11:17:23 +0000
committerMatthew Smith <mgsmith@netgate.com>2024-01-02 23:08:59 +0000
commit5d13416f38cbb12e97a7ca696c6186f3a5b4fa98 (patch)
tree2cce8b7f27ce8e4444b968a5dcf59ec6f35cd53e /src
parentb1ea30e5639adb4290df2bfb493729cc0d5f3b70 (diff)
flowprobe: fix calling vlib_time_now() from worker threads
Currently, when flowprobe_export_send() calls vlib_time_now(), a pointer to the main thread's vlib_main_t is always passed (the one cached in flow_report_main). However, that code can also be executed from a worker thread. And passing a pointer to the main thread's vlib_main_t to vlib_time_now() from a worker thread may cause time synchronization issues. Also, running a debug binary will cause an assertion failure in vlib_time_now() in this case. With this fix, flowprobe_export_send() passes the pointer to the current thread's vlib_main_t to vlib_time_how(). This doesn't allow to remove @tag_fixme_vpp_workers from the unit tests yet as they will be failing for other multi-worker related problems. Type: fix Change-Id: Ia35e3a4176777b88cf8ca8af8af7c42c495cbc6a Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/flowprobe/node.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c
index 7645f5d71c5..194664962e8 100644
--- a/src/plugins/flowprobe/node.c
+++ b/src/plugins/flowprobe/node.c
@@ -599,9 +599,8 @@ flowprobe_export_send (vlib_main_t * vm, vlib_buffer_t * b0,
udp->checksum = 0;
/* FIXUP: message header export_time */
- h->export_time = (u32)
- (((f64) frm->unix_time_0) +
- (vlib_time_now (frm->vlib_main) - frm->vlib_time_0));
+ h->export_time =
+ (u32) (((f64) frm->unix_time_0) + (vlib_time_now (vm) - frm->vlib_time_0));
h->export_time = clib_host_to_net_u32 (h->export_time);
h->domain_id = clib_host_to_net_u32 (stream->domain_id);