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); 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: 12902740 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 18F4FC433EF for ; Fri, 1 Jul 2022 06:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233761AbiGAGKc (ORCPT ); Fri, 1 Jul 2022 02:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232866AbiGAGKb (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 6B7B720195 for ; Thu, 30 Jun 2022 23:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1656655829; x=1688191829; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xb8bcB3dacwTDC1wfXR/L8AIWhBWMTpzHSfnleSvvJw=; b=yiobyBrVHA9eYzTbV2e/ZEl/m6j5+fjqwm22ImxvSqlCddDKIx1AnMxA 9cu8N6p1kWD4Smx1uCpI8j6l92LWu7xXLRqbY+z0sPjlffn9/HxlW3axM DtheXhxj4tyFz2N2HsfDj8Rsy8y5itTlzhq6ZtZtyToRRajQYZCgigdxa UPGqNaqLrx0BaSP1ckqPQaNjD6+lEWrYkIK0B+xDkPM8XTAbUXRsxJKA2 xWep58DGgSW5Xr07wKqx8HwPMWe9HsfBvt4INTxKyQTrIyhTQA+AwCNEL Vf78NDBWinZuwRdRkAxrIkhQSSEJNd7vuHJP+Wsf58j1V8U11cAscsqib g==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="59519669" X-IronPort-AV: E=Sophos;i="5.92,236,1650898800"; d="scan'208";a="59519669" 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:27 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jXhz2RlHnR9s5fdGi66i7DY3ffdVs9vvOHBmDsufjWCztF1Hu27jYv+bvCFiZ9zS9FqrPTL9k0rJReqm7AA5PZeeDIrE8eGuT0Ps9HiTBDESwGeVjabDejvetDKIA1lbthfvAhRi18rZuk/tg2c7u3anb3WqnkU3qWXHlXcWx3woJOtNWn/4HQ4tsHKrGssdHhCG6Wvq1jiq1hYV82hQQ+yOh2nYC/YVk6unlWWljGUvkIAzKVR+Lfpip4Xh6eH/UqRCljP+HnBXdodcOJawoVzZg4TQLdsoLQ5ICg/ahWf/5Toy1qTle5qa+lNTDYjUGA2P+5qlXpKt8TM4D35/nw== 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=xb8bcB3dacwTDC1wfXR/L8AIWhBWMTpzHSfnleSvvJw=; b=U1lKBnvaWJ8BDxGZSaj5X85CXn7uWB5ct3tILWehl9G+CMQqsvLU73c9qH/2ab05cD3C0tiLCtntiQexqTj5Oc6qIjx41OQ/Wbjjl7o+p4avQ8K6L/3CCwoRt5ZjviHMjlEFnWThgg/U+d4irLxZpPLCSdcVfcvL0N8dMPwqqfIPAof2SlekNaKSAKoQQOUam71433UAEj+rdFZPz38b4qDtLEvWNtyP0sI6p5+vteClXE4l2q6CX9XnxZ70gVJbiPdMDMniK9HdWczKUnrSgMWDxg4D4Tn3Kb6KMNUbIUah2BWryhz+qEp5YxPZNweQtgYoIKNd1O7pfBXewhdR1Q== 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=xb8bcB3dacwTDC1wfXR/L8AIWhBWMTpzHSfnleSvvJw=; b=SnCmwU8SDGkTNzS2lQ28F3oMMTovbzu2Dk2FrbnyCwo60Ycul9/TX3h/HyWhEFesf8tlgyFQy3OZPoAOcq/e/dAuRtWGOSkDtdOKqXGlBdvfbKDS+oQCjCq6GnQiYyUW7a0vZVdpN/easoKHlaa2WEI6w98WI3sI8OzA4caSzq8= 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 2/3] RDMA/rxe: Generate error completion for error requester QP state Thread-Topic: [PATCH v4 2/3] RDMA/rxe: Generate error completion for error requester QP state Thread-Index: AQHYjRE+iGnVIQD7sEOrlc16O1v8ew== Date: Fri, 1 Jul 2022 06:10:21 +0000 Message-ID: <20220701061731.1582399-3-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: 3906e467-f71c-42b6-45b8-08da5b286164 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: fNxATdEPkOKgpztkf0EcBkBmM/pr9Rd2G/htupaRuZzahyX9LJ5h/xGmM5MF250If/yNcbegq5Zo/kLeWKc/lhhZRdDceaJ5jb3CYOf56A3PdbYK7Bf39y3LRxfxJNpHaRXQXqDOSdvtmq3CW4U7GCv9T93PTvrLnX5kKQkjVUye9s4GilBYsK+bhW2cpmnw/fB1IRSVelhzNbZO3nkXj4oloQiYpWrra9rEmSj36+lCd3+OSm7cmrsaA/eHTBDVOrgAXE9pEZkQhLQXlMaTZZVXVLm/6hdfWWirctBUHKykyAhxrXpDP/mp45GQPSjq3Ej8noZ5T4rfxDi4DPjnuygTd+o4wvhXbOn930lB1jiPPG9hU27NB/SzxADjiuZ2nL7kID9zwIvt3Crrke7MAqNhvQIVGJioQOAoiW/gN8qPzO+WzMiUaPCipXLArkb8exrK5VnhTPhygE9VjjQNGt+dh+/Az7fVyLZLIop8Lm5HdTBimon9iMhzxoqWqh/aPRQPKGy4WoY64VWKxadumroEMJ+KlbLTwbRRtSDr38rzGWjLTTWHpRwvdYq1BiSKRHIU1Kuzo+YKGH/UhpHifjrUK3fdfcv152tI1cxPJWdXw+bRWCGldmO06EYPdZChQgKPdTCdrcbRO37NK4U2WOUMbx/P9uA9pf9u0gnoAjGDgZ1X7U1B5sJlpPnm/XyOSMYV+fpZtzldjdgwRdgEgN9BFGupDT3SFRyE9S3GRnqLuFZoWgtxYJPgsI05eQyl3PNUzQ4fe2kLpblIQqGfgZ+yZ6zl1F4/Cwb4lW9VhTRten7Krj7ptk8oB6uK7oB1 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)(1076003)(6512007)(26005)(2616005)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?WGJnVmVpNHhQT3JCTWc2Ly9t?= =?eucgb2312_cn?b?ZlFwZmVoZm9Hd0dwK05vNHR5YTcreXl1cGZSZTRyNFlCd0dLN1NENUVhaTZiVzZ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?= =?eucgb2312_cn?b?bEpIZzNyZzRjTEhiSm5uc2hqMEJNZWhJTjVmMklBV3V2aXVLVEVHZ0FmWHoyYXRm?= =?eucgb2312_cn?b?VDlZWHZNMktFZGs0dHlWTjNHUXJjSzNDanlCdEVVVXlic1o2NW9EMGQ2cUJ1NFdU?= =?eucgb2312_cn?b?cyswbzB6aWtRSmdzN1Yzbm5qMnNJeHh5dS96M0VPLzd1L1RtaEhocmhycC9HT1NV?= =?eucgb2312_cn?b?N0hGNFJNL1FsZ3hIMFdPSGt2clVkRHV4Y3lGa21GY1NWOVlIS3FqTWRRMU4yOW91?= =?eucgb2312_cn?b?NGtBMWxtcHpUWm9tcXNpaHFhWndoeFgveGNwQ1B4ZGszdFRmdm1TRHpZQnZUQnJr?= =?eucgb2312_cn?b?eDExaDVBYUt3NUJFdWFNOEFUMlphY2FXYUNSV3JsMFNmaFp1V2h3OUdyRklCMXI1?= =?eucgb2312_cn?b?emk1KzNGd3dqc0Q1NU1ISDRmL3c9PQ==?= 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: 3906e467-f71c-42b6-45b8-08da5b286164 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2022 06:10:21.6658 (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: 7tq/8+MGoaRY/u7uG+rT4dACntnxoc+vwOs6aO2owpnQ7M6jFSdUxf9Tu3D2iVRpieAAUhawwd5L+lGVPtj0sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB6626 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org As per IBTA specification, all subsequent WQEs while QP is in error state should be completed with a flush error. Here we check QP_STATE_ERROR after req_next_wqe() so that rxe_completer() has chance to be called where it will set CQ state to FLUSH ERROR and the completion can associate with its WQE. Signed-off-by: Li Zhijian --- V4: check QP ERROR before QP RESET # Bob V3: unlikely() optimization # Cheng Xu update commit log # Haakon Bugge --- drivers/infiniband/sw/rxe/rxe_req.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 4ffc4ebd6e28..7fdc8e6bf738 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -610,9 +610,22 @@ int rxe_requester(void *arg) return -EAGAIN; next_wqe: - if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR)) + if (unlikely(!qp->valid)) goto exit; + if (unlikely(qp->req.state == QP_STATE_ERROR)) { + wqe = req_next_wqe(qp); + if (wqe) + /* + * Generate an error completion so that user space + * is able to poll this completion. + */ + goto err; + else { + goto exit; + } + } + if (unlikely(qp->req.state == QP_STATE_RESET)) { qp->req.wqe_index = queue_get_consumer(q, QUEUE_TYPE_FROM_CLIENT); From patchwork Fri Jul 1 06:10:22 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: 12902742 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 EC1E0C43334 for ; Fri, 1 Jul 2022 06:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234600AbiGAGKi (ORCPT ); Fri, 1 Jul 2022 02:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234614AbiGAGKe (ORCPT ); Fri, 1 Jul 2022 02:10:34 -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 85E2113DED for ; Thu, 30 Jun 2022 23:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1656655832; x=1688191832; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=QvdLTCjo5zlbS2jZ7uRlObpl8qbBKPB+I5xiTw592tw=; b=yZthBsqiF+cgP+uuJCCi2S+JUuHQmer7YARjNiv/QxfgeSNys0CwZdMo M3z+PWtT+FI86otpznlhVo18dFTyK1/Br/crIq4LRiKa7icDkvuesxeZ2 VmWyOrByWPbVCELrFIpmd7CXhuqm7jq71VSE/CcOum9ntW81XLZjXEcIg zxdRa4WGKYPjOhw7hY3iXAqYsWKvMlec4WS1xe9ktdgxHVlYkXaNtszho m9wfO6h4fKvXvDh66gIKkT5tNNxvKvj/dDvUlVIj7SEDtpW/glAphnnNw Dqn3oHVGHJF3Z2e+mibM1rEv03tCyNf7A3xZIEPNBs4xhGI1DBCbkuKp5 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="59519676" X-IronPort-AV: E=Sophos;i="5.92,236,1650898800"; d="scan'208";a="59519676" 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:29 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHRcNd1YOwJNBC0a3c+FdRftFivwdYOlRkA99fajCp2pLLfbktX0j7lLEd5gxXxgHRq1l2sdlT6e9hkZobAiIIIqF/ivLMAjwe2kEK/OTIo1jYDbc36ye1dW+FCPTLlR2VXxXfyiOYamzPGoSXo4GXTXnbwESY66PseEjYv2c2KxbAZeTCtzigOOlmeJFBE9Oum0Ndpg8j87P7HbFKmJknDETr9wxgDCai7U8f4Z/CZVn9QZP/IoDzMbcAJni8FbAJ3RsrC6igxcPRj7JF8kpeZ8KZf49mO+bYH2au/XBlBVvxIygwtAyA+/oVuhBGl91x7sPiUzrUYXppaJXknlSQ== 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=QvdLTCjo5zlbS2jZ7uRlObpl8qbBKPB+I5xiTw592tw=; b=mIpn3dZrFpysoLiTf12w0fTXRPfsectEDUqS4M23We/4REJWoRO5mOUDylQ5HFrNz/zXcYi1beQkBqVIPLt0G07t9o5oEcq4wUBfBfuelwFxOoGNyVymtvpv9Yql7E9vxU1iGD1ZMwmwHsoVb0XfkKx7qknRx5YtAH5hDwqR4F4ZdupWVS12UVq7thP3jhVs3fLf88YGnjpuFVGywzSNHRIWnP6ycy68nxfbE/Hou1jAs5VIux6L6Jvk3bLn2YKsRrOk7VScsSZIknIFkVOsVkyI+KoXsHLFy/68g1sKjTj93lSyAFHVmX1aIU2kzCY27L4fgzxHexX2RZQqAq1vNA== 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=QvdLTCjo5zlbS2jZ7uRlObpl8qbBKPB+I5xiTw592tw=; b=eDmUflcKXTMUv64v9WHliZbUVY5J0/aRQz1s9g+32gWGcWX2uH0Qbe3zJzdSaqtGZ07AI7mpyyqCo2LtJE2nBRAGWaPBgJiEAXacwxv7VPOBLQIhZPOsJxX9N0DfgIdgZToErf8g7m+cSgal7N1t6oDprKCPQabZT+fd8/42oTA= 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:22 +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:22 +0000 From: "lizhijian@fujitsu.com" To: Yanjun Zhu , Jason Gunthorpe , Haakon Bugge , "linux-rdma@vger.kernel.org" , Bob Pearson Subject: [PATCH v4 3/3] RDMA/rxe: Split qp state for requester and completer Thread-Topic: [PATCH v4 3/3] RDMA/rxe: Split qp state for requester and completer Thread-Index: AQHYjRE/TP5Oo7sEp0ak3lQusoVWIA== Date: Fri, 1 Jul 2022 06:10:22 +0000 Message-ID: <20220701061731.1582399-4-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: f3628d7f-6831-41ff-23c2-08da5b2861b3 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: EW8wvLW+2U2CCVKAeJ2nKGKvUnbK39zWKcOxYGRaVuQzkntCO/+cPNvXTEaNwvpnlwaYpsuAylHKBAZvS+HAx6Ootx1ztj8IpWWiosTxrEyj26ebHgPhnRKlBQB+xeNS9REB6SIq3omsR5tcCcNHSwwoJwpF+pIWwvPjlcEqzTDDYbsDw9+km/bRcMRXlRHWbyWngn8KKg+afpSFWnQaUVwxG5hmKk5a7WkitaGURw8lHaPPjkHKfrFg6rzDsmvdOX5Ge1rscN4zHYE/Wgj3xwmQQY8Ni0Hx0RtFPOOBUMn2E2vvXiG3nD8zfLdx2oujNvtJj5+wjFvRtlxFA0O9GpfUHDd9itYxPxxNuF0/s4v49vPs8InuplOvDWNS3ODuRezXx3oxlkWi1tiZIx93bgfgxEm90e14uVVCDpMIbd+dMUkfrkxT/FVmWQE3qLijcxQIKpcGyb5KUUoMKnZl/6Tl0pAoKc6XX8v8XeGVD0pQ1fpOJN5AmiEag7LE8F3ph7fvFHGk+GOofaGb7GpZ6b9KKN6JOCyYrs0Cmu8XsqOrRBQGX3fH+HIskMZqgHc8Kywk+cVrZMHHDmM7BGIAgpREo7sYJGqP+EJZ9O/voX8d2YwnKs5SCF3SeJKfymHVQRPb4stS9ykg6/FKR+4zBf39q2+ZzdbpWPAgJr0SYG+2oBREJ8rvaXsTenWh5IK5WeC8FkRPT5muEAyiQ3oYctfRoyEAKGLPVNj80S3FZ0WGjEBkI80U5FO96FS+K1TCUqofr0/D4Eec96Y7a1ObW+OokTLYPrpQVxlUhPTVylG+2RBfOIuv9CfrtEIxOfD0 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)(64756008)(110136005)(8676002)(122000001)(8936002)(2906002)(38070700005)(66446008)(91956017)(186003)(41300700001)(83380400001)(85182001)(66476007)(316002)(76116006)(66946007)(6486002)(71200400001)(66556008)(82960400001)(38100700002)(478600001)(86362001)(1076003)(6512007)(26005)(2616005)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?M0pBNTkzL0RJNU1CMHlXTlov?= =?eucgb2312_cn?b?VFZ0WlhKYkRBd2UyN0E3RU5tS0FzVWNsVHFIWC9GQU1MaTlVWUh0bFMyS2ZKMVVz?= =?eucgb2312_cn?b?RmQwSUJOLzBXY2NkZUUvMUVBY2JCdDFtRHFVQkkvT3dQbXdpUXdpbDRmNmtCbjlX?= =?eucgb2312_cn?b?ckJvTHJsc2NHR0lyWG90TFhkRHpNTWFnUm5DcGtqMFlTOWRrcllCZGE4MlhTWHRz?= =?eucgb2312_cn?b?Uml5a2dFNXpkc3VMNjVYbUQrMmxMNFAxd0Zyb2pJTDVrb3hZQ0xJOGVlRzFFdkZR?= =?eucgb2312_cn?b?RHdkUVBWQlZiOUlKQ2Z0MUJoeUMvSlp2YXpDcXBkNHFMZ0hGNHZETmFRTGVWMkpX?= =?eucgb2312_cn?b?cFZyem1UL2lZUHZSaUJYZUFFZ1N1OFNreGk2cmZrbFVlc0plQVkxbFVMWEtNZktt?= =?eucgb2312_cn?b?OUk3VDJJUHlzcUVYcnpmOWFzVUVZQjBOSThjcFlzMkNQb1VQa2syZnhlMU0wQUI5?= =?eucgb2312_cn?b?aUJualpSQmtKNzEwMW8wUjhyTk96L0ZxOGt1aU92Vkxub0tMejFDQlc3WU9HRkdR?= =?eucgb2312_cn?b?cDZUeVlaYTlPM1IyanMrV2JpTXVNdWwwd0wwT0E1Ri9QTTVVVWRZbjJYd3JzS0E4?= =?eucgb2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JDNmtGMGV6RlYxeEZMTGdLeUdPNE94SGZ0dDNpUXYwYVppQXdL?= =?eucgb2312_cn?b?RHJvUWdGQnhXcG0reHlWaHZWOXdHeEttMnV5TnVSUkJ4ZHR5L2ZKdXR6QnE2eDFI?= =?eucgb2312_cn?b?WEx0WDk4bENqWG5jbTNGbGVFUC9rZEJVeFVMTXFvRU1ScHhCdHZvK1JLVktZTk9B?= =?eucgb2312_cn?b?WmIxTmxiUlpjODhXKzY5UWFwZDVaWFZ5MExpZ3BSNFBjYkczanBQRVA5M1BRWGlG?= =?eucgb2312_cn?b?MmZtT1NjQWZubkpNTE1WOWlZUWd3WjhobEM3NnBDRDNCODRURXVKWmlJdnNvZ2pl?= =?eucgb2312_cn?b?Z2xQbWYxS0VoNkdpMWtWZCtSb1NOL291ak4xdXl5YVZoa1hsQm5OWStFMmdpcGZQ?= =?eucgb2312_cn?b?ZnZmN1JraitJT0ZMSVo1UGIrbXQyczNYalB3RnRYaGhWVktBR1d6enpQYVQxTzFu?= =?eucgb2312_cn?b?MGpoY0Zobkl3VVpNM052Mi9NRzM2VDdVUGlRWXRZL2kvcE5OaDFoeVNxajVrKzhE?= =?eucgb2312_cn?b?cnJlelB2RCt1Zzl2Z2g5cEt6V1NwUWhDdkNxaUdMNWNDRkJVVDVnR1VGbnpyUWxY?= =?eucgb2312_cn?b?SVphWUVTSGIyUm5CZUJtcExzakRxWml2OWozYzVET0pyREJVUE5WVXdQR3M1NWZN?= =?eucgb2312_cn?b?NmM3QS9Ea1cyN0pZVWhuUnk5L0VoL1NQVXZZSGROdWNSZUhMZmdBR0NiT05TOGFU?= =?eucgb2312_cn?b?R0gvWXZoWUZqMXgzY2Z4RURhV3c9PQ==?= 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: f3628d7f-6831-41ff-23c2-08da5b2861b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2022 06:10:22.1514 (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: 02BLG0nQ5JRCqmHy/RCVnTQnLA2Yx7FV+xg7jviXAs2NCgGpXESbLmSh+ytO8iHKl1JbdnjisAcqAGMH1Fe61g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB6626 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Bob Pearson Currently the requester can continue to process send wqes after an local qp operation error is detected because the setting of the qp state to the error state is deferred until later. This patch splits the qp state for the completer and requester into two separate states and sets qp->req.state = QP_STATE_ERROR as soon as the error is detected before another wqe can be executed. Signed-off-by: Bob Pearson --- V4: new patch --- drivers/infiniband/sw/rxe/rxe_comp.c | 6 +++--- drivers/infiniband/sw/rxe/rxe_qp.c | 5 +++++ drivers/infiniband/sw/rxe/rxe_req.c | 1 + drivers/infiniband/sw/rxe/rxe_verbs.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index da3a398053b8..0b68630a3e49 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -565,10 +565,10 @@ int rxe_completer(void *arg) if (!rxe_get(qp)) return -EAGAIN; - if (!qp->valid || qp->req.state == QP_STATE_ERROR || - qp->req.state == QP_STATE_RESET) { + if (!qp->valid || qp->comp.state == QP_STATE_ERROR || + qp->comp.state == QP_STATE_RESET) { rxe_drain_resp_pkts(qp, qp->valid && - qp->req.state == QP_STATE_ERROR); + qp->comp.state == QP_STATE_ERROR); ret = -EAGAIN; goto done; } diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index 22e9b85344c3..a95d3b49ae20 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -230,6 +230,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, QUEUE_TYPE_FROM_CLIENT); qp->req.state = QP_STATE_RESET; + qp->comp.state = QP_STATE_RESET; qp->req.opcode = -1; qp->comp.opcode = -1; @@ -490,6 +491,7 @@ static void rxe_qp_reset(struct rxe_qp *qp) /* move qp to the reset state */ qp->req.state = QP_STATE_RESET; + qp->comp.state = QP_STATE_RESET; qp->resp.state = QP_STATE_RESET; /* let state machines reset themselves drain work and packet queues @@ -552,6 +554,7 @@ void rxe_qp_error(struct rxe_qp *qp) { qp->req.state = QP_STATE_ERROR; qp->resp.state = QP_STATE_ERROR; + qp->comp.state = QP_STATE_ERROR; qp->attr.qp_state = IB_QPS_ERR; /* drain work and packet queues */ @@ -689,6 +692,7 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask, pr_debug("qp#%d state -> INIT\n", qp_num(qp)); qp->req.state = QP_STATE_INIT; qp->resp.state = QP_STATE_INIT; + qp->comp.state = QP_STATE_INIT; break; case IB_QPS_RTR: @@ -699,6 +703,7 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask, case IB_QPS_RTS: pr_debug("qp#%d state -> RTS\n", qp_num(qp)); qp->req.state = QP_STATE_READY; + qp->comp.state = QP_STATE_READY; break; case IB_QPS_SQD: diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 7fdc8e6bf738..492332533892 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -775,6 +775,7 @@ int rxe_requester(void *arg) /* 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; + qp->req.state = QP_STATE_ERROR; __rxe_do_task(&qp->comp.task); exit: diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h index ac464e68c923..bbfffe243fd6 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.h +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h @@ -129,6 +129,7 @@ struct rxe_req_info { }; struct rxe_comp_info { + enum rxe_qp_state state; u32 psn; int opcode; int timeout;