From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Honggang LI <honggangli@163.com>
Cc: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH 1/1] RDMA/rxe: Fix the qp flush warnings in req
Date: Sat, 26 Oct 2024 07:52:31 +0200 [thread overview]
Message-ID: <267804d9-df81-489e-8d8b-6dcee7859ae0@linux.dev> (raw)
In-Reply-To: <ZxxMqWp0oCJxPq64@fc39>
在 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
next prev parent reply other threads:[~2024-10-26 5:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 15:20 [PATCH 1/1] RDMA/rxe: Fix the qp flush warnings in req Zhu Yanjun
2024-10-26 1:58 ` Honggang LI
2024-10-26 5:52 ` Zhu Yanjun [this message]
2024-10-30 12:22 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=267804d9-df81-489e-8d8b-6dcee7859ae0@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=honggangli@163.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=zyjzyj2000@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.