From patchwork Mon Mar 28 15:17:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 12793808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5222AC433EF for ; Mon, 28 Mar 2022 15:17:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbiC1PTe (ORCPT ); Mon, 28 Mar 2022 11:19:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbiC1PTe (ORCPT ); Mon, 28 Mar 2022 11:19:34 -0400 Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48B43606EB for ; Mon, 28 Mar 2022 08:17:53 -0700 (PDT) IronPort-Data: A9a23:Z0bmYKMC5T+zuaDvrR1JlcFynXyQoLVcMsFnjC/WdQm50Glw12MAzWMXCmHQO/beZjbyLdx2aoXlox4Bu8ODm99gGjLY11k3ESsS9pCt6fd1j6vIF3rLaJWFFSqL1u1GAjX7BJ1yHi+0SiuFaOC79yEmjfjQH9IQNcafUsxPbV49IMseoUI78wIJqtYAbemRW2thi/uryyHsEAPNNwpPD44hw/nrRCWDExjFkGhwUlQWPZintbJF/pUfJMp3yaqZdxMUTmTId9NWSdovzJnhlo/Y1xwrTN24kLfnaVBMSbnXVeSMoiMOHfH83V4Z/Wpvuko4HKN0hUN/mjyPkMA3ysRlu4GySBsyI+vHn+F1vxxwSnslZfYapeScSZS4mYnJp6HcSFP22/hnFloxO40A9854BGhP8boTLzVlRgGKgeCrxvSpSvREgsUlMdmtMI4B0lliwj7xC+gnTZHKBa7N4Ldw2Do3gNpJNfDAZsYYYHxkaxGoSxlOPEoHTYgyme6AmHbyaXtbpUiTqK5x5HLcpDGdepCF3MH9I4TMHJsK2B3D4D+uwogwOTlCXPT39NZP2ivEajfzoB7G IronPort-HdrOrdr: A9a23:cNcv4aqtPfXx0sjm0/4jYsoaV5rDeYIsimQD101hICG8cqSj+fxG+85rsSMc6QxhP03I9urhBEDtex/hHP1OkOws1NWZLWrbUQKTRekIh+bfKlbbehEWmNQz6U4ZSdkdNDTvNykAse/KpBm/D807wMSKtIShheLlxX9rSg1wApsQljtRO0KKFFFsXglaCd4cHJqY3MBOoD2tYjA5dcK+b0N1J9Trlpnako78ex4aC1oC4AmKtzmh77n3CFy5834lIlVy/Ys= X-IronPort-AV: E=Sophos;i="5.88,333,1635177600"; d="scan'208";a="123034533" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 Mar 2022 23:17:52 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 6ABB64D169FF; Mon, 28 Mar 2022 23:17:51 +0800 (CST) Received: from G08CNEXCHPEKD08.g08.fujitsu.local (10.167.33.83) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 28 Mar 2022 23:17:53 +0800 Received: from localhost.localdomain (10.167.215.54) by G08CNEXCHPEKD08.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Mon, 28 Mar 2022 23:17:52 +0800 From: Xiao Yang To: CC: , , , , Xiao Yang Subject: [PATCH v2] RDMA/rxe: Generate a completion on error after getting a wqe Date: Mon, 28 Mar 2022 23:17:48 +0800 Message-ID: <20220328151748.304551-1-yangx.jy@fujitsu.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 6ABB64D169FF.AA879 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@fujitsu.com Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Current rxe_requester() doesn't generate a completion on error after getting a wqe. Fix the issue by calling "goto err;" instead. Signed-off-by: Xiao Yang --- drivers/infiniband/sw/rxe/rxe_req.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index ae5fbc79dd5c..e69fe409fbcb 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -648,26 +648,30 @@ int rxe_requester(void *arg) psn_compare(qp->req.psn, (qp->comp.psn + RXE_MAX_UNACKED_PSNS)) > 0)) { qp->req.wait_psn = 1; - goto exit; + wqe->status = IB_WC_LOC_QP_OP_ERR; + goto err; } /* Limit the number of inflight SKBs per QP */ if (unlikely(atomic_read(&qp->skb_out) > RXE_INFLIGHT_SKBS_PER_QP_HIGH)) { qp->need_req_skb = 1; - goto exit; + wqe->status = IB_WC_LOC_QP_OP_ERR; + goto err; } opcode = next_opcode(qp, wqe, wqe->wr.opcode); if (unlikely(opcode < 0)) { wqe->status = IB_WC_LOC_QP_OP_ERR; - goto exit; + goto err; } mask = rxe_opcode[opcode].mask; if (unlikely(mask & RXE_READ_OR_ATOMIC_MASK)) { - if (check_init_depth(qp, wqe)) - goto exit; + if (check_init_depth(qp, wqe)) { + wqe->status = IB_WC_LOC_QP_OP_ERR; + goto err; + } } mtu = get_mtu(qp);