From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn3nam01on0105.outbound.protection.outlook.com ([104.47.33.105]:23296 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031949AbeCAP0X (ORCPT ); Thu, 1 Mar 2018 10:26:23 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Steve Wise , Jason Gunthorpe , Sasha Levin Subject: [added to the 4.1 stable tree] iw_cxgb4: Only validate the MSN for successful completions Date: Thu, 1 Mar 2018 15:23:14 +0000 Message-ID: <20180301152116.1486-74-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Steve Wise This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit f55688c45442bc863f40ad678c638785b26cdce6 ] 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 Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/cxgb4/cq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4= /cq.c index 68ddb3710215..c1e8c01f4ab3 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c @@ -581,10 +581,10 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq= , struct t4_cqe *cqe, ret =3D -EAGAIN; goto skip_cqe; } - if (unlikely((CQE_WRID_MSN(hw_cqe) !=3D (wq->rq.msn)))) { + if (unlikely(!CQE_STATUS(hw_cqe) && + CQE_WRID_MSN(hw_cqe) !=3D wq->rq.msn)) { t4_set_wq_in_error(wq); - hw_cqe->header |=3D htonl(CQE_STATUS_V(T4_ERR_MSN)); - goto proc_cqe; + hw_cqe->header |=3D cpu_to_be32(CQE_STATUS_V(T4_ERR_MSN)); } goto proc_cqe; } --=20 2.14.1