From a2ebaaf6f9715e6fcd648cf85d12531018eaa419 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 5 Jun 2024 10:10:45 +0300 Subject: [PATCH] test: packet_gen: use strict global time read function Use odp_time_global_strict() function to read global time to make sure time value is read at the correct point in application processing. Previously, depending on CPU architecture the time value could be read too early in the processing path. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/odp_packet_gen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/performance/odp_packet_gen.c b/test/performance/odp_packet_gen.c index f892329af3..9f325d9b16 100644 --- a/test/performance/odp_packet_gen.c +++ b/test/performance/odp_packet_gen.c @@ -1476,7 +1476,7 @@ static int rx_thread(void *arg) } if (ts_off && num) - rx_ts = odp_time_global(); + rx_ts = odp_time_global_strict(); exit_test = odp_atomic_load_u32(&global->exit_test); if (exit_test) { @@ -1802,7 +1802,7 @@ static inline int update_rand_data(uint8_t *data, uint32_t data_len) static inline void set_timestamp(odp_packet_t pkt, uint32_t ts_off) { - const ts_data_t ts_data = { .magic = TS_MAGIC, .tx_ts = odp_time_global() }; + const ts_data_t ts_data = { .magic = TS_MAGIC, .tx_ts = odp_time_global_strict() }; (void)odp_packet_copy_from_mem(pkt, ts_off, sizeof(ts_data), &ts_data); }