Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 093392ec authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Greg Kroah-Hartman
Browse files

rxe: fix error completion wr_id and qp_num



commit e48d8ed9c6193502d849b35767fd18e20bbd7ba2 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: default avatarWalker Benjamin <benjamin.walker@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Tested-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00f0194c
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -826,11 +826,16 @@ static enum resp_states do_complete(struct rxe_qp *qp,


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


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


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