net/mlx5e: Add clock info page to mlx5 core devices
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 Reviewed-by: Yishai Hadas <yishaih@mellanox.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Alex Vesker <valex@mellanox.com> Signed-off-by: Feras Daoud <ferasda@mellanox.com> Signed-off-by: Eitan Rabin <rabin@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:

committed by
Doug Ledford

parent
246d8b184c
commit
24d33d2c8e
@@ -381,4 +381,20 @@ struct mlx5_ib_modify_wq {
|
||||
__u32 comp_mask;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct mlx5_ib_clock_info {
|
||||
__u32 sign;
|
||||
__u32 resv;
|
||||
__u64 nsec;
|
||||
__u64 cycles;
|
||||
__u64 frac;
|
||||
__u32 mult;
|
||||
__u32 shift;
|
||||
__u64 mask;
|
||||
__u64 overflow_period;
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1,
|
||||
};
|
||||
#endif /* MLX5_ABI_USER_H */
|
||||
|
Reference in New Issue
Block a user