From patchwork Tue Jan 10 19:15:49 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: 9508421 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 5DD8B60231 for ; Tue, 10 Jan 2017 19:17:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C86527AB2 for ; Tue, 10 Jan 2017 19:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40F6727DC2; Tue, 10 Jan 2017 19:17:43 +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 72635284EA for ; Tue, 10 Jan 2017 19:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757819AbdAJTR3 (ORCPT ); Tue, 10 Jan 2017 14:17:29 -0500 Received: from mail-bl2nam02on0061.outbound.protection.outlook.com ([104.47.38.61]:50432 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S940830AbdAJTQE (ORCPT ); Tue, 10 Jan 2017 14:16:04 -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=BnhbDITRmLLgKOcSxhixdDXfE6yczhek6u0dshmzdfaiM2cUnv9iEoGbhg1vJGOseSjgGJ6MnIui+Mj+nXYWpZtelAhLysZzPfh1I6r144ixoR5lNX9HQrE+r34b3HDW4kvDCA0lu+KHqkoYaQxtg71ms0RJkHYcY6+bf1MjQzU= Received: from CY1PR0201CA0006.namprd02.prod.outlook.com (10.163.30.144) by CY1PR02MB1416.namprd02.prod.outlook.com (10.161.171.152) 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:15:59 +0000 Received: from BL2FFO11FD029.protection.gbl (2a01:111:f400:7c09::158) by CY1PR0201CA0006.outlook.office365.com (2a01:111:e400:58b9::16) 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:15:58 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BL2FFO11FD029.mail.protection.outlook.com (10.173.160.69) 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:15:57 +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 E7.87.01420.1D035785; Tue, 10 Jan 2017 11:06:57 -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:15:54 -0800 X-AuditID: 0ac94371-47fff7000001058c-57-587530d11fcf Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 1E.48.16817.AE235785; Tue, 10 Jan 2017 11:15:54 -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:15:49 -0800 Message-ID: <20170110191554.17359-11-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170110191554.17359-1-bart.vanassche@sandisk.com> References: <20170110191554.17359-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsXCddJ5ke5Fg9IIg/YHhhYvz39gtXh2qJfF YsP7NewOzB7Pph9m8ni/7yqbx+dNcgHMUVw2Kak5mWWpRfp2CVwZP75eYy94KFvxbeFy5gbG 1+JdjJwcEgImEr9WbGPrYuTiEBJYyiRx6+B1ZghnB6PEk4Pv2LsYOcCqtlyxgIhvZJRYtuYR C0g3m4CRxLf3M8FsEQE1iU2vFrGD2MwCjhKXpn1iArGFBTwk7raADOXkYBFQlfj3cRuYzSvg ILF8038miCvkJXa1XWQFsTmB4h8W3GcC2SskYC8xZZUxyF4JgecsEq8e9bNC9ApKnJz5hAVi l4TEwRcvwGYKCahLnFwyn2kCo9AsJGWzkJQtYGRaxSiWm5lTnJueWmBoolecmJeSWZytl5yf u4kREsSFOxhf3/Y+xCjAwajEw9vxrCRCiDWxrLgy9xCjBAezkghvql5phBBvSmJlVWpRfnxR aU5q8SFGaQ4WJXHei9Efw4QE0hNLUrNTUwtSi2CyTBycUg2MLaL1097H6N6XPXNIa72Xr2x1 WO5PQw/jn5MeLdj9OPFAho7fio9PreX4fx6Ye7vHXma5c8aPMgl3x4Dbod2vTaU//dovKqHC bJ9r1S0i8TpqQnCq55L0rXeME65P9b8Z8OnPKcETAoy1xW8E3USYCs5XM3tO/GwZ3t5pap88 /fUxzyzGd3eUWIozEg21mIuKEwHuXnXoXgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkuLIzCtJLcpLzFFi42Lh2sjJpvvKqDTCYGmbusXL8x9YLZ4d6mWx 2PB+DbsDs8ez6YeZPN7vu8rm8XmTXABzFJdNSmpOZllqkb5dAlfGj6/X2AseylZ8W7icuYHx tXgXIweHhICJxJYrFl2MXBxCAusZJXaf/MnYxcjJwSZgJPHt/UwWEFtEQE1i06tF7CD1zAKO ErfPh4CEhQU8JO62XGcGsVkEVCX+fdwGZvMKOEj8ejQdrFVCQF5iV9tFVhCbEyj+YcF9JpAx QgL2ElNWGU9g5F7AyLCKUSw3M6c4Nz2zwNBQrzgxLyWzOFsvOT93EyPEy5E7GJ9OND/EyMTB KdXAGCZlxSDWxXHa+tOijYuDr58Lz864Y59jG31aNSGZ73Dz2aMulYmRGfe/dbG8MnS/+urB 1b9Hd11cXTP75oKcVIO3z/bOM16zPZNVK0DsXscO187s15yT2acLnjO6ybOniy16ye6yc0sj FRYm339X/CHifl5L24PkOMU5zhefbIz49yG4zOL7NiWW4oxEQy3mouJEAA+bZ3aiAQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39840400002)(39860400002)(39850400002)(39450400003)(39410400002)(2980300002)(438002)(199003)(189002)(33646002)(97736004)(110136003)(36756003)(69596002)(6666003)(5660300001)(626004)(86362001)(92566002)(68736007)(106466001)(6916009)(47776003)(38730400001)(2950100002)(305945005)(356003)(81166006)(50466002)(8676002)(54906002)(81156014)(48376002)(77096006)(4326007)(5003940100001)(2270400002)(2906002)(50226002)(1076002)(76176999)(8936002)(189998001)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1416; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD029; 1:m20o4a0rDSJGfM2fFSZFa4SnoyLRh1YBhoFZGtfSCw6BdNUbMNt3zRwTJlLatGcwqtYFjwAytqNwAht3MDYOQuxj7rztgUHfOlxfMud7UycSrYhK2k4H2+Qw2ULs6q6hAbgziuRYk8mHgnKDEGQhlg5yuwiRtNHtk1SihjsNQYFnaFYen+i4xXh5qJPzybMWdfBm0loKdqN4bMnt6Xs4G85/U/qoLNtR6xXhM+NviaqU2o7BghSJGbfXPsy56tQ4y/700eDyuS9mt1eDv6P91YisYwc/eZakC0bt3WH4qYejfaI7FLSr3LL8CLkGyxO+BP8bEGFYW9Ln9FIpBiIfhHYsdnB3h6GrZk3bycFBgB3055wu03a5O8RoYpgDe9mXc4IAICUeMQ5wJq0FhfEjvB6aObwccrPZKJBe7a+iaQKGJ8wkiMgPQfYBL1xlvK9si99Jv3seNKXiQT4J0Op7XKlDsrYSp0br5l5TAzF7G9g= X-MS-Office365-Filtering-Correlation-Id: b62a255e-d0a3-4b4f-aa0d-08d4398d1b84 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CY1PR02MB1416; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1416; 3:hJMDqPAfUlAAq7DJI4dFYok+9LP6Fs2svev1Bib0YUG/yEiKN9abhb/scW6RNRypvjJog1jU0huJMf+ap8BhKMd4dW+ppGVfWVjFuNOFqMQYdHcDxZ8gaoeyhZ0Y8DZwOfMeje/D1954/HOGorquQAw6xBH7W5Ttlgn0WI/9m9YmwZf1Vf8tkJhT7ajtdDq9+KN1fyd0Dqr9iR4Y39GUEcO+5sWpG8/nYo+O+br2NaShxBH4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3YZuZpqaXfIge1GKxWGVdGBrEWxklmz3XE/7wIKkJbFAw5DsAco7izSCRrEY8K/H3T5qS2wp8Q6ntIIpSPyVO7ZICkmZpScZcIJTSid/QIDKGGuB18qxqKQycro8VJlxr+ZY7wb7kn1hzkOHCLZEzeTGYCgJqXslr/nVJNCAIR/uH4XZQv+L/X9meQFekTkAYyTaRIAnlPDyCLr/Jpc0klRzSXoon8ZRgCPYJWodlQg5oBtdmO7cLZekI8bHKef3S49lMCmqNc5NM2sBqwZ7lBIgBRF3BCYzA8Z+7GWRwxtWZBdT5HfrNAOCDHBJFIYt/mAxm08nOwdoOSQufxqSfP+txsDvitPczz3ZuFDfno2GUmjwh8rNdUH5apiGYAwEzu4A32mqNS3QWeVuWOJpN33 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:CY1PR02MB1416; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1416; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1416; 4:2HdqFJAiCaJ0Otnt8sR4yZ926gFwZoXbC/yt6z+90YZ4MiormyOgOjDLwsBXlPQ7/C44GtI7infmagfMYgB8C8LHcmVqdtw2ZmKc241XXTSsft10IT0zBdGpC4zLROyqP2B0PpuM5KBZKOxI7LAB4LRysEE8KHZeCm/dN6bmMpguCf1enPNY7aMXnMIevllRdkbyk6WTp0f9oWq2wyls3XHThRaXvivAjR2PCgNAVC83gYiFBFK+d3YOBMkkCoRYkn4eByfTKRczKCKbLKiQeVzsOZELy3VBk2lM5xtnwdHGtdjjgP0ZgkORemg+J0UHMKLyMBRDtqcwJG1u6TahV+HlnaXDykic5nx5XB9N3Rno4N2qTgQyuxI9jr86H8imTRqHZ9gs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mlzND0sz4fcvwImLqEChnKJ3UpycuFW67BbMaIbkqukEkryQ6FBqaDsTSAU0eZzy7EYk9zdIw1Q6mQ7bsRRs5l8958tgFwhJQRK8SZA/FItMiTeI1icTgxVF6qD9x5Yk5Uoh7nbK6eTKUUnhYSZQH3bn3+tlSUmq0ZTmNWdLScoVW9Ug==; 5:Gc/bGQwk1beCF5uyjzzviHNisoVGSVFyVM/u7FSrR8TMtu7qZ11rT4UcKigTSmpR4Tx8bI3XdC+TwMsI3raMy7dlL/AHvSmLLLZz0sRn2vl9N2sOHq8aVf1emUFBT63Shc/SbydZe5OUXg7OJPOiQ88une+r6SiYefDAYbT+afE=; 24:J//pMuTv5xUUNUwMonLo9HaTXqCyjDpYvK9uGvz/bC9XWKntUC3Grl0zQmav7jD40wj4h4DNCoQEonM+qaiQfaw/yR+PfRFs6jC7cTOFWtE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1416; 7:JycPjObregIyB70a+F8WYp4jfSFIJnovjsjARJRqLMW6A1KdB9D6KyqAhL8TLkvUM/lFnINRMH/ML8/47AdBSeyok3gFad7lC0qgygUsiEohQSJe+y3KyyeUdEBK4LrNYe9YEeZy0bKxpzbBvue5WY0FC9MCdm/0q39V61c1yWQQKzCMCs6VKgJUUHb+8SPlGOyebhb8WbGI3EuNgEndOwp1Zq+ENLpqqUWR3D0dWjXkCVx0cVgCPqIS8FXSmi7n+W9K3ml0PnMn3g6Caeu4QVBsqfCJa66RnFeTauebVSvQrFr5UPgpuzgYOItQRhivvvj7VPFMW9KPx8jOERROL4cfJfU09ayxM++X7jI5cUSypu22Pbhb7t8NU5w6ygMOyH+IwmuNNFCcLw/y59VXMedv0BhvvfsX6/o9TIFempwzZW0xXRYS6ghA6peASUxnln5mHkKkp7CZd3syJkS6zA== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2017 19:15:57.6565 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1416 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;