From 52de0c78ee45361c51b45fc5728e420b0c3fdf13 Mon Sep 17 00:00:00 2001 From: Andrew Bower Date: Sat, 25 May 2024 16:39:30 +0100 Subject: [PATCH] ON-15689: use public accessor macros to read ef_vi tx ts data Fixes problem whereby TCPDirect treated the bottom two bits of the timestamp nanosecond part as sync flags when these have now moved to a separate field in the event structure. --- src/include/zf_internal/tx_reports.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/include/zf_internal/tx_reports.h b/src/include/zf_internal/tx_reports.h index c52ea2c..6427c93 100644 --- a/src/include/zf_internal/tx_reports.h +++ b/src/include/zf_internal/tx_reports.h @@ -224,10 +224,16 @@ complete(struct queue* q, unsigned z, bool tcp, ef_event* ev) zf_assert(node->zock == zock_id(z, tcp)); zock->pending = node->zock_next; - node->report.timestamp = {ev->tx_timestamp.ts_sec, ev->tx_timestamp.ts_nsec}; + node->report.timestamp = { + .tv_sec = EF_EVENT_TX_WITH_TIMESTAMP_SEC(*ev), + .tv_nsec = EF_EVENT_TX_WITH_TIMESTAMP_NSEC(*ev), + }; + + /* While ef_vi and TCPDirect have the same sync flags layout they can be + * copied without translation. */ static_assert(EF_VI_SYNC_FLAG_CLOCK_SET == ZF_PKT_REPORT_CLOCK_SET); static_assert(EF_VI_SYNC_FLAG_CLOCK_IN_SYNC == ZF_PKT_REPORT_IN_SYNC); - node->report.flags |= (ev->tx_timestamp.ts_nsec & 3); + node->report.flags |= EF_EVENT_TX_WITH_TIMESTAMP_SYNC_FLAGS(*ev); }