summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Wise2017-12-18 22:10:00 +0100
committerJason Gunthorpe2017-12-22 00:06:06 +0100
commitf55688c45442bc863f40ad678c638785b26cdce6 (patch)
tree29d6a91c3f075233a9468d83e22bb2caf6f69d77
parentIB/ipoib: Restore MM behavior in case of tx_ring allocation failure (diff)
downloadkernel-qcow2-linux-f55688c45442bc863f40ad678c638785b26cdce6.tar.gz
kernel-qcow2-linux-f55688c45442bc863f40ad678c638785b26cdce6.tar.xz
kernel-qcow2-linux-f55688c45442bc863f40ad678c638785b26cdce6.zip
iw_cxgb4: Only validate the MSN for successful completions
If the RECV CQE is in error, ignore the MSN check. This was causing recvs that were flushed into the sw cq to be completed with the wrong status (BAD_MSN instead of FLUSHED). Cc: stable@vger.kernel.org Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/cxgb4/cq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index b7bfc536e00f..7ed87622e461 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -571,10 +571,10 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, struct t4_cqe *cqe,
ret = -EAGAIN;
goto skip_cqe;
}
- if (unlikely((CQE_WRID_MSN(hw_cqe) != (wq->rq.msn)))) {
+ if (unlikely(!CQE_STATUS(hw_cqe) &&
+ CQE_WRID_MSN(hw_cqe) != wq->rq.msn)) {
t4_set_wq_in_error(wq);
- hw_cqe->header |= htonl(CQE_STATUS_V(T4_ERR_MSN));
- goto proc_cqe;
+ hw_cqe->header |= cpu_to_be32(CQE_STATUS_V(T4_ERR_MSN));
}
goto proc_cqe;
}