Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

providers/efa: Fix arguments to rdma_tracepoint #1438

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
providers/efa: Fix arguments to rdma_tracepoint
Fix arguments to rdma_tracepoint in efa_process_ex_cqe() and
efa_process_cqe().

Fixes: 62c31f6 ("providers/efa: Add src_qp and ah_num to completion trace event")
Signed-off-by: Yonatan Goldhirsh <[email protected]>
  • Loading branch information
ygoldamzn committed Mar 12, 2024
commit 0a28c51cc3d57ddfbacd36da2c941d274b0ea52b
53 changes: 31 additions & 22 deletions providers/efa/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,17 +610,25 @@ static void efa_process_cqe(struct efa_cq *cq, struct ibv_wc *wc,
wc->vendor_err = cqe->status;
wc->wc_flags = 0;
wc->qp_num = cqe->qp_num;
wc->slid = UINT16_MAX;

wrid_idx = cqe->req_id;
op_type = EFA_GET(&cqe->flags, EFA_IO_CDESC_COMMON_OP_TYPE);

if (EFA_GET(&cqe->flags, EFA_IO_CDESC_COMMON_Q_TYPE) ==
EFA_IO_SEND_QUEUE) {
if (EFA_GET(&cqe->flags, EFA_IO_CDESC_COMMON_Q_TYPE) == EFA_IO_SEND_QUEUE) {
cq->cur_wq = &qp->sq.wq;
if (op_type == EFA_IO_RDMA_WRITE)
wc->opcode = IBV_WC_RDMA_WRITE;
else
wc->opcode = IBV_WC_SEND;

/* We do not have to take the WQ lock here,
* because this wrid index has not been freed yet,
* so there is no contention on this index.
*/
wc->wr_id = cq->cur_wq->wrid[wrid_idx];

rdma_tracepoint(rdma_core_efa, process_completion, cq->dev->name, wc->wr_id,
wc->status, wc->opcode, wc->qp_num, UINT32_MAX, UINT16_MAX,
wc->byte_len);
} else {
struct efa_io_rx_cdesc_ex *rcqe =
container_of(cqe, struct efa_io_rx_cdesc_ex, base.common);
Expand All @@ -644,17 +652,13 @@ static void efa_process_cqe(struct efa_cq *cq, struct ibv_wc *wc,
wc->imm_data = htobe32(rcqe->base.imm);
wc->wc_flags |= IBV_WC_WITH_IMM;
}
}

wrid_idx = cqe->req_id;
/* We do not have to take the WQ lock here,
* because this wrid index has not been freed yet,
* so there is no contention on this index.
*/
wc->wr_id = cq->cur_wq->wrid[wrid_idx];
wc->wr_id = cq->cur_wq->wrid[wrid_idx];

rdma_tracepoint(rdma_core_efa, process_completion, cq->dev->name, wc->wr_id, wc->status,
wc->opcode, wc->src_qp, wc->qp_num, wc->slid, wc->byte_len);
rdma_tracepoint(rdma_core_efa, process_completion, cq->dev->name, wc->wr_id,
wc->status, wc->opcode, wc->src_qp, wc->qp_num, wc->slid,
wc->byte_len);
}
}

static void efa_process_ex_cqe(struct efa_cq *cq, struct efa_qp *qp)
Expand All @@ -665,19 +669,24 @@ static void efa_process_ex_cqe(struct efa_cq *cq, struct efa_qp *qp)

wrid_idx = cqe->req_id;

if (EFA_GET(&cqe->flags, EFA_IO_CDESC_COMMON_Q_TYPE) ==
EFA_IO_SEND_QUEUE) {
if (EFA_GET(&cqe->flags, EFA_IO_CDESC_COMMON_Q_TYPE) == EFA_IO_SEND_QUEUE) {
cq->cur_wq = &qp->sq.wq;
ibvcqx->wr_id = cq->cur_wq->wrid[wrid_idx];
ibvcqx->status = to_ibv_status(cqe->status);

rdma_tracepoint(rdma_core_efa, process_completion, cq->dev->name, ibvcqx->wr_id,
ibvcqx->status, efa_wc_read_opcode(ibvcqx), cqe->qp_num,
UINT32_MAX, UINT16_MAX, efa_wc_read_byte_len(ibvcqx));
} else {
cq->cur_wq = &qp->rq.wq;
}
ibvcqx->wr_id = cq->cur_wq->wrid[wrid_idx];
ibvcqx->status = to_ibv_status(cqe->status);

ibvcqx->wr_id = cq->cur_wq->wrid[wrid_idx];
ibvcqx->status = to_ibv_status(cqe->status);

rdma_tracepoint(rdma_core_efa, process_completion, cq->dev->name, ibvcqx->wr_id,
ibvcqx->status, qp->verbs_qp.qp.qp_num, efa_wc_read_opcode(ibvcqx),
efa_wc_read_byte_len(ibvcqx));
rdma_tracepoint(rdma_core_efa, process_completion, cq->dev->name, ibvcqx->wr_id,
ibvcqx->status, efa_wc_read_opcode(ibvcqx),
efa_wc_read_src_qp(ibvcqx), cqe->qp_num, efa_wc_read_slid(ibvcqx),
efa_wc_read_byte_len(ibvcqx));
}
}

static inline int efa_poll_sub_cq(struct efa_cq *cq, struct efa_sub_cq *sub_cq,
Expand Down