@@ -1267,6 +1267,16 @@ struct ibv_cq_init_attr_ex {
uint32_t flags;
};
+enum ibv_values_mask {
+ IBV_VALUES_MASK_RAW_CLOCK = 1 << 0,
+ IBV_VALUES_MASK_RESERVED = 1 << 1
+};
+
+struct ibv_values_ex {
+ uint32_t comp_mask;
+ struct timespec raw_clock;
+};
+
enum verbs_context_mask {
VERBS_CONTEXT_XRCD = 1 << 0,
VERBS_CONTEXT_SRQ = 1 << 1,
@@ -1283,6 +1293,8 @@ struct ibv_poll_cq_ex_attr {
struct verbs_context {
/* "grows up" - new fields go here */
+ int (*query_rt_values)(struct ibv_context *context,
+ struct ibv_values_ex *values);
struct ibv_cq *(*create_cq_ex)(struct ibv_context *context,
struct ibv_cq_init_attr_ex *);
struct verbs_ex_private *priv;
@@ -1817,6 +1829,27 @@ ibv_create_qp_ex(struct ibv_context *context, struct ibv_qp_init_attr_ex *qp_ini
}
/**
+ * ibv_query_rt_values_ex - Get current real time @values of a device.
+ * @values - in/out - defines the attributes we need to query/queried.
+ * (Or's bits of enum ibv_values_mask on values->comp_mask field)
+ */
+static inline int
+ibv_query_rt_values_ex(struct ibv_context *context,
+ struct ibv_values_ex *values)
+{
+ struct verbs_context *vctx;
+
+ vctx = verbs_get_ctx_op(context, query_rt_values);
+ if (!vctx)
+ return ENOSYS;
+
+ if (values->comp_mask & ~(IBV_VALUES_MASK_RESERVED - 1))
+ return EINVAL;
+
+ return vctx->query_rt_values(context, values);
+}
+
+/**
* ibv_query_device_ex - Get extended device properties
*/
static inline int