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

Commit a96ffb1d authored by Selvin Xavier's avatar Selvin Xavier Committed by Roland Dreier
Browse files

RDMA/ocrdma: Avoid reporting wrong completions in case of error CQEs



During cable pull test with a mount over NFS/RDMA, the driver was
reporting error completions when there were no pending requests in the
SQ and RQ.  This was triggering a host crash because of reporting
wrong work req id.  Avoid this crash by adding a check for SQ and RQ
empty condition and prevent reporting completions if queues are empty.

Signed-off-by: default avatarSelvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: default avatarDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent daac9681
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2489,6 +2489,11 @@ static bool ocrdma_poll_err_scqe(struct ocrdma_qp *qp,
			*stop = true;
			*stop = true;
			expand = false;
			expand = false;
		}
		}
	} else if (is_hw_sq_empty(qp)) {
		/* Do nothing */
		expand = false;
		*polled = false;
		*stop = false;
	} else {
	} else {
		*polled = true;
		*polled = true;
		expand = ocrdma_update_err_scqe(ibwc, cqe, qp, status);
		expand = ocrdma_update_err_scqe(ibwc, cqe, qp, status);
@@ -2594,6 +2599,11 @@ static bool ocrdma_poll_err_rcqe(struct ocrdma_qp *qp, struct ocrdma_cqe *cqe,
			*stop = true;
			*stop = true;
			expand = false;
			expand = false;
		}
		}
	} else if (is_hw_rq_empty(qp)) {
		/* Do nothing */
		expand = false;
		*polled = false;
		*stop = false;
	} else {
	} else {
		*polled = true;
		*polled = true;
		expand = ocrdma_update_err_rcqe(ibwc, cqe, qp, status);
		expand = ocrdma_update_err_rcqe(ibwc, cqe, qp, status);