@@ -447,6 +447,10 @@ struct ibv_create_cq_resp {
__u32 cqe;
};
+enum ibv_create_cq_ex_kernel_flags {
+ IBV_CREATE_CQ_EX_KERNEL_FLAG_COMPLETION_TIMESTAMP = 1 << 0,
+};
+
struct ibv_create_cq_ex {
struct ex_hdr hdr;
__u64 user_handle;
@@ -371,6 +371,7 @@ enum ibv_create_cq_wc_flags {
IBV_WC_EX_WITH_SLID = 1 << 5,
IBV_WC_EX_WITH_SL = 1 << 6,
IBV_WC_EX_WITH_DLID_PATH_BITS = 1 << 7,
+ IBV_WC_EX_WITH_COMPLETION_TIMESTAMP = 1 << 8,
};
enum {
@@ -892,6 +893,7 @@ struct ibv_cq_ex {
uint16_t (*read_slid)(struct ibv_cq_ex *current);
uint8_t (*read_sl)(struct ibv_cq_ex *current);
uint8_t (*read_dlid_path_bits)(struct ibv_cq_ex *current);
+ uint64_t (*read_completion_ts)(struct ibv_cq_ex *current);
};
static inline struct ibv_cq *ibv_cq_ex_to_cq(struct ibv_cq_ex *cq)
@@ -980,6 +982,11 @@ static inline uint8_t ibv_wc_read_dlid_path_bits(struct ibv_cq_ex *cq)
return cq->read_dlid_path_bits(cq);
}
+static inline uint64_t ibv_wc_read_completion_ts(struct ibv_cq_ex *cq)
+{
+ return cq->read_completion_ts(cq);
+}
+
struct ibv_ah {
struct ibv_context *context;
struct ibv_pd *pd;
@@ -39,6 +39,7 @@ enum ibv_wc_flags_ex {
IBV_WC_EX_WITH_SLID = 1 << 5, /* Require slid in WC */
IBV_WC_EX_WITH_SL = 1 << 6, /* Require sl in WC */
IBV_WC_EX_WITH_DLID_PATH_BITS = 1 << 7, /* Require dlid path bits in WC */
+ IBV_WC_EX_WITH_COMPLETION_TIMESTAMP = 1 << 8, /* Require completion timestamp in WC /*
};
.SH "Polling an extended CQ"
@@ -118,6 +119,9 @@ These functions are used in order to poll the current completion. The current co
.BI "uint8_t ibv_wc_read_dlid_path_bits(struct ibv_cq_ex " "*cq"); \c
Get the dlid_path_bits field from the current completion.
+.BI "uint64_t ibv_wc_read_completion_ts(struct ibv_cq_ex " "*cq"); \c
+ Get the completion timestamp from the current completion.
+
.SH "RETURN VALUE"
.B ibv_create_cq_ex()
returns a pointer to the CQ, or NULL if the request fails.
@@ -484,6 +484,12 @@ int ibv_cmd_create_cq_ex(struct ibv_context *context,
cmd->comp_channel = cq_attr->channel ? cq_attr->channel->fd : -1;
cmd->comp_mask = 0;
+ if (cmd_core_size >= offsetof(struct ibv_create_cq_ex, flags) +
+ sizeof(cmd->flags)) {
+ if (cq_attr->wc_flags & IBV_WC_EX_WITH_COMPLETION_TIMESTAMP)
+ cmd->flags |= IBV_CREATE_CQ_EX_KERNEL_FLAG_COMPLETION_TIMESTAMP;
+ }
+
err = write(context->cmd_fd, cmd, cmd_size);
if (err != cmd_size)
return errno;