From patchwork Fri Jul 1 06:10:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 12902741 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 F1862C43334 for ; Fri, 1 Jul 2022 06:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234610AbiGAGKd (ORCPT ); Fri, 1 Jul 2022 02:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbiGAGKb (ORCPT ); Fri, 1 Jul 2022 02:10:31 -0400 Received: from esa10.fujitsucc.c3s2.iphmx.com (esa10.fujitsucc.c3s2.iphmx.com [68.232.159.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFFA61A83D for ; Thu, 30 Jun 2022 23:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1656655828; x=1688191828; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=a0k25UCVG/3LCE5UMaU+GGyZmhy5TKmEHdzJxta0PPQ=; b=seohw2z64wPQXcH0kG/8xa1616op0WeRqwP3mbjg/eNf+ro9iBK0lXTE 5D2cM/n1Y2l4xSZzSg1GMIs5edehlZmcR96dZFzxeg+/inW4URSPzg9nM Ifif6x4bFBgkaU/7B1wrrFlNnOR0MREeSwaqvNjroTDo4aOuYvsAFLW5v TUUncDWDvoSdf94hs+bGuN7n2z9J8yAeNaATxy8hYDdXBpxMuI3oBkIab KJUqeaqHpq/Y+sUsYLGlVpzqYpXUjPhlB3V0Xr/rinwDG+otfMBGTGcfc bKsMhj5wSFfNzNDOpfcSleehSt6LIXJh4rxjZjYWKfQoxUFq7AmXuAjLH Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="59519665" X-IronPort-AV: E=Sophos;i="5.92,236,1650898800"; d="scan'208";a="59519665" Received: from mail-tycjpn01lp2177.outbound.protection.outlook.com (HELO JPN01-TYC-obe.outbound.protection.outlook.com) ([104.47.23.177]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 15:10:25 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D/xwnuEN1V9UsgYVHoncEag10Jeyksqw+YLUwhq7TpNnh2CKhVYK1WwIrr/Bq6QWBw2y/DKEnlIZVS9onbYDGV7S17cqBAKXSY8czilhvxS6ripezeQVOQAqfwqeltkURM6YxXCPQn92V9rnWrs3EMA3kOZ+HxRbVlj3b4WQoOSrTkCVkvOWea73EeP70mH2UlDMxzsTsbLrgB1HMyZgOAXSl7ySHQpo0uIG2xOI87rFN/ZTuRBP/3O/+ndmJdB35EHhdVGiJ+Ns6zK7vw5dIcblG0lyrwMlBYnfkMxaDhQJoDlNBN8xpgNorLruJ69w0JBruqqpKD7Y5W4SQ1/shg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a0k25UCVG/3LCE5UMaU+GGyZmhy5TKmEHdzJxta0PPQ=; b=LNfxbklhNSyVdiKcUci+bsuJMdmGScbdG+qfjqbHTaxiDvSv+qfokJDtCsr8Ushf88PCg1BdBDK0U3U1Zxwf08P+IGp0ID0t7NS0nkqiSc7lGmRHNj5KOM4qsyjhYGxYI7/v/043D0QFTZX6Eha7ni48E7H/TNvYQUyX3WLypZVi4/eKn2tO2+YS4W7ljimedDGdHkHEhwsmqPQ2HL9JYqJDfLbhwff3853hzf02zZItAdSy/8cd4F93NvYDPnbALt1+lK9yIdIniYDHa3Pex4AKPtPQPZkfhyU4i89zn1rrMN4Vvw+J9Ox6rgbQmFYkLejNNHl4F5Jc2F+R86Q0ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.onmicrosoft.com; s=selector2-fujitsu-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a0k25UCVG/3LCE5UMaU+GGyZmhy5TKmEHdzJxta0PPQ=; b=UG/ZeSBw8Yg7qbFwR9NXlI28svPvkZP9TTuSEa1F/uTFLEyVsvr3U0VtepqKYpM7uACgtJWnTiQIfQx8iwLGPFFBJG+6Ce1QZMgL4Jx2aJdophJBZbEUt921AHE4komZMTN3jOklm6H4QQle60a/q7a6A3TQ3lH1GYBx3CQ8Gg8= Received: from TYCPR01MB9305.jpnprd01.prod.outlook.com (2603:1096:400:196::10) by OS3PR01MB6626.jpnprd01.prod.outlook.com (2603:1096:604:10c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Fri, 1 Jul 2022 06:10:21 +0000 Received: from TYCPR01MB9305.jpnprd01.prod.outlook.com ([fe80::8d7a:baa8:3b18:cd93]) by TYCPR01MB9305.jpnprd01.prod.outlook.com ([fe80::8d7a:baa8:3b18:cd93%6]) with mapi id 15.20.5395.015; Fri, 1 Jul 2022 06:10:21 +0000 From: "lizhijian@fujitsu.com" To: Yanjun Zhu , Jason Gunthorpe , Haakon Bugge , "linux-rdma@vger.kernel.org" , Bob Pearson CC: "lizhijian@fujitsu.com" Subject: [PATCH v4 1/3] RDMA/rxe: Update wqe_index for each wqe error completion Thread-Topic: [PATCH v4 1/3] RDMA/rxe: Update wqe_index for each wqe error completion Thread-Index: AQHYjRE+Jg119Y7SOk2VHq5PYaeVgQ== Date: Fri, 1 Jul 2022 06:10:21 +0000 Message-ID: <20220701061731.1582399-2-lizhijian@fujitsu.com> References: <20220701061731.1582399-1-lizhijian@fujitsu.com> In-Reply-To: <20220701061731.1582399-1-lizhijian@fujitsu.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.31.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fujitsu.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 245f05e1-3b29-4170-fe07-08da5b286117 x-ms-traffictypediagnostic: OS3PR01MB6626:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cg9GyNyWBvK4QyjGB1e9e1YPp6DeliIHklW0lzTkd31Ru3OTtyHDTrZ5Q1nROHX8AzwAzgWs02X3HBKdWnj+RBF0tuxQMOAbC8+7gIoqF2WU2FgqZDIJXGLRtMbusIq+nmBNH64KzIaWdWMpjih/KomJ3zIgXmCCKz5x0xDE9A46Hls1YTibiHSoR+iiYmvLIuRghacjPQcc42lbG/4aGcvIfhdB4u8eG/5ETkTEpCrslt1OiMAatnM+KxKsKFlEF5huIk/OqPc1JoJaj7HBl0eqcN/6eKafCf1sNuSuuDByZPJi7WfPnc/MzhLPtd54yLyHEL701zg/wphRNFTEIew0fwXBJ2wSyUlCvxgFYHnC/oKJBtaPj+yP7gYO2Uh0iPT0DnamdU0CqN5LoRH4lrPcnYNwzWUgra7WVnfCnRNjwDwobGRRx49Q3TTYjfVOblRlRCpfopsJx7bOFbYX+MlBPx2qtbG7Vy+x29BAuPQhSzMGHN4xLu8r4+YUWRDxjduo/HSMF8f93DYqlxY3H3W3xzeejteJCWathV0ufmpBHHgnTDXozAfFhfZ6K0TDn7/+PwjxeCViZxzue9WBtf2S+UHPJV2GVqHcQxA+QmC1tLluTd2CRHGcSYZRvAakckOS6W2yKuolJpgVCqrfZGQRP0DHAWM5NYRuWmL5Hx3Rj8AlDFI+ec3C/9egkC2h5LmNaBo1ugS52RHet7AqFfGSeE6zRdFH2nYdfnyboGGiRXAV92WKI4h3KWiKKguJtIjiVANRYGYtACIYrsh+EhMMgdt5gOJqqVQZrcMU+8yFeq+D72hp/rx8EvPDHnP/ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB9305.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(366004)(396003)(376002)(136003)(39860400002)(5660300002)(36756003)(4326008)(64756008)(110136005)(8676002)(122000001)(8936002)(2906002)(38070700005)(66446008)(91956017)(186003)(41300700001)(83380400001)(85182001)(66476007)(316002)(76116006)(66946007)(6486002)(71200400001)(66556008)(82960400001)(38100700002)(478600001)(107886003)(86362001)(4744005)(1076003)(6512007)(15650500001)(26005)(2616005)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?emt4dkV6anJJMVZ5REUxc3A2?= =?eucgb2312_cn?b?M3NhaG5ZWUZ1V1ptVnA1dWNrYURjN1lVMEtlQnhvaFRYM21iRERocGxidE01NDJO?= =?eucgb2312_cn?b?MUNNR3A0amFjSElVR1NhM2N0UXN1b09mVFQ1ZmxTSzlYSEFVeGZYVHhDYkx3UHBq?= =?eucgb2312_cn?b?MCtJNFhOdTFuNnhZR1Y3Q2E1d29ONTJyM0tEYUlQb1J2dC9TMEphdTEzM05OMEZ0?= =?eucgb2312_cn?b?U0dxUTQwZHNJRDFmcmNSOGM2UWhhZjA2Ykd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9yaGU0azJ0VDhRUzVEUkVx?= =?eucgb2312_cn?b?SFJaYWtQMUtpaDc1YkwvUnVVV3Q3eFVsZzFoY1BaOGdPaU83Qytyai9qYmhmb2V2?= =?eucgb2312_cn?b?WUhZbVVaZ2lhN3BkeGVhcm9rN0JUZEpGVksvTS9TMENaOE0rYVhDNEJXcFdScklL?= =?eucgb2312_cn?b?TFNtWXVEcTRwMURST0ZCaXNhT0FtcTFnMm5tS3FMb1YvdGNaMG1uakxsWmw5WGJx?= =?eucgb2312_cn?b?djVKdlg3RkFZYVA2M3YvamhyWGc9PQ==?= MIME-Version: 1.0 X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB9305.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 245f05e1-3b29-4170-fe07-08da5b286117 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2022 06:10:21.1972 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a19f121d-81e1-4858-a9d8-736e267fd4c7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VdNxIZoOYduGw1owAEEtxlr3zK5xycOeNAvnWzzAgAU0O58F3Bb8a32Hvv9838tRpacvRz3s21eJX6TNApM+ow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB6626 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Previously, if user space keeps sending abnormal wqe, queue.prod will keep increasing while queue.index doesn't. Once queue.index==queue.prod 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 9d98237389cf..4ffc4ebd6e28 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -759,6 +759,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);