diff options
author | Feras Daoud <ferasda@mellanox.com> | 2018-01-16 21:08:40 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-01-18 22:49:21 +0300 |
commit | 24d33d2c8e92abffe1f0653d42fc65b8f164a6d9 (patch) | |
tree | cb353d5f02e6d1c61c06a10fbdfd8798e41c808b /include/linux/mlx5 | |
parent | 246d8b184c100e8eb6b4e8c88f232c2ed2a4e672 (diff) | |
download | linux-24d33d2c8e92abffe1f0653d42fc65b8f164a6d9.tar.xz |
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>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/driver.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 9136e35f2f7e..c403151133e9 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -797,6 +797,7 @@ struct mlx5_clock { u32 nominal_c_mult; unsigned long overflow_period; struct delayed_work overflow_work; + struct mlx5_core_dev *mdev; struct ptp_clock *ptp; struct ptp_clock_info ptp_info; struct mlx5_pps pps_info; @@ -844,6 +845,8 @@ struct mlx5_core_dev { struct cpu_rmap *rmap; #endif struct mlx5_clock clock; + struct mlx5_ib_clock_info *clock_info; + struct page *clock_info_page; }; struct mlx5_db { |