From patchwork Fri Jun 22 15:19:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10482415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DDE0A60388 for ; Fri, 22 Jun 2018 15:19:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D57CC28CAA for ; Fri, 22 Jun 2018 15:19:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5D8628CF4; Fri, 22 Jun 2018 15:19:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 587B628CAA for ; Fri, 22 Jun 2018 15:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933499AbeFVPTQ (ORCPT ); Fri, 22 Jun 2018 11:19:16 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:9172 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933304AbeFVPTQ (ORCPT ); Fri, 22 Jun 2018 11:19:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1529680756; x=1561216756; h=from:to:cc:subject:date:message-id; bh=WjItpAlcKTuI1BHBEmIObb+74+ycccu8/CDMrTLgbUU=; b=IOZ4fyEfBP0JdtnyZufo5t2dc0g9YsZV5OtgUYb+1igrANgFd3j8U0jG JLS4BJAeoeH1+Hs7dVtUUurMbX9MPuNUW/sPr5prt/nhsRP83Pn7OUU/o 2GDERXCFupgSgUJNrRmntcq65pF4uHLTKL8ueq+cGdwiEVnPghi8Na7xK 5fN7qyi0Caguq7iw8+q53yA6BQUje+1tMbH1rQ7MEJphhdVprmgWOEOcv EQXrmeFgSmelWsMa8iDrpm7YnwhreVQxCutWyWuoGh44LaDgQa7f3Dc8G q5rlRm++IConPYGAj2a2cwFk1fc/YbRLwxyzNm+hxA0QY2IDkl9cPxEwc Q==; X-IronPort-AV: E=Sophos;i="5.51,257,1526313600"; d="scan'208";a="81307607" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 22 Jun 2018 23:19:15 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 22 Jun 2018 08:08:44 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 22 Jun 2018 08:19:15 -0700 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Zhu Yanjun , Jianchao Wang , Yuval Shaia , stable@vger.kernel.org Subject: [PATCH] RDMA/rxe: Set wqe->status correctly if an unexpected response is received Date: Fri, 22 Jun 2018 08:19:15 -0700 Message-Id: <20180622151915.11502-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Every function that returns COMPST_ERROR must set wqe->status to another value than IB_WC_SUCCESS before returning COMPST_ERROR. Fix the only code path for which this is not yet the case. Signed-off-by: Bart Van Assche Cc: Zhu Yanjun Cc: Jianchao Wang Cc: Yuval Shaia Cc: --- drivers/infiniband/sw/rxe/rxe_comp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index 98d470d1f3fc..5bc62c0cc802 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -276,6 +276,9 @@ static inline enum comp_state check_ack(struct rxe_qp *qp, case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE: if (wqe->wr.opcode != IB_WR_RDMA_READ && wqe->wr.opcode != IB_WR_RDMA_READ_WITH_INV) { + pr_err("%s: opcode wr %d <> pkt %d\n", __func__, + wqe->wr.opcode, pkt->opcode); + wqe->status = IB_WC_FATAL_ERR; return COMPST_ERROR; } reset_retry_counters(qp);