diff options
author | Feras Daoud <ferasda@mellanox.com> | 2018-01-16 19:08:41 +0100 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-01-18 20:49:21 +0100 |
commit | 5c99eaecb1fce76e86cf74020624e36fbb63c3bf (patch) | |
tree | 41b190412ee9831aa582c8f8b19300971b68b50d /include | |
parent | net/mlx5e: Add clock info page to mlx5 core devices (diff) | |
download | linux-5c99eaecb1fce76e86cf74020624e36fbb63c3bf.tar.xz linux-5c99eaecb1fce76e86cf74020624e36fbb63c3bf.zip |
IB/mlx5: Mmap the HCA's clock info to user-space
This patch maps the new page to user space applications to
allow converting a user space completion timestamp to system wall
time at the lowest possible latency cost.
By using a versioning scheme we allow compatibility between current
and future userspace libraries.
The change moves mlx5_ib_mmap_cmd enum from mlx5_ib.h to the
abi header file mlx5-abi.h.
Reviewed-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@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')
-rw-r--r-- | include/uapi/rdma/mlx5-abi.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/uapi/rdma/mlx5-abi.h b/include/uapi/rdma/mlx5-abi.h index 0299deed71a2..1111aa4e7c1e 100644 --- a/include/uapi/rdma/mlx5-abi.h +++ b/include/uapi/rdma/mlx5-abi.h @@ -124,7 +124,7 @@ struct mlx5_ib_alloc_ucontext_resp { __u8 cqe_version; __u8 cmds_supp_uhw; __u8 eth_min_inline; - __u8 reserved2; + __u8 clock_info_versions; __u64 hca_core_clock_offset; __u32 log_uar_size; __u32 num_uars_per_page; @@ -394,7 +394,23 @@ struct mlx5_ib_clock_info { __u64 overflow_period; }; +enum mlx5_ib_mmap_cmd { + MLX5_IB_MMAP_REGULAR_PAGE = 0, + MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES = 1, + MLX5_IB_MMAP_WC_PAGE = 2, + MLX5_IB_MMAP_NC_PAGE = 3, + /* 5 is chosen in order to be compatible with old versions of libmlx5 */ + MLX5_IB_MMAP_CORE_CLOCK = 5, + MLX5_IB_MMAP_ALLOC_WC = 6, + MLX5_IB_MMAP_CLOCK_INFO = 7, +}; + enum { MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1, }; + +/* Bit indexes for the mlx5_alloc_ucontext_resp.clock_info_versions bitmap */ +enum { + MLX5_IB_CLOCK_INFO_V1 = 0, +}; #endif /* MLX5_ABI_USER_H */ |