From a4d36026685d9d53490463dac23949eb4d454d2c Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Fri, 31 Jan 2025 01:47:00 +0000 Subject: [PATCH] prov/efa: Add debug log for efa-direct data transfer Add debug log for send/recv/write/read and cq poll Signed-off-by: Shi Jin --- prov/efa/src/efa_cq.c | 3 +++ prov/efa/src/efa_msg.c | 10 ++++++++++ prov/efa/src/efa_rma.c | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/prov/efa/src/efa_cq.c b/prov/efa/src/efa_cq.c index d5bfdb2c949..55b401b1711 100644 --- a/prov/efa/src/efa_cq.c +++ b/prov/efa/src/efa_cq.c @@ -308,6 +308,9 @@ void efa_cq_poll_ibv_cq(ssize_t cqe_to_process, struct efa_ibv_cq *ibv_cq) } efa_cq_construct_cq_entry(cq->ibv_cq.ibv_cq_ex, &cq_entry); + EFA_DBG(FI_LOG_CQ, + "Write cq entry of context: %lx, flags: %lx\n", + (size_t) cq_entry.op_context, cq_entry.flags); switch (opcode) { case IBV_WC_SEND: /* fall through */ diff --git a/prov/efa/src/efa_msg.c b/prov/efa/src/efa_msg.c index 5d5768c8ff1..2938f954eaa 100644 --- a/prov/efa/src/efa_msg.c +++ b/prov/efa/src/efa_msg.c @@ -71,6 +71,11 @@ static inline ssize_t efa_post_recv(struct efa_base_ep *base_ep, const struct fi efa_tracepoint(recv_begin_msg_context, (size_t) msg->context, (size_t) msg->addr); + EFA_DBG(FI_LOG_EP_DATA, + "total len: %zu, addr: %lu, context: %lx, flags: %lx\n", + ofi_total_iov_len(msg->msg_iov, msg->iov_count), + msg->addr, (size_t) msg->context, flags); + ofi_genlock_lock(&base_ep->util_ep.lock); wr_index = base_ep->recv_wr_index; if (wr_index >= base_ep->info->rx_attr->size) { @@ -203,6 +208,11 @@ static inline ssize_t efa_post_send(struct efa_base_ep *base_ep, const struct fi efa_tracepoint(send_begin_msg_context, (size_t) msg->context, (size_t) msg->addr); + EFA_DBG(FI_LOG_EP_DATA, + "total len: %zu, addr: %lu, context: %lx, flags: %lx\n", + ofi_total_iov_len(msg->msg_iov, msg->iov_count), + msg->addr, (size_t) msg->context, flags); + dump_msg(msg, "send"); conn = efa_av_addr_to_conn(base_ep->av, msg->addr); diff --git a/prov/efa/src/efa_rma.c b/prov/efa/src/efa_rma.c index da33b44350f..2492870d3d2 100644 --- a/prov/efa/src/efa_rma.c +++ b/prov/efa/src/efa_rma.c @@ -75,6 +75,11 @@ static inline ssize_t efa_rma_post_read(struct efa_base_ep *base_ep, efa_tracepoint(read_begin_msg_context, (size_t) msg->context, (size_t) msg->addr); + EFA_DBG(FI_LOG_EP_DATA, + "total len: %zu, addr: %lu, context: %lx, flags: %lx\n", + ofi_total_iov_len(msg->msg_iov, msg->iov_count), + msg->addr, (size_t) msg->context, flags); + assert(msg->iov_count > 0 && msg->iov_count <= base_ep->domain->info->tx_attr->iov_limit); assert(msg->rma_iov_count > 0 && @@ -219,6 +224,11 @@ static inline ssize_t efa_rma_post_write(struct efa_base_ep *base_ep, efa_tracepoint(write_begin_msg_context, (size_t) msg->context, (size_t) msg->addr); + EFA_DBG(FI_LOG_EP_DATA, + "total len: %zu, addr: %lu, context: %lx, flags: %lx\n", + ofi_total_iov_len(msg->msg_iov, msg->iov_count), + msg->addr, (size_t) msg->context, flags); + qp = base_ep->qp; ofi_genlock_lock(&base_ep->util_ep.lock);