Skip to content

Commit

Permalink
providers/efa: Fix arguments to rdma_tracepoint
Browse files Browse the repository at this point in the history
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
1 parent 40fcc1c commit 0a28c51
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions providers/efa/verbs.c
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

0 comments on commit 0a28c51

Please sign in to comment.