diff mbox

[libmlx5,3/7] Add timestmap support for ibv_poll_cq_ex

Message ID 1447590634-12858-4-git-send-email-matanb@mellanox.com (mailing list archive)
State Superseded
Headers show

Commit Message

Matan Barak Nov. 15, 2015, 12:30 p.m. UTC
Add support for filling the timestamp field in ibv_poll_cq_ex
(if it's required by the user).

Signed-off-by: Matan Barak <matanb@mellanox.com>
---
 src/cq.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/src/cq.c b/src/cq.c
index 0185696..5e06990 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -913,6 +913,11 @@  inline int mlx5_poll_one_ex(struct mlx5_cq *cq,
 	wc_ex->wc_flags = 0;
 	wc_ex->reserved = 0;
 
+	if (wc_flags & IBV_WC_EX_WITH_COMPLETION_TIMESTAMP) {
+		*wc_buffer.b64++ = ntohll(cqe64->timestamp);
+		wc_ex->wc_flags |= IBV_WC_EX_WITH_COMPLETION_TIMESTAMP;
+	}
+
 	switch (opcode) {
 	case MLX5_CQE_REQ:
 		err = mlx5_poll_one_cqe_req(cq, cur_rsc, cqe, qpn, cqe_ver,