Re: [PATCH 1/1] RDMA/rxe: Fix the qp flush warnings in req

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




在 2024/10/26 3:58, Honggang LI 写道:
On Fri, Oct 25, 2024 at 05:20:36PM +0200, Zhu Yanjun wrote:
---
  drivers/infiniband/sw/rxe/rxe_req.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 479c07e6e4ed..87a02f0deb00 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -663,10 +663,12 @@ int rxe_requester(struct rxe_qp *qp)
  	if (unlikely(qp_state(qp) == IB_QPS_ERR)) {
  		wqe = __req_next_wqe(qp);
  		spin_unlock_irqrestore(&qp->state_lock, flags);
-		if (wqe)
+		if (wqe) {
+			wqe->status = IB_WC_WR_FLUSH_ERR;
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Why not update wqe->status in function `flush_send_wqe()` ?

flush_send_wqe is to handle the cqe in cq queue. Please see the source code as below.

static int flush_send_wqe(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
{
    struct rxe_cqe cqe = {};
    struct ib_wc *wc = &cqe.ibwc;
    struct ib_uverbs_wc *uwc = &cqe.uibwc;
    int err;

    if (qp->is_user) {
        uwc->wr_id = wqe->wr.wr_id;
        uwc->status = IB_WC_WR_FLUSH_ERR;
        uwc->qp_num = qp->ibqp.qp_num;
    } else {
        wc->wr_id = wqe->wr.wr_id;
        wc->status = IB_WC_WR_FLUSH_ERR;
        wc->qp = &qp->ibqp;
    }

    err = rxe_cq_post(qp->scq, &cqe, 0);
    if (err)
        rxe_dbg_cq(qp->scq, "post cq failed, err = %d\n", err);

    return err;
}

This error occurs in send queue. Please see the source code as below.

static struct rxe_send_wqe *__req_next_wqe(struct rxe_qp *qp)
{
    struct rxe_queue *q = qp->sq.queue;
    unsigned int index = qp->req.wqe_index;
    unsigned int prod;

    prod = queue_get_producer(q, QUEUE_TYPE_FROM_CLIENT);
    if (index == prod)
        return NULL;
    else
        return queue_addr_from_index(q, index);
}

This is why we should set the error status in send queue error handler.

Thanks,

Zhu Yanjun


thanks

--
Best Regards,
Yanjun.Zhu





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux