Skip to content

Commit

Permalink
RDMA/rxe: Allow good work requests to be executed
Browse files Browse the repository at this point in the history
A previous commit incorrectly added an 'if(!err)' before scheduling the
requester task in rxe_post_send_kernel(). But if there were send wrs
successfully added to the send queue before a bad wr they might never get
executed.

This commit fixes this by scheduling the requester task if any wqes were
successfully posted in rxe_post_send_kernel() in rxe_verbs.c.

Link: https://lore.kernel.org/r/20240329145513.35381-5-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Fixes: 5bf944f ("RDMA/rxe: Add error messages")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Bob Pearson authored and jgunthorpe committed Apr 22, 2024
1 parent 2b23b60 commit b703374
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/infiniband/sw/rxe/rxe_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,19 +888,23 @@ static int rxe_post_send_kernel(struct rxe_qp *qp,
{
int err = 0;
unsigned long flags;
int good = 0;

spin_lock_irqsave(&qp->sq.sq_lock, flags);
while (ibwr) {
err = post_one_send(qp, ibwr);
if (err) {
*bad_wr = ibwr;
break;
} else {
good++;
}
ibwr = ibwr->next;
}
spin_unlock_irqrestore(&qp->sq.sq_lock, flags);

if (!err)
/* kickoff processing of any posted wqes */
if (good)
rxe_sched_task(&qp->req.task);

spin_lock_irqsave(&qp->state_lock, flags);
Expand Down

0 comments on commit b703374

Please sign in to comment.