From patchwork Tue Dec 13 07:03:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9471839 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 184BB60760 for ; Tue, 13 Dec 2016 07:03:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A3F5284C2 for ; Tue, 13 Dec 2016 07:03:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2CFD284DC; Tue, 13 Dec 2016 07:03:22 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 296C8284C2 for ; Tue, 13 Dec 2016 07:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752359AbcLMHDU (ORCPT ); Tue, 13 Dec 2016 02:03:20 -0500 Received: from mail-by2nam01on0066.outbound.protection.outlook.com ([104.47.34.66]:43264 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751985AbcLMHDT (ORCPT ); Tue, 13 Dec 2016 02:03:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=w/vvYVHgelsbkumUKdW0v06PHEtdxQwcH0L5ElJbCx8=; b=kOnMgBirx5wtb8hl7mywlizNPDkLGeqtwzM/ubFjXePMJJelpIjAAyKC4FySH0psztIlZP/5/r4gsWc1yevHh/caWTE8mHFfxH3WUrNvBLfmlA7/QYF/2SViWhGY8myKbPZ4MbV1oLf78MPofqRbb74SuXvn+DerxEpMP9nP73E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@sandisk.com; Received: from exp-402881.sandisk.com (178.117.55.239) by BY2PR02MB1686.namprd02.prod.outlook.com (10.163.27.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Tue, 13 Dec 2016 07:03:15 +0000 Subject: Re: [PATCH rdma-rc 2/5] IB/rxe: Fix handling of erroneous WR To: Leon Romanovsky , References: <1479285558-19627-1-git-send-email-leon@kernel.org> <1479285558-19627-3-git-send-email-leon@kernel.org> CC: , Yonatan Cohen From: Bart Van Assche Message-ID: <5bd83de1-64d3-e5a9-1c58-cca52d89d64a@sandisk.com> Date: Tue, 13 Dec 2016 08:03:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1479285558-19627-3-git-send-email-leon@kernel.org> X-Originating-IP: [178.117.55.239] X-ClientProxiedBy: DB5PR0201CA0013.eurprd02.prod.outlook.com (10.164.231.151) To BY2PR02MB1686.namprd02.prod.outlook.com (10.163.27.24) X-MS-Office365-Filtering-Correlation-Id: dfe743ca-005a-4925-dcbf-08d423261cb7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR02MB1686; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1686; 3:isT4yeweosB35loEC+S97GSDHR0iREzcM6UGrWJ+ZXN9QEtrkpo5YX353g/wvIVOcEnpyVPS1MO2gi9AoTBgpWxyy/SnyMBWfvSetpABbT563FLeTY/vSx2H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1T9VbZNUumNOva1J0ZjWbPIUzvYplzPNF1w3eucyLTLPODcqetfT2DIBkApScP5U5nWTsvOOTy5SUTBnlRlPIeyxRylnyImgh/xDnniNpOGcUEUHpCDMoOcXVlcxVvHM07os9ush07czOdySVzFEiMxc1kkj56IXQW87rTZjW9r4JcS7XM79f8ieGO0reBZ+ZbYzywyL4fXVf4ug64jW+aB/nceFl5B8bu6SnQ4T88NXCRk/OOBpLCudw==; 20:UOrcByKywn4KXSox0+r6T9O3Hr+plYJwG7U7FfEIc0861dtCQFKldF13LdpKO9GmrY/puLOsUPKMNh7ibVkLfUGsauJIFvUpawmoeIlQ8NwsRXixC3fhfhcPD56TkMJWHyPEo09gtQftN1RwjxcHl6wSlgrP2PBHswcW5IhPryA4JgOzvNLOCPk35+xeuGPff7LSp3ajb3SBPS9qxRe2YCMHnwopRvvOM2w3r0dlJlNGZsvW8fDxYl3Sd/UsSlh5B94a2+eSAOGCkPxGpY90DH2HdR/KSdvwwtEsJeOrdKUl+BiDWdRxWqPFYgxdREEugv3zwfa9sdxjJgWxo6RID9Ol8O/gDsNfx1V7ZtbG/FIHgiymjiKIGqm8S4CNDnAUaHWBBMnJuh5RPgrKLMbQqKhvIsnLhpP1JuB1QAweTgC+XpGk9efJpYP08Bi113t7UUeZCGxj9EZnTj3hkKt2miymMLrIMDAf1whU3magJiN3/TVHYj4/UvcBG+scL9vD X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:BY2PR02MB1686; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB1686; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1686; 4:nHCm9zx9utFYC1lZVOwRQIR9xmZwOAtH09M6qmfNgMjimHf47KluNowICyHslIobG2xxDDJKt/BVGY3bDDu/cdVQInnc+kY9BD+PVc3Rgbk2/Jd9YMYzMbi5H3ZkukxW0rjZhurehrESalE9uVUayOjIkNjCF5kn9C/ToVj9hsjnABhllyYVgFy0oRDo5e48zJJlVhKoLC10ZnFvUszddJWyVbfcjxdVEybzV6lUNKLal++1Nr0NS7yJdpwQXkoiIuMPsjYuDnzorV0H9by4Vq+BSSgtBxUHDLC1SioBHJCQnSYjkzzE+Z4bofuZMJRmiqBQsqQDx9MTxlC3y65cShySyMSW3d5UsJiHtuGklymXhZGMDXmxHpE3xC8gnhD0UernVEEv/3GCYnzbjMiHQQqIEqObGkbtnvAW5rdJFzTk3RafvNqgitXRNnHEJ/0J8WgeIdL+czjStArQVoKRPr89C+8aw7wnHz8mKdgy6cnB8DcsajX9DpilD1rxyboIzNSrSXSiqRiy7dNDZRyv/JAECHetczAgSCnV9NFbO87fJAHJXxF/UmOhelnwCbySvLbpGYr0AD4SGav0sy/2Q3gJsupagac1KfGYh6FpnCBz3QIuxm81Q4XS5C4d4laHprOaYEI4z3ZI0v/rKHwH+Q== X-Forefront-PRVS: 01559F388D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39860400002)(39850400002)(39410400002)(39840400002)(189002)(199003)(24454002)(377454003)(33646002)(189998001)(97736004)(42186005)(53416004)(6486002)(106356001)(31686004)(230700001)(66066001)(229853002)(23746002)(105586002)(83506001)(2950100002)(5660300001)(65806001)(47776003)(65956001)(36756003)(6116002)(38730400001)(6666003)(3846002)(92566002)(8676002)(50466002)(7736002)(31696002)(50986999)(76176999)(54356999)(305945005)(65826007)(81166006)(81156014)(101416001)(68736007)(4326007)(86362001)(2906002)(4001350100001)(64126003)(69596002)(5001770100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1686; H:exp-402881.sandisk.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: sandisk.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR02MB1686; 23:irmrUTDUJoxc8poQmI/lUPodZZkQDaYfp+LF3?= =?Windows-1252?Q?Ojse19i/FpIRsL1ZVY0dTwQkbX94+dRby9Typ4VvjOCwiG7FZSd5MpQ8?= =?Windows-1252?Q?Y2jyscT+4UanbWKbshrWlJtKbIbdLhWw2BeOoCS7IlQgXqM2HNfsE5xU?= =?Windows-1252?Q?C/6falaDJ0xq/diNIf5ZFUCO2mV75FdHAZkhjyKPGue1nzX5MN7l1DQ5?= =?Windows-1252?Q?/xEG3+x1Yh9dMBJ5CgwI2Cyy2a4W+Q5E/deza9D0GyZhIfP+GRX9MVVW?= =?Windows-1252?Q?dFl3rRLmz6SFrMya8tgzRbE+HpLsMoVmC4yLfSdXSGyGlloVV+qBr+i8?= =?Windows-1252?Q?eoPGOYT8EjX3wyPs4dIdj2TaG1nJ+aDEYU8a2AbLTHe7aTqIrW5CwMZj?= =?Windows-1252?Q?FMMMyVUPHvMDhsT4DzLN8t7ba4QTQZHTKlkMj1bysnUZlK0LmU6k9inu?= =?Windows-1252?Q?2h03ffM8nkXG4JZ00OZ/b4MPsLr/GCRx+LeavxTMh94s2MsThQjk4zxG?= =?Windows-1252?Q?UEelT/IbmQwCxQDF5V2CTf8C9wKdl2dudE1J4KBuZOthgUXZUmqdzeXR?= =?Windows-1252?Q?S8pgMrAsvDNv9P1pHL9Y1Gqp5krISxUNn5e9HJKQBBb0VOL+JTS1UVT/?= =?Windows-1252?Q?aTMuE9jw15P2BwgvBXVINyMmw78fHtTyjfSK98xCsWTInvck9AAeGpaT?= =?Windows-1252?Q?dh9sYzqRQ9WCBnVNEhh2qJd+EESOxKXQcI1CRTJXT6J6VY3UwFrD3cnO?= =?Windows-1252?Q?RbMYHVr1jVH4IkIR4NezBSvF4EIJpFigso8ozr6vDQi6C2Oxd4+ue+A3?= =?Windows-1252?Q?Ov9yH+yuZJxoakktIzKij/2sI39Il5ycXHGEleBSipBc3qHSdBeH2pIJ?= =?Windows-1252?Q?d9Kfa/YLk1KNlbIR0ZuJGEIzTvWwXQtwzy7UuBhaOrIM0v7z0vrj3mvW?= =?Windows-1252?Q?Pc90e15QL+L1bwUL1/gaC3KKmgXTUX5z99IvwEYegMiYxUfRX54cOsHG?= =?Windows-1252?Q?in3EAosEQc6ZyZjLOWureiMyRZ5g5kaJmNJMN5WXjoWKjLIDjelHwuMf?= =?Windows-1252?Q?vI2yP2Ko+8gBMf33qCw7mqGrEiM1xpa5E02DS1WMu093sJ/em9cZIt/S?= =?Windows-1252?Q?AXPoHLvv8xreEh6clCHfeP9FepF5ZFISBOtm3idVA+F0c+wrmOSER0q5?= =?Windows-1252?Q?ASxRRMXTPrXjv9GDdbCTT41MphMhZoQT6Wh4MCjZJZDRCBVmIGSe/1Gs?= =?Windows-1252?Q?6LR6UeXcdq/D79c1yovBcAE/OtwMSUtY85+6EECKJAmuCRw4QKVV/JMq?= =?Windows-1252?Q?DE+DTiMgLUbsATRw+pbvfhOeWVT1F9NlQD0AeBuOQe7Y5mBF8v2HZKXj?= =?Windows-1252?Q?S5qQRuv3FhrSc0W2SbM9RKyE2Tg3XAFBolYZBP7YyVuiLdM2+sL0KRwC?= =?Windows-1252?Q?uYuEBTmPWfYVS9ciiNAze0lzW2JzALhx58rznopN9hLGvXhHN2AIgJCG?= =?Windows-1252?Q?w/VH8ZkLob9E68P0fBObOvFFOZG?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1686; 6:9wTVrT/+I63KYocfxceiZjWj2AGjcibpmoT3jCw0eXsPurlCQg6N6R0V/MTB5am6fd1WnI6VTHC00zc1KQf8c5nvaHCgm1a22ELahTdCsxrofGNuFAMLtC9sI4EDIQZA3CMx7fvC22Yn62Qhk8pdq1KCQE5y8mYTzuuy8neTQyW+AJiXq23reUyQxD8zl96xukMvSJgCjIDwtiYnp9/AbqyUGRWct5zQOMzr7u/sAPQ5pwYSZX7d3tpEvm2XVznXWOkmF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2tHjsivt1OpVuuPYE4aCWv8D3VqXVjaWSSmZldnVyMkpKP8kURqpJsCVir2rbOhkmV9s0dSq7wMhpNpCDnAcSbrTYFNGixQbqe5tsrDq2yEKodxRMAJFzlmEpSGg1Uf80lO+yBwZU75Ev3Mwz0rY1qL7Ga8uPSFs/ebtnym+owDwFbR6xONbxMLbIgRDXMRVyX6/vW8eFIDzB3bEn X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2016 07:03:15.2494 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1686 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 On 11/16/2016 09:39 AM, Leon Romanovsky wrote: > @@ -745,13 +746,17 @@ int rxe_requester(void *arg) > wqe->status = IB_WC_LOC_PROT_ERR; > wqe->state = wqe_state_error; > > -complete: > - if (qp_type(qp) != IB_QPT_RC) { > - while (rxe_completer(qp) == 0) > - ; > - } > - > - return 0; > + /* > + * IBA Spec. Section 10.7.3.1 SIGNALED COMPLETIONS > + * ---------8<---------8<------------- > + * ...Note that if a completion error occurs, a Work Completion > + * will always be generated, even if the signaling > + * indicator requests an Unsignaled Completion. > + * ---------8<---------8<------------- > + */ > + wqe->wr.send_flags |= IB_SEND_SIGNALED; > + __rxe_do_task(&qp->comp.task); > + return -EAGAIN; Hello Leon and Yonatan, Sorry for the late reply but I think setting IB_SEND_SIGNALED for WQE's reporting a completion error is wrong. I noticed this because this change conflicts with Doug's rxe branch on github. Have you considered to apply the following (untested) patch instead of setting the IB_SEND_SIGNALED flag? rxe_cq_post(qp->scq, &cqe, 0); Bart. --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -418,7 +418,7 @@ static void do_complete(struct rxe_qp *qp, struct rxe_send_w qe *wqe) if ((qp->sq_sig_type == IB_SIGNAL_ALL_WR) || (wqe->wr.send_flags & IB_SEND_SIGNALED) || - (qp->req.state == QP_STATE_ERROR)) { + wqe->status != IB_WC_SUCCESS) { make_send_cqe(qp, wqe, &cqe); advance_consumer(qp->sq.queue);