From patchwork Mon Jan 2 10:42:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9493343 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 E3F0660414 for ; Mon, 2 Jan 2017 10:42:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBEF620008 for ; Mon, 2 Jan 2017 10:42:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DED9C26212; Mon, 2 Jan 2017 10:42:42 +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 1847B20008 for ; Mon, 2 Jan 2017 10:42:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932474AbdABKml (ORCPT ); Mon, 2 Jan 2017 05:42:41 -0500 Received: from mail-bn3nam01on0044.outbound.protection.outlook.com ([104.47.33.44]:21891 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932283AbdABKmj (ORCPT ); Mon, 2 Jan 2017 05:42:39 -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=DFCmzM7dRqnM8cDxT1YVvkmUH8Gqu3T06XghwqM06iI=; b=CihmOMv4ZCtDNgdaBvJ4FuL9vzxwhHLxHmT5ztkP6/OY6lg61dX1VO+cdKp1SA53xWA1gDPFb7wWc+QLNzjJDJDNmEYTR+HGOEqw+Ty5YIYBSJ6EgC29nm3dm3c5xkaP8Jrb1JkubJj9yrZYRDfT0sIHVuRCnEPO5taqbhPc358= Received: from BLUPR0201CA0008.namprd02.prod.outlook.com (10.163.116.18) by DM2PR02MB367.namprd02.prod.outlook.com (10.141.84.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Mon, 2 Jan 2017 10:42:36 +0000 Received: from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::157) by BLUPR0201CA0008.outlook.office365.com (2a01:111:e400:52e7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Mon, 2 Jan 2017 10:42:35 +0000 Authentication-Results: spf=pass (sender IP is 74.221.232.54) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=bestguesspass action=none header.from=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 74.221.232.54 as permitted sender) receiver=protection.outlook.com; client-ip=74.221.232.54; helo=sacsmgep14.sandisk.com; Received: from sacsmgep14.sandisk.com (74.221.232.54) by BN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Mon, 2 Jan 2017 10:42:34 +0000 X-AuditID: ac1c2133-b8fff70000000ec6-63-586aa9906dd6 Received: from SACHUBIP02.sdcorp.global.sandisk.com (Unknown_Domain [172.28.1.254]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 82.57.03782.099AA685; Mon, 2 Jan 2017 11:27:12 -0800 (PST) Received: from SACCASIP04.sdcorp.global.sandisk.com (10.181.10.113) by SACHUBIP02.sdcorp.global.sandisk.com (10.181.10.104) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 2 Jan 2017 02:42:33 -0800 Received: from ULS-OP-MBXIP03.sdcorp.global.sandisk.com ([fe80::f9ec:1e1b:1439:62d8]) by SACCASIP04.sdcorp.global.sandisk.com ([::1]) with mapi id 14.03.0319.002; Mon, 2 Jan 2017 02:42:32 -0800 From: Bart Van Assche To: "dledford@redhat.com" CC: "andrew.boyer@dell.com" , "monis@mellanox.com" , "linux-rdma@vger.kernel.org" Subject: [PATCH 10/15] IB/rxe: Introduce functions for queue draining Thread-Topic: [PATCH 10/15] IB/rxe: Introduce functions for queue draining Thread-Index: AQHSZOTrpzFQ5SRJ3kS1HeDV64SM5A== Date: Mon, 2 Jan 2017 10:42:32 +0000 Message-ID: <1483353661.3592.32.camel@sandisk.com> References: <1483353316.3592.14.camel@sandisk.com> In-Reply-To: <1483353316.3592.14.camel@sandisk.com> Accept-Language: nl-NL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.28.1.254] Content-ID: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsWyRobxn+6ElVkRBofnKVlca9/HavHy/AdW i2eHelksNrxfw+7A4jFp5gxmj2fTDzN5vN93lc3j8ya5AJYoLpuU1JzMstQifbsEroxF7X/Z CzZoVqx/t5u5gXGFRhcjJ4eEgInEkd+djF2MXBxCAkuYJBZ9WM0CkhASOMcosbZZD8I+yiix 4TIjiM0mYCQxe8IesBoRAX2JQ6tXgjUzC8xllFh/Zyk7SEJYwFViy7lbjBBFXhJXv+1kgrD1 JO62/gGzWQRUJK43bmLrYuTg4AUaOmOnOsQuI4mTnc/AWjkFjCWOTz/OAlLCKCAr0fKaGyTM LCAucevJfCaI+wUkluw5zwxhi0q8fPyPFcJWkPi84h/YdGYBTYn1u/QhTCuJFfdjIaYoSkzp fgh2L6+AoMTJmU+gHleXOHlnLfMERolZSJbNQhg0C2HQLCSDZiEZtICRdRWjWHFicnFuemqB oYlecWJeSmZxtl5yfu4mRnCUKhrvYPy3wf0QowAHoxIP74KbmRFCrIllxZW5hxglOJiVRHhb 1LMihHhTEiurUovy44tKc1KLDzFKc7AoifPKH9gdKiSQnliSmp2aWpBaBJNl4uCUamC0O/0w 2vyit1H4ekZO9w3vcp/Z7bx5K81kXsK2kyedbd29f/tXhm8/n99o+kzVNmHekZlLmz8ynDzk PdXRe8W2L2sVt+glG8178ah4XzXTJMHYkipH+w7+lxdeGSUacM06+ulOi+61QG2DCzqG7r+8 rDSmLZ029biyRkv65/ff5eZf2nNIe3qzEktxRqKhFnNRcSIAfHqjGs4CAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:74.221.232.54; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39850400002)(39410400002)(39860400002)(39450400003)(39840400002)(2980300002)(438002)(189002)(199003)(86362001)(1730700003)(36756003)(23676002)(5640700003)(54906002)(8936002)(189998001)(33646002)(2270400002)(356003)(5250100002)(50986999)(5660300001)(8676002)(50466002)(76176999)(81156014)(54356999)(2900100001)(110136003)(626004)(2501003)(4326007)(92566002)(97736004)(81166006)(2351001)(69596002)(7736002)(3846002)(305945005)(6116002)(106466001)(102836003)(106116001)(68736007)(2950100002)(8666007)(47776003)(38730400001)(103116003)(2906002)(6916009)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB367; H:sacsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD018; 1:g2ptf3d7lmIkctZudUVw5EgR+dS5Aq3n+QLfRLfR9fyAdE+JpSmpq2BX/XcIfoR6rptgNWJGPxUXpvfSYghgNY0ObSfrdSr4hcJLNR5OV2C/ZTKVxCUDqIPHZY/0H1hsLt2pJ5ER0PDF6MBj8OUNleU2j0peWn73nXhiMrX8fj25f5EwOvLnebA8WJnqb2M6HMnqbcdOK16GZEf6K6PZLUW+kQDEhg4eLkv0JNZy7YiImSq9wtu3YU9WED2mmSVKDUnsIMAAliG3DbDHNOfSNZJLtpfzkuCu8eVzrMA6jtmSWj2zIICO8N2OL2fGoFyLnf6HoeqeXX6MTuVaqiL8ch481NGTSiqd3EG6VKMDf3Rr09sq6iWufleKwTK+AXuyNN34Yl0bPzZaeNISI8ZtFG6+QdGLeyDgl934vckuhKl4+uCRAVrnYEIyOIBjuwBikMRK+1hM3HBFCo7/b6jYTvsnKTljjV0fuz10lLh1tduLIMDcxeCAbfueZV5MDFM6Jvnvu2NiS7JVTcSkcnhwKH+njMpi/EbSvNL5qrUG9SFs+t7aYZVSC1sPjacuAPR2gnIy0G2HYtXbXkcw4LWy6n0x233blzB30wNqQH8uNZs= X-MS-Office365-Filtering-Correlation-Id: 4f75cb10-3068-4470-c05d-08d432fc1049 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DM2PR02MB367; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB367; 3:Tj/CWTXdXebvRcjBkLbr8du0+90SnX9QYmVmKNDlRy4AoKSwnBrJzihQGGWinjvSPXDYmZfRXDFdu2eJKaj0noDlYZu+8jVYXfpuNJDhpCW/Sif1jFL6pAnwaWvb98r0Ie5V4UdXiXPyc/CXjXth6EOnTbQI+im8MPKqtQ+sEjYhK0X/QD8NqDMsAk/tlbc3zYLfkURRtrrAsUiki9Zu4bB8GmtGswwKxU7ZNMQNUTJw+tphYxJl2v7ghu2ykvP78e4QzoXJ+MIKtIE7cRx/HK6RWY6DdyBLBlBry3hK/hhbbldhLcMC7hmrNMojbnvWWFOR7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Aiudj4vEX5DZXTGwds69XCPgIdE5Dm68VP4S77Thlzp7bfXm3R5JlHgWkHpmEIaNGXOexQHsJjm/MITjU+z953KBrDgvi2VSDF3Tcv2nUy1zzw86ScUmrMZZZI5ZZWDfDNr2FXIb24IDVePzpdgeRV2lVYi/nXnnMEV88pqq1GqgHKlkSlqFg9hy3ko8MEBKz+sTOVKznEK8bVN9qPwTY3SjLGfR3FL+c/qJtflwoaq66sNB+si5uoRuSQwA6m1NOztkSx708Te/1xEXsOMazioU2aa06HLFfTvl/CeUhUZQF/F0gE9aRfvu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56004941905204)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:DM2PR02MB367; BCL:0; PCL:0; RULEID:; SRVR:DM2PR02MB367; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB367; 4:eCb49E8OCh39ygegIJ/mg5iZ6yUiD22L2Seesu5huB2r7V/s6v6yJGUsLhEFF4K9M8DQ5DRrH6z0vd2YdPP2HdEqM/WC3D71XZoBbWufm12/VbpFcxPpdcuODjEPDFDi9si50pcifJilYqZbKPtP6WM4CK5oY+3Vyt1/CUY2rLT2XI13u74+wGkDAlSp+Svb48ntuY11JZFKF7cpKpBBA7hc628UqEMG/nxkiDv73nMLd50mKnJTPOTcezVKo3Lc/qOPakrClOuLy9fHofzFKAZpv7Ctcnbf35Bpo6NAy940hrwsN9uoioAiM1+NHacrdObND/9hbTKBISgtoRTA60X6eqk9RLpJ0Ifs5WQYhp6tJbv9e/kKlbP2ICfBZqRatOGLz9Yrf6SHUrp6W9JnzAWdGrGP7jRJBH9T+2S9QQl5oeG5W8YwEqMV6aIB7Er2mPKgvZ/Iu+uIpTG4yiCYk4YAsI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A8xnzc8z6HbMum07eVvTJYEvaU=; 24:is3f3EgpLHod9KRiv8iZ/tZD/MxX2c1yAhBGkO1LuD7sB0qPvDrsNcsvlYWnQj8I51FEAToAIBOgOz/6p2ZXrxmIYvje7S9a2lUGNoVuzxM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB367; 7:HhsibfzVEmsIEG+tVaohAp3nmoesiRVul4pUQzbdXx/SAwPR3w38kPjYtbQjrq+EvJ064AlSgTJOycn7M8YwlRaXSo/z2ibjs4wQFMw3rvNHjDCnz9TrahNsFuICA0wSW8wir6Qp79fvw1bdASqX5Nq/6T25ukGye9yG+qdr5hHO8JRgiOeViXW4XUqnT+FEGj4b9DDw2q7Jdql0VEq84/9nBO2hpKNRujjuWPf9HGzpv2q4lQ8aOEOPJdziSJCUzWnAc2qsxrMz8McBjopY/MLaqu6rrX+VlNhDS7ice1b458jnn5gcKEiuagVQPwxDcUZWMvFExRO8TJl8ZpdLMlJ+/rz4BqABpzTQyMnRbqACYa3wkapumnzDpEYwhBX0wYeGZnH2FhfbZ+kUYOFImwg4BUYc2f6tayQD6WVuwDlHzDSscxlIIuqZdnNuLbHrRukknm31dND8sBXaUPqZlg== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2017 10:42:34.7818 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[74.221.232.54]; Helo=[sacsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB367 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 This change makes the code easier to read and avoids that code is duplicated. Signed-off-by: Bart Van Assche Cc: Moni Shoua Cc: Andrew Boyer ---  drivers/infiniband/sw/rxe/rxe_comp.c | 63 +++++++++++++-----------------------  drivers/infiniband/sw/rxe/rxe_resp.c | 28 ++++++++--------  2 files changed, 38 insertions(+), 53 deletions(-) --  2.11.0 Reviewed-by: Andrew Boyer diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index e912e5396e8c..6769a075501e 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -503,57 +503,40 @@ static inline enum comp_state complete_wqe(struct rxe_qp *qp,   return COMPST_GET_WQE;  }   -int rxe_completer(void *arg) +static void rxe_drain_resp_pkts(struct rxe_qp *qp, bool notify)  { - struct rxe_qp *qp = (struct rxe_qp *)arg; - struct rxe_send_wqe *wqe = wqe; - struct sk_buff *skb = NULL; - struct rxe_pkt_info *pkt = NULL; - enum comp_state state; - - rxe_add_ref(qp); - - if (!qp->valid) { - while ((skb = skb_dequeue(&qp->resp_pkts))) { - rxe_drop_ref(qp); - kfree_skb(skb); - } - skb = NULL; - pkt = NULL; - - while (queue_head(qp->sq.queue)) - advance_consumer(qp->sq.queue); + struct sk_buff *skb; + struct rxe_send_wqe *wqe;   - goto exit; + while ((skb = skb_dequeue(&qp->resp_pkts))) { + rxe_drop_ref(qp); + kfree_skb(skb);   }   - if (qp->req.state == QP_STATE_ERROR) { - while ((skb = skb_dequeue(&qp->resp_pkts))) { - rxe_drop_ref(qp); - kfree_skb(skb); - } - skb = NULL; - pkt = NULL; - - while ((wqe = queue_head(qp->sq.queue))) { + while ((wqe = queue_head(qp->sq.queue))) { + if (notify) {   wqe->status = IB_WC_WR_FLUSH_ERR;   do_complete(qp, wqe); + } else { + advance_consumer(qp->sq.queue);   } - - goto exit;   } +}   - if (qp->req.state == QP_STATE_RESET) { - while ((skb = skb_dequeue(&qp->resp_pkts))) { - rxe_drop_ref(qp); - kfree_skb(skb); - } - skb = NULL; - pkt = NULL; +int rxe_completer(void *arg) +{ + struct rxe_qp *qp = (struct rxe_qp *)arg; + struct rxe_send_wqe *wqe = wqe; + struct sk_buff *skb = NULL; + struct rxe_pkt_info *pkt = NULL; + enum comp_state state;   - while (queue_head(qp->sq.queue)) - advance_consumer(qp->sq.queue); + rxe_add_ref(qp);   + if (!qp->valid || qp->req.state == QP_STATE_ERROR || +     qp->req.state == QP_STATE_RESET) { + rxe_drain_resp_pkts(qp, qp->valid && +     qp->req.state == QP_STATE_ERROR);   goto exit;   }   diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index 6dbd069689fc..25951e9413b8 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -1207,6 +1207,19 @@ static enum resp_states do_class_d1e_error(struct rxe_qp *qp)   }  }   +static void rxe_drain_req_pkts(struct rxe_qp *qp, bool notify) +{ + struct sk_buff *skb; + + while ((skb = skb_dequeue(&qp->req_pkts))) { + rxe_drop_ref(qp); + kfree_skb(skb); + } + + while (!qp->srq && qp->rq.queue && queue_head(qp->rq.queue)) + advance_consumer(qp->rq.queue); +} +  int rxe_responder(void *arg)  {   struct rxe_qp *qp = (struct rxe_qp *)arg; @@ -1374,21 +1387,10 @@ int rxe_responder(void *arg)     goto exit;   - case RESPST_RESET: { - struct sk_buff *skb; - - while ((skb = skb_dequeue(&qp->req_pkts))) { - rxe_drop_ref(qp); - kfree_skb(skb); - } - - while (!qp->srq && qp->rq.queue && -        queue_head(qp->rq.queue)) - advance_consumer(qp->rq.queue); - + case RESPST_RESET: + rxe_drain_req_pkts(qp, false);   qp->resp.wqe = NULL;   goto exit; - }     case RESPST_ERROR:   qp->resp.goto_error = 0;