Adds a new page to mlx5 core containing clock info data that allows user level applications to translate between cqe timestamp to nanoseconds. The information stored into this page is represented through mlx5_ib_clock_info. In order to synchronize between kernel and user space a sequence number is incremented at the beginning and end of each update. An odd number means the data is being updated while an even means the access was already done. To guarantee that the data structure was accessed atomically user will: repeat: seq1 = <read sequence> goto <repeate> while odd <read data structure> seq2 = <read sequence> if seq1 != seq2 goto repeat
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -381,4 +381,20 @@ struct mlx5_ib_modify_wq { · 380 unmodified lines | |||
| 381 | __u32 comp_mask; | 381 | __u32 comp_mask; |
| 382 | __u32 reserved; | 382 | __u32 reserved; |
| 383 | }; | 383 | }; |
| 384 | |||
| 385 | struct mlx5_ib_clock_info { | ||
| 386 | __u32 sign; | ||
| 387 | __u32 resv; | ||
| 388 | __u64 nsec; | ||
| 389 | __u64 cycles; | ||
| 390 | __u64 frac; | ||
| 391 | __u32 mult; | ||
| 392 | __u32 shift; | ||
| 393 | __u64 mask; | ||
| 394 | __u64 overflow_period; | ||
| 395 | }; | ||
| 396 | |||
| 397 | enum { | ||
| 398 | MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1, | ||
| 399 | }; | ||
| 384 | #endif /* MLX5_ABI_USER_H */ | 400 | #endif /* MLX5_ABI_USER_H */ |