From patchwork Wed Jul 20 08:56:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 12923689 X-Patchwork-Delegate: jgg@ziepe.ca 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 BE171C43334 for ; Wed, 20 Jul 2022 08:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbiGTI4i (ORCPT ); Wed, 20 Jul 2022 04:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiGTI4h (ORCPT ); Wed, 20 Jul 2022 04:56:37 -0400 Received: from mail1.bemta34.messagelabs.com (mail1.bemta34.messagelabs.com [195.245.231.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE8AD20F73 for ; Wed, 20 Jul 2022 01:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1658307395; i=@fujitsu.com; bh=WWvTr9oZhgTy9NzyKlfCg+FUhx6T8/rIpXev7udUMt4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=xKKgWMEKkyMMplSOBTwZVfwxTmAsJj2QAHZnJXFCaCDPskPRamzTPPtEPehPdQejp MyhB/CaIEHSGYZ2J9xnrnJkxfsWxx7fH+5F4N4ewHFNf6XH2q9Zs1LYMKyKinqUZim YhhL1qMVwYY4MaNa2pHS+ubD8r2lgOkidbVCRfzZUN1oH77udyYk1fqoZMS9It0+t/ uwwN66OC19mpwZu6/gOVcopb+ZgNZ8HmYmYQiJJnOnp489l1PJYcvSh04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mx1DEaHmR+9Pf1xuP s35xfeUieeOGw3zdsu93A5pONkQE8E6Yf9tZnTH835VdAskVF7gvss41f6ndL8U0w5L18A7Hq fLTdkzVbVR++CrlhRJLcUaioRZzUXEiAAgfxb6XAwAA X-Env-Sender: lizhijian@fujitsu.com X-Msg-Ref: server-5.tower-571.messagelabs.com!1658307394!160602!1 X-Originating-IP: [62.60.8.97] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.87.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4467 invoked from network); 20 Jul 2022 08:56:34 -0000 Received: from unknown (HELO n03ukasimr01.n03.fujitsu.local) (62.60.8.97) by server-5.tower-571.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Jul 2022 08:56:34 -0000 Received: from n03ukasimr01.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr01.n03.fujitsu.local (Postfix) with ESMTP id 19C79100191; Wed, 20 Jul 2022 09:56:34 +0100 (BST) Received: from R01UKEXCASM126.r01.fujitsu.local (R01UKEXCASM126 [10.183.43.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr01.n03.fujitsu.local (Postfix) with ESMTPS id 0CF32100190; Wed, 20 Jul 2022 09:56:34 +0100 (BST) Received: from centos-smtp.localdomain (10.167.226.45) by R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 09:56:30 +0100 From: Li Zhijian To: Yanjun Zhu , Jason Gunthorpe , "Haakon Bugge" , , Bob Pearson , Leon Romanovsky CC: Cheng Xu , Li Zhijian Subject: [PATCH RESEND for-next v6 1/4] RDMA/rxe: Update wqe_index for each wqe error completion Date: Wed, 20 Jul 2022 04:56:05 -0400 Message-ID: <1658307368-1851-2-git-send-email-lizhijian@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1658307368-1851-1-git-send-email-lizhijian@fujitsu.com> References: <1658307368-1851-1-git-send-email-lizhijian@fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.45] X-ClientProxiedBy: G08CNEXCHPEKD08.g08.fujitsu.local (10.167.33.83) To R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Previously, if user space keeps sending abnormal wqe, queue.index will keep increasing while qp->req.wqe_index doesn't. Once qp->req.wqe_index==queue.index in next round, req_next_wqe() will treat queue as empty. In such case, no new completion would be generated. Update wqe_index for each wqe completion so that req_next_wqe() can get next wqe properly. Signed-off-by: Li Zhijian --- drivers/infiniband/sw/rxe/rxe_req.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index dec4ddaca70f..c187deeb6e6b 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -760,6 +760,8 @@ int rxe_requester(void *arg) if (ah) rxe_put(ah); err: + /* update wqe_index for each wqe completion */ + qp->req.wqe_index = queue_next_index(qp->sq.queue, qp->req.wqe_index); wqe->state = wqe_state_error; __rxe_do_task(&qp->comp.task);