From patchwork Wed Jul 19 15:56:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 9852803 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 96B03602BD for ; Wed, 19 Jul 2017 16:10:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8907C2869D for ; Wed, 19 Jul 2017 16:10:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D9FB286BA; Wed, 19 Jul 2017 16:10:12 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 CDFF2286AB for ; Wed, 19 Jul 2017 16:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932940AbdGSQIs (ORCPT ); Wed, 19 Jul 2017 12:08:48 -0400 Received: from esa6.dell-outbound.iphmx.com ([68.232.149.229]:51164 "EHLO esa6.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559AbdGSQIo (ORCPT ); Wed, 19 Jul 2017 12:08:44 -0400 X-Greylist: delayed 645 seconds by postgrey-1.27 at vger.kernel.org; Wed, 19 Jul 2017 12:08:44 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1500480524; x=1532016524; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=s+bd/m38bcxMyIxMCgdRTuTif6erAPx4gHd++HOe1nM=; b=vzBig4yavqM6NA9wTkob7OyxVIW8kuiE6C1BwnKqtYpbICUEbPt7uaC1 l8ypseXIK4wZ1hxfFykYkTl15+8Qm6muVrOO8Iy5nluchjw3fIklNX8F9 S4+9vD70OQFQwdq9lMBFaKy1LOjs7iODCb04iX7P2GknvuBc5/9cFO+aD c=; Received: from esa6.dell-outbound2.iphmx.com ([68.232.154.99]) by esa6.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2017 10:57:06 -0500 From: "Boyer, Andrew" Received: from mailuogwdur.emc.com ([128.221.224.79]) by esa6.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2017 21:57:05 +0600 Received: from maildlpprd54.lss.emc.com (maildlpprd54.lss.emc.com [10.106.48.158]) by mailuogwprd54.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id v6JFuxhQ007864 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Jul 2017 11:57:04 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd54.lss.emc.com v6JFuxhQ007864 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=emc.com; s=jan2013; t=1500479825; bh=NqYJ5XjiJ6lVkloA2oDki3gV84s=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-ID:Content-Transfer-Encoding:MIME-Version; b=n2/qkLOZvZZ95ia1Y2XUIY4bq5FLfi0vjRERa3zKhDFTfzhtRLpu3/RQGn8U/gOX6 CLPcM5U3wSikhYUoxRzmQjr6weAJmZZZ8lEtErAWid5nBBdL9bzaZYdqVXKIUj+vL9 3yvOK4JJ05xBmK7K3N9MVjvSZS+pAwgoxIGxy0gM= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd54.lss.emc.com v6JFuxhQ007864 Received: from mailusrhubprd54.lss.emc.com (mailusrhubprd54.lss.emc.com [10.106.48.19]) by maildlpprd54.lss.emc.com (RSA Interceptor); Wed, 19 Jul 2017 11:56:50 -0400 Received: from MXHUB305.corp.emc.com (MXHUB305.corp.emc.com [10.146.3.31]) by mailusrhubprd54.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id v6JFuoh6015083 (version=TLSv1.2 cipher=AES128-SHA256 bits=128 verify=FAIL); Wed, 19 Jul 2017 11:56:50 -0400 Received: from MX303CL01.corp.emc.com ([fe80::31ae:576b:3fb6:c400]) by MXHUB305.corp.emc.com ([10.146.3.31]) with mapi id 14.03.0352.000; Wed, 19 Jul 2017 11:56:49 -0400 To: Bart Van Assche , "linux-rdma@vger.kernel.org" , "dledford@redhat.com" , "sagi@grimberg.me" CC: "vijayi@attalasystems.com" Subject: Re: [PATCH resend] rxe: fix broken receive queue draining Thread-Topic: [PATCH resend] rxe: fix broken receive queue draining Thread-Index: AQHS7yaLGb5L4UjZi0KzZIQgjxrGnaJPkr8AgAveMYA= Date: Wed, 19 Jul 2017 15:56:46 +0000 Message-ID: References: <1498555178-12106-1-git-send-email-sagi@grimberg.me> <1499812957.2586.47.camel@wdc.com> In-Reply-To: <1499812957.2586.47.camel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.253.49.33] Content-ID: <6E1FD705AA542D4790CAC9E02A25D12C@mail.corp.emc.com> MIME-Version: 1.0 X-Sentrion-Hostname: mailusrhubprd54.lss.emc.com X-RSA-Classifications: public 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 To make this work, it also needs to handle the case where a pkt is on the req_pkts list but the QP is no longer valid. You could also combine the two checks into one conditional. For that matter, what is the Œnotify¹ argument supposed to do? I would think Œnotify == true¹ would mean advancing the consumer pointer, not the other way around. -Andrew On 7/11/17, 6:42 PM, "linux-rdma-owner@vger.kernel.org on behalf of Bart Van Assche" wrote: >On Tue, 2017-06-27 at 12:19 +0300, Sagi Grimberg wrote: >> From: Vijay Immanuel >> >> If we modified the qp to ERROR state, and >> drained the recieve queue, post_recv must > ^^^^^^^ > receive? >> trigger the responder task to complete >> the drain work request. >> >> Cc: Bart Van Assche >> Signed-off-by: Vijay Immanuel >> Signed-off-by: Sagi Grimberg >> --- >> drivers/infiniband/sw/rxe/rxe_resp.c | 3 +++ >> drivers/infiniband/sw/rxe/rxe_verbs.c | 3 +++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c >>b/drivers/infiniband/sw/rxe/rxe_resp.c >> index 23039768f541..f66b48c114ac 100644 >> --- a/drivers/infiniband/sw/rxe/rxe_resp.c >> +++ b/drivers/infiniband/sw/rxe/rxe_resp.c >> @@ -1217,6 +1217,9 @@ void rxe_drain_req_pkts(struct rxe_qp *qp, bool >>notify) >> kfree_skb(skb); >> } >> >> + if (notify) >> + return; >> + >> while (!qp->srq && qp->rq.queue && queue_head(qp->rq.queue)) >> advance_consumer(qp->rq.queue); > >Since an "if (...) return" statement is added, please consider moving the >qp->srq test out of the while-loop and into the if-expression. Anyway: > >Reviewed-by: Bart Van Assche -- >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 --- 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_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -594,8 +594,10 @@ int rxe_requester(void *arg) rxe_add_ref(qp); next_wqe: - if (unlikely(!qp->valid)) + if (unlikely(!qp->valid)) { + rxe_drain_req_pkts(qp, true); goto exit; + } if (unlikely(qp->req.state == QP_STATE_ERROR)) { rxe_drain_req_pkts(qp, true);