From patchwork Mon Sep 12 04:49:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9325677 X-Patchwork-Delegate: bhelgaas@google.com 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 D344B6089F for ; Mon, 12 Sep 2016 04:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C885B28ACC for ; Mon, 12 Sep 2016 04:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCDA628B19; Mon, 12 Sep 2016 04:50:54 +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=unavailable 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 3C54328AD7 for ; Mon, 12 Sep 2016 04:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932586AbcILEuq (ORCPT ); Mon, 12 Sep 2016 00:50:46 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:34218 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756576AbcILEuf (ORCPT ); Mon, 12 Sep 2016 00:50:35 -0400 Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Sun, 11 Sep 2016 21:50:24 -0700 Received: from EX13-CAS-002.vmware.com (ex13-cas-002.vmware.com [10.113.191.52]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 71897184A3; Sun, 11 Sep 2016 21:50:34 -0700 (PDT) Received: from EX13-CAS-001.vmware.com (10.113.191.51) by EX13-MBX-017.vmware.com (10.113.191.37) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Sun, 11 Sep 2016 21:50:34 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (10.113.170.11) by EX13-CAS-001.vmware.com (10.113.191.51) with Microsoft SMTP Server (TLS) id 15.0.1156.6 via Frontend Transport; Sun, 11 Sep 2016 21:50:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xidGd2Oo/CXCuoILHyevrW6xaHK5PGupFoO3rQtZ20E=; b=YsS8TUdqFhUXdsTmBQJ9EL4YScn1aS4UxEQINaixMwBLVVC7FkdDn9SZsHD3qcWBFxz1bNrRw8BaWPgiGOJBtjZIRbaqmTwyAOsCGugH8Bym6TVGl9guxFf8EshzlBCreajHpjpwEwHs4bV2yTAHbY1kxVOdSp6G0cs/CK1A2Zk= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=vmware.com; Received: from promb-2s-dhcp95-136.eng.vmware.com (208.91.1.34) by BLUPR0501MB836.namprd05.prod.outlook.com (10.141.251.150) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.3; Mon, 12 Sep 2016 04:50:30 +0000 From: Adit Ranadive To: , , CC: Adit Ranadive , , , , , , Subject: [PATCH v4 08/16] IB/pvrdma: Add device command support Date: Sun, 11 Sep 2016 21:49:18 -0700 Message-ID: <1473655766-31628-9-git-send-email-aditr@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473655766-31628-1-git-send-email-aditr@vmware.com> References: <1473655766-31628-1-git-send-email-aditr@vmware.com> MIME-Version: 1.0 X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: BY2PR04CA052.namprd04.prod.outlook.com (10.141.249.170) To BLUPR0501MB836.namprd05.prod.outlook.com (10.141.251.150) X-MS-Office365-Filtering-Correlation-Id: 4e288f24-b35a-4e53-b661-08d3dac85369 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 2:0PyK5NYa194/lht1FRk+qWDUu+l0+qABTiRtwVhSR78+9h+Dj++eUbkCpr2pKZ/GbhFv6p1S0+gl7fn9ur64WbWMmO9QN8NN/Az0hW5g097JNX8UyaBdmYgBleih2UNzlkQhSBa504jrR4tF4MPCqZUG+1+/di3E8XNqBUlPcGNfS8jGLL1gMBq1+vA3ub/B; 3:5Lp4RZ+ViGCAxlwF1gFi6lTOjDnDoYs4ussAklmYXleuDXcDqnYZ99Tb7N/qsi9aDdUG6GJiIPkidfn1HzCyAfN7glKYiqh2yW2QCXihcubWVUaeFKDqcjoAeqJqXEcN X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB836; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 25:BZ0+tUHaYoveWT4QEgJNg3iH4GIr0kyLACObAuCowxu4z/J379P4ZqEJkWpP1IxSNi8NXC6/atDVe9thU00pWtX/uwi1g5Ms2U2BlUxm5Rz4OXJ9yDc+uTMXMSQmQyDlIMJoKy5k0KfULxhbh94YFCuPQ3sqMwaL3CiBvUIwmiRxNBvTr2py5TQIjLVu154nNmTQ+q5JzdJ70C9TH0gQvJspyVZRAE6myLk9JevRmmIUmUqVo2WAU1PBiTjf64ok21ZnrHWV9XgE1233pm9oTUp5XRsNdJ9rGgMt1vuqC8HaP+DNUSZ7AU/Ey2fanSsiB9nwt4oCBOE7RcgrbX1LChWzQh84Gy8gzrlxIKcXGmXvq0W1GsrWE34QDfFOHcYoW7aE8GlLcc1Gk9Am8HHV8Q5O7L+mu6JS1SbmXi6ujO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FmIFVxT+pwe59F8NOgvcqkgfxe7+VOhq4wXRw6QeO1T6pd2+3MsYTmmK7XE1xpTeRYOR8dyRM3UOe7M6q9CGN7V2BNhxzYbjB5uKwcxyKLB7AhFBLcKC1yrgMalNGTjPgBYcue1fsaW8xWC71VE2kEDRq2K X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(61668805478150)(22074186197030)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BLUPR0501MB836; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB836; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 4:E2zZu+8TerwYddaeioepGpZ7nBkHPCa/q+2y0dyfaN50hXWUVX352GyhD4AfBhF2qlZjunOWd7Q4/2WrJkrc8P/bQ5oYav1DpE0qLax9Tt+NZ5D2tvxdUAZSphxtZT6Cik/q6aIivS23r4WfNtOzuj1xhelKSm2A4gLpU5fk6hbjHYd0Q8iBQjm9PXGQKlTbOg3fxULo9+duklzxWzqb4GH9r2GQhkz6gWb0zb1/ywKd72NAqayg5HPi1MRl9vcNXmvitFO5Y39SkSi6VAZi/FF7s2nLVXlzocxhoWGNsW0VuETgUmNKt2qJmS3GKr1QeSKuvjRF/I5XptHKTrKnYDnc8AOzCT8rOA/40sXjLg8HSR+Qi/A4Mi1iZmOQQYNDlEBJPabQC3uvcniYDGBenijETKWgEZX/4Bp9/XE2uDnPjVMJcyd2meGKdcKrfqJEcOMXNUcZHqQWifSXiDFDFhbVhRwvXh1nJ4ddgBjEYNtWdxjELTumwyMj1zZEEpzj8G9D9nRhJHGkxgKH0nbLU/DSfAyQ2jr7B7h8tyNX180= X-Forefront-PRVS: 006339698F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(66066001)(107886002)(4001430100002)(5003940100001)(36756003)(47776003)(189998001)(4001450100002)(87386001)(86362001)(48376002)(2201001)(50466002)(2906002)(50226002)(8676002)(81166006)(586003)(4326007)(7846002)(5660300001)(305945005)(42186005)(76176999)(7736002)(50986999)(6116002)(3846002)(15975445007)(4001520100001)(5001770100001)(19580405001)(33646002)(92566002)(19580395003)(2950100001)(77096005)(229853001)(7099028)(5001760100003)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0501MB836; H:promb-2s-dhcp95-136.eng.vmware.com; FPR:; SPF:None; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0501MB836; 23:5U3S/RSps9Xa8SGkhQtYpVCuxRthclcPc+kHy8Tb?= =?us-ascii?Q?axiEyfw5ZE13Plvl4R28S7rGngtY5uNr8199Gf6jZzSIpDFenQL3raB6a0ZI?= =?us-ascii?Q?gKe+QwYNcSQ9S5JuNe55/Jz/XNAOIMrwh7ggEXSKBUPQnvuwnqBUjnor8bX8?= =?us-ascii?Q?CGiNqIaiKqzL0aDITg8Yi35UNUpLBwZFeBajXFpUQQ0u7cw/FrQBfiGTdrFk?= =?us-ascii?Q?30qoBuE+pnkejJRqFR8FKX0o217lNymvF2Sibfm4Q8hUNU6Nj0tlsyPpUNeX?= =?us-ascii?Q?sWrFc+RkRAWoSdcd/1Xiaw0aOQL8K+y8Ez3hph6NgPvZ4yRI3yTqUV8tT9at?= =?us-ascii?Q?eS6TOlGFocRym1wbc2yBsud03ott/SJ+qDhOCnMDQ93D/6OPebKYgS3SkQ/p?= =?us-ascii?Q?xRd9DYIXlMG3ENHVNWNaYN19mkr/KFV/225hRmPI3bWofmBtFCWkEvsCsSNm?= =?us-ascii?Q?YZgP0/WFddw2g0e6EFX0L/qnZ4rD/A7WhnqGWsKkPIO9s9t61JSFwhUJRf8P?= =?us-ascii?Q?Fcqbi0C6hYobEp9aCYyq4w1Uk8npndE4jcJXbMSJq9VeH3HJIzicvds9tsdo?= =?us-ascii?Q?e8NYPC6T9ZpqwP53Vz7g0VPadRM7Bh6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bbvObgwzcgB7ERnA8TUU/U9gvCaLHc5UylCyjB5HjyZ2TfX+cPm39CLQWT7BSRS009kaHwfA==; 24:G+CRwj7UXhyPcpneKwg6nejolRCHnNoCsvCUa2+csvo3fPxBmWWgw2yr4LBa6QZ7+sppELWvw4EXOb16/GaEI8iyUqjvJBxyrgezDLOvA7s=; 7:hdA6UxBOAg4VbWbU9QBPPvaXDYzUON3B/Qoazgz16scPKjwlfgHUSUJ4dxFBzgooql5OkidM0N2Wo1WzSQPNcLaWmVA5gnMSqHnRCruRAkOG+40X94GYKlVJeHHitR8rp3y4R9Q2SDY7byt9fkME4m4t7o3ly/XWlKXSag3sHmMSc01Da0ladqW3ZPL0LDJ0ksyQWX9BNTrcJxmGq7NhHfHHpVgimnKGpjnVNNQWF6lWXDLfFzD4VbPAkv5PCvBh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 20:5typ3vxUabEA7UWx1zUZa7N+q98NnWwbR/6CZVpksXb6HDMBPaofyqydlWTU52W3Gv2gP3y91XJmFb+zSinQ5psjPu+rCG8CRfkiDF9nRvdymRw/g9iH+KDpxe0BrTcb3DbEbBCrPDJVXavYeqdYNGvOkIbssjdl7eQ4tuC11cE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2016 04:50:30.5033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB836 Received-SPF: None (EX13-EDG-OU-002.vmware.com: aditr@vmware.com does not designate permitted sender hosts) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables posting Verb requests and receiving responses to/from the backend PVRDMA emulation layer. Reviewed-by: Yuval Shaia Reviewed-by: Jorgen Hansen Reviewed-by: George Zhang Reviewed-by: Aditya Sarwade Reviewed-by: Bryan Tan Signed-off-by: Adit Ranadive --- Changes v3->v4: - Removed the min check and added a BUILD_BUG_ON check for size. Changes v2->v3: - Converted pvrdma_cmd_recv to inline. - Added a min check in the memcpy to cmd_slot. - Removed the boolean from pvrdma_cmd_post. --- drivers/infiniband/hw/pvrdma/pvrdma_cmd.c | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_cmd.c diff --git a/drivers/infiniband/hw/pvrdma/pvrdma_cmd.c b/drivers/infiniband/hw/pvrdma/pvrdma_cmd.c new file mode 100644 index 0000000..827e3ff --- /dev/null +++ b/drivers/infiniband/hw/pvrdma/pvrdma_cmd.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2012-2016 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of EITHER the GNU General Public License + * version 2 as published by the Free Software Foundation or the BSD + * 2-Clause License. This program is distributed in the hope that it + * will be useful, but WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License version 2 for more details at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. + * + * You should have received a copy of the GNU General Public License + * along with this program available in the file COPYING in the main + * directory of this source tree. + * + * The BSD 2-Clause License + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include "pvrdma.h" + +#define PVRDMA_CMD_TIMEOUT 10000 /* ms */ + +static inline int pvrdma_cmd_recv(struct pvrdma_dev *dev, + union pvrdma_cmd_resp *resp) +{ + dev_dbg(&dev->pdev->dev, "receive response from device\n"); + + spin_lock(&dev->cmd_lock); + memcpy(resp, dev->resp_slot, sizeof(*resp)); + spin_unlock(&dev->cmd_lock); + + return 0; +} + +int +pvrdma_cmd_post(struct pvrdma_dev *dev, union pvrdma_cmd_req *req, + union pvrdma_cmd_resp *resp) +{ + int err; + + dev_dbg(&dev->pdev->dev, "post request to device\n"); + + /* Serializiation */ + down(&dev->cmd_sema); + + BUILD_BUG_ON(sizeof(union pvrdma_cmd_req) != + sizeof(struct pvrdma_cmd_modify_qp)); + + spin_lock(&dev->cmd_lock); + memcpy(dev->cmd_slot, req, sizeof(*req)); + spin_unlock(&dev->cmd_lock); + + init_completion(&dev->cmd_done); + pvrdma_write_reg(dev, PVRDMA_REG_REQUEST, 0); + + /* Make sure the request is written before reading status. */ + mb(); + err = pvrdma_read_reg(dev, PVRDMA_REG_ERR); + if (err == 0) { + if (resp != NULL) { + err = wait_for_completion_interruptible_timeout( + &dev->cmd_done, + msecs_to_jiffies(PVRDMA_CMD_TIMEOUT)); + if (err == 0 || err == -ERESTARTSYS) { + dev_err(&dev->pdev->dev, + "completion timeout or interrupted\n"); + err = -ETIMEDOUT; + } else { + err = pvrdma_cmd_recv(dev, resp); + } + } + } else { + dev_warn(&dev->pdev->dev, "failed to write request %d\n", err); + } + + up(&dev->cmd_sema); + + return err; +}