Skip to content

Commit c03d6b0

Browse files
sagigrimberggregkh
authored andcommitted
rxe: fix error completion wr_id and qp_num
commit e48d8ed upstream. Error completions must still contain a valid wr_id and qp_num such that the consumer can rely on. Correctly fill these fields in receive error completions. Reported-by: Walker Benjamin <benjamin.walker@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com> Tested-by: Zhu Yanjun <yanjun.zhu@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6bf97c0 commit c03d6b0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/infiniband/sw/rxe/rxe_resp.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,11 +844,16 @@ static enum resp_states do_complete(struct rxe_qp *qp,
844844

845845
memset(&cqe, 0, sizeof(cqe));
846846

847-
wc->wr_id = wqe->wr_id;
848-
wc->status = qp->resp.status;
849-
wc->qp = &qp->ibqp;
847+
if (qp->rcq->is_user) {
848+
uwc->status = qp->resp.status;
849+
uwc->qp_num = qp->ibqp.qp_num;
850+
uwc->wr_id = wqe->wr_id;
851+
} else {
852+
wc->status = qp->resp.status;
853+
wc->qp = &qp->ibqp;
854+
wc->wr_id = wqe->wr_id;
855+
}
850856

851-
/* fields after status are not required for errors */
852857
if (wc->status == IB_WC_SUCCESS) {
853858
wc->opcode = (pkt->mask & RXE_IMMDT_MASK &&
854859
pkt->mask & RXE_WRITE_MASK) ?

0 commit comments

Comments
 (0)