Skip to content

Commit

Permalink
ON-15689: use public accessor macros to read ef_vi tx ts data
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abower-amd committed May 25, 2024
1 parent 85cf55a commit 5a5f833
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/include/zf_internal/tx_reports.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 5a5f833

Please sign in to comment.