From patchwork Tue Jan 10 19:08:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9508375 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 01EE560231 for ; Tue, 10 Jan 2017 19:12:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9E1D28553 for ; Tue, 10 Jan 2017 19:12:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DECEE28596; Tue, 10 Jan 2017 19:12:34 +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 56E4428553 for ; Tue, 10 Jan 2017 19:12:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764592AbdAJTKT (ORCPT ); Tue, 10 Jan 2017 14:10:19 -0500 Received: from mail-by2nam01on0056.outbound.protection.outlook.com ([104.47.34.56]:1527 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936906AbdAJTId (ORCPT ); Tue, 10 Jan 2017 14:08:33 -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=gAC8YdZElxWor2folahw9jvQbi8FcI6LAcyTbdthc2g=; b=VffDtVRHb/FRn2A0D55E0RgckUrmVnAscjcLMRqWkNx+cz4CpWESsSYr+/YbZdA5tRNimEZNKuAZhV7RmppZ8UexCt5Dz048dh/xGIxdoZ8BewftQhMkwapqHIe4Gj7eH0l587Gx4JRrAAHdkmzEL7mcqMrr7RC74WGCV8Pogi4= Received: from BN6PR02CA0036.namprd02.prod.outlook.com (10.173.146.150) by SN1PR02MB1421.namprd02.prod.outlook.com (10.162.0.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Tue, 10 Jan 2017 19:08:32 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:105) by BN6PR02CA0036.outlook.office365.com (2603:10b6:404:5f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7 via Frontend Transport; Tue, 10 Jan 2017 19:08:31 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) 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 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) 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; Tue, 10 Jan 2017 19:08:30 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 68.A9.65426.98E25785; Tue, 10 Jan 2017 10:57:13 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 10 Jan 2017 11:08:24 -0800 X-AuditID: 0ac94369-b62949800001ff92-cd-58752e8996f7 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 69.38.16817.82135785; Tue, 10 Jan 2017 11:08:24 -0800 (PST) From: Bart Van Assche To: Doug Ledford CC: , Moni Shoua Subject: [PATCH v2 10/15] IB/rxe: Introduce functions for queue draining Date: Tue, 10 Jan 2017 11:08:17 -0800 Message-ID: <20170110190822.16953-11-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170110190822.16953-10-bart.vanassche@sandisk.com> References: <20170110190822.16953-1-bart.vanassche@sandisk.com> <20170110190822.16953-2-bart.vanassche@sandisk.com> <20170110190822.16953-3-bart.vanassche@sandisk.com> <20170110190822.16953-4-bart.vanassche@sandisk.com> <20170110190822.16953-5-bart.vanassche@sandisk.com> <20170110190822.16953-6-bart.vanassche@sandisk.com> <20170110190822.16953-7-bart.vanassche@sandisk.com> <20170110190822.16953-8-bart.vanassche@sandisk.com> <20170110190822.16953-9-bart.vanassche@sandisk.com> <20170110190822.16953-10-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsXCddJ5kW6nXmmEQcMPC4uX5z+wWjw71Mti seH9GnYHZo9n0w8zebzfd5XN4/MmuQDmKC6blNSczLLUIn27BK6MH1+vsRc8lK34tnA5cwPj a/EuRk4OCQETifcvvjB1MXJxCAksZZI49fMnO4Szg1Fi+dvprDBVZ55dZIFIbGSU2LD9NiNI gk3ASOLb+5ksILaIgJrEpleL2EFsZgFHiUvTPjGB2MICHhJ3W64zdzFycLAIqEq83SgAEuYV cJB4u+ADM8R8eYldbRfBdnECtR5uOgQ2UkhgGYvE33lmIHslBJ6zSHQf+MsK0SwocXLmExaI XRISB1+8YIZoUJc4uWQ+0wRGoVlIymYhKVvAyLSKUSw3M6c4Nz21wNBUrzgxLyWzOFsvOT93 EyMkjDN3MN594n2IUYCDUYmH98GLkggh1sSy4srcQ4wSHMxKIrypwCgQ4k1JrKxKLcqPLyrN SS0+xCjNwaIkzut270uYkEB6YklqdmpqQWoRTJaJg1OqgbHk81d31Se+PsL76uIqNSKP989N db7mJ1naXMAWHbMs4PlugVhhLi7xk0eeMHcnSahWzbh/WVWTdwJXwhzX594Fah//9Vvt3ffn 8Z21kdq+OWdiZ2yoe3VWXvnm+vtal4rTWzd1P/FRnz+t5KSS7KzgcuvHz69sSS6/dTOA5XTw cinnX9NjbJVYijMSDbWYi4oTAeIZjI1fAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkuLIzCtJLcpLzFFi42Lh2sjJpqthWBph8HKGjsXL8x9YLZ4d6mWx 2PB+DbsDs8ez6YeZPN7vu8rm8XmTXABzFJdNSmpOZllqkb5dAlfGj6/X2AseylZ8W7icuYHx tXgXIyeHhICJxJlnF1m6GLk4hATWM0ocnLiDBSTBJmAk8e39TDBbREBNYtOrRexdjBwczAKO ErfPh4CEhQU8JO62XGcGCbMIqEq83SgAYvIKOEh8u6cGMV1eYlfbRVYQmxOo8XDTIbCBQgLL WCT+zjObwMi9gJFhFaNYbmZOcW56ZoGhoV5xYl5KZnG2XnJ+7iZGiJcjdzA+nWh+iJGJg1Oq gdGqk+n/hwKpZf0+GXMLax6WmrhO2fF69lT33J+/LRfa3MxT3roq66j/Od0V3wqCWV9N2eB2 ttWi/Exu99K3U9Yfuf5D0PrgPAeJ+TK5gtwzqyNv35unnpa71H6GKeOuSu0Hk7eekv1ycXY9 s23r1FPKj60C05cl5xk6yi7elbK3YOrkbSdUBU2UWIozEg21mIuKEwHcGoC+ogEAAA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39860400002)(39840400002)(39850400002)(39450400003)(39410400002)(2980300002)(438002)(199003)(189002)(36756003)(6916009)(50226002)(8936002)(2950100002)(81166006)(81156014)(5660300001)(8676002)(6666003)(93886004)(33646002)(69596002)(626004)(68736007)(77096006)(356003)(86362001)(189998001)(5003940100001)(97736004)(54906002)(38730400001)(76176999)(50466002)(50986999)(305945005)(48376002)(110136003)(92566002)(2906002)(106466001)(4326007)(2270400002)(47776003)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1421; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:HWol0BY3BfEqS71pTh2WrLHn9e7SgvnXs7wfU/+M5CmClkAWPivVQjOJ267PW+4XzCXg78y5XPeicwjtgH+IwkjAPUbTwnGeVclbAOzu1W2GH6KJWGcXgbIhrwu4TCkXVmOSNXnTWZgqMv4rmItCWSPwRAVVhi+YDuPxYA1y9Pyb/RI7m+awhrl/h+iswJ11BNStI94YKjNwF8EtBF4lB0PblakwOC+MlgmhFJ/wxkyP4y8me+JYJDViFwH/ofrZG3yNxoHPEyqtO9njlhfuIVqAqDMAExnOZ3PEqJHFrhGQE5NT1DBq+nkWyR1pXBoBT5jtS06sfjfIBeR7Ooj9vpaVr/OZELDrPbMlTeZTwYxFnUCxCLZwKfExqT32zCZj2l0pbHf70BxhwAqeaiHeSxv1yQehg6uiXFC9MPGLTWpVb5WOiGv5yln8uc4qHiM2x0DvZmbDpYUpee8Xi+f8GGLKJ2pAMQcKZKoHyzMogRDtT4DsKG2Zwme6dwZyrkie7JdCbngDvojGCzinvilccA== X-MS-Office365-Filtering-Correlation-Id: d461e72b-6de6-4cad-fa9e-08d4398c10fd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0;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/6WeCg3hRB1yHLdIxeW4cg87wijObLlSVD+Nx8LR5PLikrDZGL/77 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)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:SN1PR02MB1421; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1421; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1421; 4:/ZX/N1GDi2uBwbM3ZTc+nSGoxahjFf2cBzW2GPco2T0+8zWkJqnlalSLVfLnPh2FoySFx3iRBX3KTa3lQbgqlGhFgg6AQABkY3G12SreFq1G+fJDl4RHrbWzzlMJBJYSQJY5hAGPYXYpfc7OdVZKFpAXPvAeGZT5SL6gOdOWBNoqmU9k6iBYujn4a+BmS+aRBm4GtslAF4592Dh0QI8+j0/BX4NPQ2o6sFAs7xo2ZytoYGX3SKfCd380SEgSE43xYoN/AKVBfENzb+ypjei/WUpZyU5fHNqBYT9JJUs42qYQ6g+5/ZzzW2EbL1UMrZ2DM1c96fZwXXxv062e2V/jQinFK71ZpSSTtIbqyfWkdEOaNaphI3wOw0BcxATLxS4tneTwqlMrblr0YDQXd3HZOBS3JLdC2Lp9sD2ynbi1nHXdgQGx78fwr7iTzcJeLfYSKpL1ZkA52kfQOsNatk+e8GkBvEQ6dafyaxpZyQYe15dzPX1yHZw1VaIBeB2nVFAMbV2CZFbVwwFmueICU5LyIBIqcOs7HhT6mwHpmPb3ULfoYw1lpojyc14FTZxHhxhEDiL49aJtwDwNLMBjqxqXTwgljdD/UoGPmmsQHiY6GpGkaPQvawbeU7TABwK1JyyEDESYieEuUqkfJJv1CSLbu6PA2HO5fXgluHiSZwFjoGikQsxwHJG+Wo+SAEa3/r+dNv/qIZkSZSYJJR5PJfwo0A== X-Forefront-PRVS: 01834E39B7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR02MB1421; 23:/YyTZLdusfP1bse2vHIl2W+avPjsrr3QT8K4zSUSC?= =?us-ascii?Q?hr1xkz4H6PJF1xrePIo53jJfSmTzRmtUuR7zogMNgdIgUAfnGiz57InTzIso?= =?us-ascii?Q?nyobAAh/MmfmfXaHc+TLitsObqllWQRYabgTOWUbn9Id23Y9RfgfCP+zh2Yf?= =?us-ascii?Q?+MluN5L8g3W1Q6SUJTrNh8nagQUWQnZRbE3Y1/Zfg/iehqvDV9egoFJopgLv?= =?us-ascii?Q?+e95Tv9AmVtmN8a1SuoOspLB8JA9RQ2i8Hl1fBut0mTjb36tNm1P7yz175k2?= =?us-ascii?Q?ZnA2nzYZn19fYI83oYW5qwy272Vypn9gVgWf5km01pnChvCtPCeXYGtWISzz?= =?us-ascii?Q?1MKQCawguk+/Lpn4qo3V6qaQhiqhBFKaG02e2hXnoUSMoJ1YKgPgMLhnBkiI?= =?us-ascii?Q?pOW8vzYb6Bv4dLDpdn/eHrQMqjJTKrpz33NOFwZAp9doiEMOVop/Le3FFOf6?= =?us-ascii?Q?6iRhGVpQCINfXlKoGDDJyw+Tu7maBJf0tO4bmCq6pzsCw3De8LYo/YKOIcMQ?= =?us-ascii?Q?zmtgAJZbDCAQM7CJKdloJKhrH/UctSa5QNuEItO+DLiHt80N8EvF8kqCR0J0?= =?us-ascii?Q?o9CRUxCpGyJMbcC1+5nx+/G43vfUUZdct3lLtCrjX7IRJ8LfVV5pvEL6oYoi?= =?us-ascii?Q?MpxkFCMECLGhIkvl5I5Q4wn0DJfLYdVgt0IJStKqdtnIcsrizfvX1ae6mcIB?= =?us-ascii?Q?xfN+qo+GROhf+grF75DeL5ek3hIeSDizWVXGy334jSGo0/N+1hE/+7bzlkln?= =?us-ascii?Q?id1F7UWP0kiXCGlyitnD8yBinHWBXGTvF5QM0MGUbFtdH/let6w3/I5xdR5o?= =?us-ascii?Q?ziuVeP1WTL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D+nYOEhoJWvdSxCWP5+LrLay8qmUEg=; 24:n8rmIoREsZHMjsXtOoY1SdbpUM9/544rXkHyKhdrAPW/AaV3bGce4vydMuAA0hYGp4rIty4qYdts6zwAtsOZTwKDfI8X2MB2U7I/vQ3tJew= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1421; 7:Xr3Uq5hNo1V0+4D+y1nO2FG+v8t2T+4YQsjWYGNtm6n+zYNcClmjG7DiMuPiYl50+RuwGMAR8BTLsADyYk71QjprEQLtoT1fHbeqJaBYAbcJ0SzN1Ydp1kv+Y9F/Lu5cmdv3cpfprhPZbzvoh1JsFz9ONleeI4SM2BtGPuesQ2/L95o4UyI+krFiRsaQ0RGtMftWq/eYohnbjo/evwfhjauF8RLzuvLGK1/wMRjS1paOqZvNvxsFxk65KEn2CMlbTWxjf3QVxTEVzj8CFOPKNJ5XDl0WQySZfm6ij+yIqpaMK/p94bLtTv4KWZt41YB0XICn7LRnrbIgO/mzbVWsEfxgH4ffrfNm03Xxx510YCeDYc7vL90m1lfD9SsupUIdvrq0tXPjYVNzsGfb8cn0N1JMrI8HaOsIfHcUvugx+MHnJLRJw/sBX658vIYcAtAWvsQhLVUA8ZPgFfBe9nmAug== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2017 19:08:30.5467 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1421 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 Reviewed-by: Andrew Boyer Cc: Moni Shoua --- drivers/infiniband/sw/rxe/rxe_comp.c | 63 +++++++++++++----------------------- drivers/infiniband/sw/rxe/rxe_resp.c | 28 ++++++++-------- 2 files changed, 38 insertions(+), 53 deletions(-) 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..51c134dbc6c8 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) +{ + 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); qp->resp.wqe = NULL; goto exit; - } case RESPST_ERROR: qp->resp.goto_error = 0;