@@ -339,6 +339,16 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
printf("\tlocal_ca_ack_delay:\t\t%d\n", device_attr.orig_attr.local_ca_ack_delay);
print_odp_caps(&device_attr.odp_caps);
+ if (device_attr.completion_timestamp_mask)
+ printf("\tcompletion timestamp_mask:\t\t\t0x%016lx\n",
+ device_attr.completion_timestamp_mask);
+ else
+ printf("\tcompletion_timestamp_mask not supported\n");
+
+ if (device_attr.hca_core_clock)
+ printf("\thca_core_clock:\t\t\t%lukHZ\n", device_attr.hca_core_clock);
+ else
+ printf("\tcore clock not supported\n");
}
for (port = 1; port <= device_attr.orig_attr.phys_port_cnt; ++port) {
@@ -269,6 +269,8 @@ struct ibv_query_device_resp_ex {
__u32 comp_mask;
__u32 response_length;
struct ibv_odp_caps_resp odp_caps;
+ __u64 timestamp_mask;
+ __u64 hca_core_clock;
};
struct ibv_query_port {
@@ -207,6 +207,8 @@ struct ibv_device_attr_ex {
struct ibv_device_attr orig_attr;
uint32_t comp_mask;
struct ibv_odp_caps odp_caps;
+ uint64_t completion_timestamp_mask;
+ uint64_t hca_core_clock;
};
enum ibv_mtu {
@@ -189,6 +189,27 @@ int ibv_cmd_query_device_ex(struct ibv_context *context,
}
}
+ if (attr_size >= offsetof(struct ibv_device_attr_ex,
+ completion_timestamp_mask) +
+ sizeof(attr->completion_timestamp_mask)) {
+ if (resp->response_length >=
+ offsetof(struct ibv_query_device_resp_ex, timestamp_mask) +
+ sizeof(resp->timestamp_mask))
+ attr->completion_timestamp_mask = resp->timestamp_mask;
+ else
+ attr->completion_timestamp_mask = 0;
+ }
+
+ if (attr_size >= offsetof(struct ibv_device_attr_ex, hca_core_clock) +
+ sizeof(attr->hca_core_clock)) {
+ if (resp->response_length >=
+ offsetof(struct ibv_query_device_resp_ex, hca_core_clock) +
+ sizeof(resp->hca_core_clock))
+ attr->hca_core_clock = resp->hca_core_clock;
+ else
+ attr->hca_core_clock = 0;
+ }
+
return 0;
}