Skip to content

Commit 7c60bcb

Browse files
matanb10dledford
authored andcommitted
IB/mlx5: Add support for hca_core_clock and timestamp_mask
Reporting the hca_core_clock (in kHZ) and the timestamp_mask in query_device extended verb. timestamp_mask is used by users in order to know what is the valid range of the raw timestamps, while hca_core_clock reports the clock frequency that is used for timestamps. Signed-off-by: Matan Barak <[email protected]> Reviewed-by: Moshe Lazer <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 301a721 commit 7c60bcb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
503503
props->max_total_mcast_qp_attach = props->max_mcast_qp_attach *
504504
props->max_mcast_grp;
505505
props->max_map_per_fmr = INT_MAX; /* no limit in ConnectIB */
506+
props->hca_core_clock = MLX5_CAP_GEN(mdev, device_frequency_khz);
507+
props->timestamp_mask = 0x7FFFFFFFFFFFFFFFULL;
506508

507509
#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
508510
if (MLX5_CAP_GEN(mdev, pg))

include/linux/mlx5/mlx5_ifc.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,15 +794,18 @@ struct mlx5_ifc_cmd_hca_cap_bits {
794794
u8 reserved_63[0x8];
795795
u8 log_uar_page_sz[0x10];
796796

797-
u8 reserved_64[0x100];
797+
u8 reserved_64[0x20];
798+
u8 device_frequency_mhz[0x20];
799+
u8 device_frequency_khz[0x20];
800+
u8 reserved_65[0xa0];
798801

799-
u8 reserved_65[0x1f];
802+
u8 reserved_66[0x1f];
800803
u8 cqe_zip[0x1];
801804

802805
u8 cqe_zip_timeout[0x10];
803806
u8 cqe_zip_max_num[0x10];
804807

805-
u8 reserved_66[0x220];
808+
u8 reserved_67[0x220];
806809
};
807810

808811
enum {

0 commit comments

Comments
 (0)