IB/mlx5: Add support for hca_core_clock and timestamp_mask
authorMatan Barak <matanb@mellanox.com>
Tue, 15 Dec 2015 18:30:11 +0000 (20:30 +0200)
committerDoug Ledford <dledford@redhat.com>
Thu, 24 Dec 2015 04:25:59 +0000 (23:25 -0500)
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 <matanb@mellanox.com>
Reviewed-by: Moshe Lazer <moshel@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/main.c
include/linux/mlx5/mlx5_ifc.h

index 22ae0939b20e7b2481ec1a97ee20c5b6571107d1..2d7fac53214f681e50b477f4eefc4f3601bec664 100644 (file)
@@ -503,6 +503,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
        props->max_total_mcast_qp_attach = props->max_mcast_qp_attach *
                                           props->max_mcast_grp;
        props->max_map_per_fmr = INT_MAX; /* no limit in ConnectIB */
+       props->hca_core_clock = MLX5_CAP_GEN(mdev, device_frequency_khz);
+       props->timestamp_mask = 0x7FFFFFFFFFFFFFFFULL;
 
 #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
        if (MLX5_CAP_GEN(mdev, pg))
index 49b34c6466ac4f624a748b27fb52ae639b5815ea..091d8343d5946dad50855a35eb0922e9e7900aff 100644 (file)
@@ -794,15 +794,18 @@ struct mlx5_ifc_cmd_hca_cap_bits {
        u8         reserved_63[0x8];
        u8         log_uar_page_sz[0x10];
 
-       u8         reserved_64[0x100];
+       u8         reserved_64[0x20];
+       u8         device_frequency_mhz[0x20];
+       u8         device_frequency_khz[0x20];
+       u8         reserved_65[0xa0];
 
-       u8         reserved_65[0x1f];
+       u8         reserved_66[0x1f];
        u8         cqe_zip[0x1];
 
        u8         cqe_zip_timeout[0x10];
        u8         cqe_zip_max_num[0x10];
 
-       u8         reserved_66[0x220];
+       u8         reserved_67[0x220];
 };
 
 enum {