From patchwork Thu Nov 3 23:44:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9411639 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 6C4A360585 for ; Thu, 3 Nov 2016 23:48:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D5302AF77 for ; Thu, 3 Nov 2016 23:48:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50BDD2AF9C; Thu, 3 Nov 2016 23:48:52 +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 26E662AF77 for ; Thu, 3 Nov 2016 23:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933240AbcKCXsu (ORCPT ); Thu, 3 Nov 2016 19:48:50 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:24621 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933334AbcKCXss (ORCPT ); Thu, 3 Nov 2016 19:48:48 -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; Thu, 3 Nov 2016 16:48:40 -0700 Received: from EX13-CAS-005.vmware.com (smtp-inbound.vmware.com [10.113.191.55]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 0BF67184B8; Thu, 3 Nov 2016 16:48:47 -0700 (PDT) Received: from EX13-CAS-001.vmware.com (10.113.191.51) by EX13-MBX-001.vmware.com (10.113.191.21) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Thu, 3 Nov 2016 16:48:30 -0700 Received: from NAM02-CY1-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; Thu, 3 Nov 2016 16:48:30 -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=SsiV/mXYeBB/oxlOLlaPZ+aW5TOrPBiiJMsHXO+fUbc=; b=RyWwrWxgn1ajgiYjrmXkgC6Y4rJ9/0Y354GAI0Eona3L1iUq7j8P67FqpmgWhlh76lidzhDS9Sy3cZvIiGYGotI/blyP8rsV4nNt1qPYrI3rRm87KyyQ2yE3Z43Vz4N9b5mUEB1461WpVZZvv9Vky+jIjdO7NMkuMXM3DNI92nQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; Received: from gandalf.eng.vmware.com (208.91.1.34) by BLUPR0501MB836.namprd05.prod.outlook.com (10.141.251.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.1; Thu, 3 Nov 2016 23:48:27 +0000 From: Adit Ranadive To: , , CC: Adit Ranadive Subject: [PATCH 8/8] libpvrdma: Add fix up for ABI file Date: Thu, 3 Nov 2016 16:44:37 -0700 Message-ID: <1478216677-6150-9-git-send-email-aditr@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478216677-6150-1-git-send-email-aditr@vmware.com> References: <1478216677-6150-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: d2149339-1935-42ca-7414-08d40443e8a1 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 2:htx4DBJReB1jvX5Crj562tH37rje5tBfvUkCHURWKUbpAmxYsuOv4H8a/W0hVLSiXNkkSRsN+R56LqCkC2PO2QkmUkuAMJrUoQAnm6kL1pgiUh0WDGGEgjpvs8KPxiYf0DFQbProwCrm6o3EGdz/lhNqEFCm2L9/VlDR5FmpV97nnS79B0IUHI36YvEybzP+lyKtuWpXmdEJ53Y9nrUc7w==; 3:dMWnC3+Ylm97Ac0wUGvQIUz1frg2MPxm+R8PHhoHLY3KcPF3FwL8UGPWbKLmQcqx3HljpoJDdFH/wGuZU8/LMZK9DzRL0fE302i3y7Xgf+sHBst+S43dYv2Pc9VX8jglxZ6EOdiNI46ALeA4mrwHpQ==; 25:rvcDvYVzM5ezl/4/W0yXMGW8beCXxUjmT/4zGBFGe/M5XpUfvKO6tIHfGUnK8ZAVULc91OEFB1CxpFYhnZGJRzZwRONIhABNVbIdDRalMjoxWFFXVNXzebxXIye/fHxTFO/pRFqbCBN1BDxQzHlNsL/KR/hB8jMjFp3XMX8ckXqkJ1M4OUZjCdlzx5nyNwwJnYBKDmpvOmTsdA/lq9Fwx4B4kbFcWY76lB+/hR3h7JkL1IlQwyrL3cN3jJAf+d0NJM7jSbG3cQZ/v8SRyxbkFfHZ7kEJz38eJQ2d5S3BQM40TG/q0HtFZoTPGqsMiut3MDrJN2Q8aAe2JsBCKz6kS6Ya4FXGe1boUA2LFBm7KUXnEGSjOxiJCAm4VJGNHEga0LdbgisIaaJ0JMuD7sT25LTd99NjH5X1mZUj7xwJwvkNlaQ0nmG9WLOv9c1S19aa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB836; X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 31:i9QKFtYLTM3lqAKxICwR8ontTtbQ0SGKcynuQPNhma0zZZaivGKLenPAkNkHVC1LycSlK3rZ3OEc8wdKuDwt24qTDwjs9t6qs8XI6F6ZD+4ZxnGIKndN04wIN3MbT2wRJHVMbYBnudGkOPIPuXXR+cwIDQHjtTlD3qMng0SyKp0gGeQbGYU3gGdxjxo1soAAHbFv8QlrHYfRi41EJpAy5gLHUEq9OLx4IIBdM9YIi+2tu6NEYQS4I2RLt0semrXl4K0goy0J3HikF29bcNk0hZE2Ra+6xgDGna0uVEoXqLI=; 20:qvFR7WxWqF2nx2XUN3V2BAHTctJu4VELwlcS4+kNfqIatIUKQRll61ueVVP/GJ2f9R9OmG+nH0DDlX10kq+gd1Q4XfJEe4p1LJrVjD2PunO52nTwgyXWfXa667LK7fWg2HVlMhmMTlGwedPI4tNXF2Eyp169Je3Ei0DhtexRXWqp3+MWZclozdvarXGqCFjvemhj/+oM4V9w/POUF1wyEPMoUulCqZOFTYNUi9yt6t5GaHadke9cNKikoztUYPcI+oE/j574Qzn8tmKuUor4h26dDvUfE9M1865DE+fJx6LHMNtpUq6zZ2ptY4O5E2FYtYC1F5yDy6diROv7fmT9KIHLQwyoDRQPyoIzYFh4Cb5rZr+uI8elJLrwM2Kb7CXXbngR+/3PoxFWxhGBA6dJTLX7WKxNy4jXdygagnrhfOAb3WHbywqUsqlEfkUE3TJ2XMplUlIhpufIPvbspeBt2v3nVTWuUoJQFt6qEfeVQtc4yYZdN9igOvVRxzFNpY7x X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(61668805478150)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BLUPR0501MB836; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB836; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 4:3W+rL4WIRnNWAf0WG2LUyREJqrMD4S3dPgy54QCfR1WitZY68VCrUK7XK9Hc33LTZvuTJ440Zrkm7zKh2tZ+KS/mGUWaifE5sDXCAJbuDZEC1UakrIriUh9JU6jn6D97Jdt2+D95/pr77BlBsU6vUWs0GK5qEY+i1NOxpudkw6/6Ga6M+rO9/XFFlsWvfUku0vo/283TdC2dx0A8fZXGe/th/dOMTliwGOitF7F3JGN2aYYyeaM30THQniYg1UgfGlwIvo0htIvZsWCb6gsbf3E7gYvkRgxVXuWN3Swi1Qb37onc2S7mchASvSJxJRyX4KXbJ1ZFw55EgDDC+Y8pTthLEgghkc3RVO5m6AQo0MoPYm8/t5HgKEoRK+m/V/88UTdQrneoKeL5ARA/On6ti55ExIjY9EDOpCuOYayvbn4neJaxsS1A13Rqk9BcDMOL5RBgM3fPFsmOl+d7NXTKXwirQwNK2tPYwhx438G5nUYFSEYuiuahPOy5PCtvJ8jBi29FzyRY93MVgwK2N/gPyA== X-Forefront-PRVS: 011579F31F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(15975445007)(8676002)(6116002)(5003940100001)(106356001)(5001770100001)(97736004)(3846002)(586003)(107886002)(19580395003)(19580405001)(81156014)(81166006)(189998001)(66066001)(47776003)(4001430100002)(50226002)(7846002)(92566002)(7736002)(305945005)(575784001)(2201001)(101416001)(6666003)(42186005)(50986999)(6636002)(86362001)(77096005)(6862003)(48376002)(50466002)(105586002)(76176999)(2950100002)(2906002)(4326007)(68736007)(36756003)(5660300001)(229853001)(33646002)(7099028)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0501MB836; H:gandalf.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (EX13-EDG-OU-002.vmware.com: aditr@vmware.com does not designate permitted sender hosts) Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0501MB836; 23:DVrLWVmwNJjgJtIqp3lAlLEETP3S9a/sISD79CS5?= =?us-ascii?Q?D1yM+nVelGvXgKf83HPuF/cetNiH3gf5ODZpTAI3RP7TmH6O+sboNzGrK8m9?= =?us-ascii?Q?mNRoSLzq5PeVvr9tAsJwLU+0YpCaJ/aSZoY4AUpJAXWwS32TLx5KyAQLvYtn?= =?us-ascii?Q?VOSr1KJct+dAc4kRRZUeoguqPXWnRMocM98okIFthvQhBCgjqqzHkzOJOA01?= =?us-ascii?Q?9O2Fgj7ZW3WvPkZ4r9ZC2ztEHvODW2t/JLlfTILtSXSGIQbiDspAA34LBRbl?= =?us-ascii?Q?w+p5wDTCQjNaJjS47WJW4tjEGHEh4cLoFn3CjLZcOfuNRGOsoFz8/1UTjCb2?= =?us-ascii?Q?JMlEI794ijAo7T6clI4vtS2VghrROsNyoIdXVI2M0REy+X1RXPnLL1h67Mt8?= =?us-ascii?Q?VdF1HAD6mc9zUVUGIwberWfklU4GUytno8Y7DyOFSrwSWGAGYRhwoPRAxhZe?= =?us-ascii?Q?8oFcIb9Gp5BNesW1SBBLPJ3wHS/dMiWuaJoYni2GAO7HpzKyPzTKKH9QMozd?= =?us-ascii?Q?R3jLspF/BhXYcryAE1hTdJLHDP3OsJGjNdhhKn9gyxzPaIWATc42SEarrn2M?= =?us-ascii?Q?aZufE56T+2R1QkWcMeVWNCeiu/dd5nR8GMSa1jr6AV04NLJ7LM0X/Gb0jOK/?= =?us-ascii?Q?8QAza8Hrn7S2smW4qJZz+jIuKkSplmd2baoOpOTrD/dJ94PhVFt8gn1nLCuw?= =?us-ascii?Q?Z2S9B1Fxiib20XqsQUdBoJOlsoKFSJZq1Di9hpsg0FGWxX70AjeFNrzEtEfG?= =?us-ascii?Q?VNLP+IcBN+ClKeCKpgTVtfONeHIzKtAEd/4OoqLpYaGqD1taaS9qsWGRphE9?= =?us-ascii?Q?6ubeObkxR4Y5LnLw2XHfmgei2IUiAHh8y1JhwbSDNUddrSSfUchVV5u4k/TH?= =?us-ascii?Q?yuwBF/Q3MYWw35scPHRLcTDDNNE/BHJg0nVHK9TJHfmwgYp5vkhDvvKvgefH?= =?us-ascii?Q?Uh5tCd5uLLelApALvWDyMO1X0B3+qHhutgFJs6ozmWxKfPu1qr/+aEQq7Qjk?= =?us-ascii?Q?YGBfxYoiNpMnLlErG3CJpZj8Bwae+3xEducW3GZ9VMOeVAYRNPzh6vLBu06D?= =?us-ascii?Q?nTSesieVpSIF0YPfmD4rTbulU9WVhy3Nd88Swv5qLOOImQ3bmOEteyY/Mv3i?= =?us-ascii?Q?vJ8Wq9suQLKv3sAXI+5LNy8Ms2RLnCrOiM0Vys+okiHGR3PtHW34NJatan89?= =?us-ascii?Q?H+XK0BjQbZT/rdhBHNTn1DE4zOoWjAIjemgAP5Bbgq3DRU16y5RGExK8meZg?= =?us-ascii?Q?AZ0dAsWG10h5L5bBOqpXlTtChOem2Kq00OnJc7cN?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 6:2P4PMfVKsgGcMCHvjzQnbHkMYqll107n+O13xFVEqUKKoxEgI8Qvh6UVtDqknRqzaET90kTOkJpp7SvEiiVcFsDo0K+G5kdYrTXG4zcO7S5HZ7Ub+fWVZK44wHTIMTe/LCnLCPyCEEhXYdnhwHsJAVsljh8uLKl0FTU5YvX+tAOIjtgE7+UVnAxuclINE1Dfr54JXwv5OK9FTuSGkyTkzk4ozoFaErstNt3Fq3Qk0JI2+2LazgZDiqJBaW9Gev2uAipnnsXo+wKeRzwUzkcr47KE8hMOuEjNQ7JLMur5AWSBR/JkEgnWnWUgVxDde6Ux; 5:sk+9jUENlFmod+U4/k5oq4iUg7Jgsco3hP6aljAk0QMLlLnOA8PXm/bzwE43dvKrQfuGGwWJVp17Tthu124x4JfnGfWgghGn1kHDsMpEgy4Fa9SheHJt1igbvkk+ONKRXqxVaCTtgpxztuzKOyNvGlbP+6Ly6HyXSrNJAMm/oHI=; 24:iEcSyNf8FWm1dm1U4BsbCFn7DiAeICTEcOeifps2jRpiWKj/kEA8EWK3/Aw29u6ZmBBuvLyv/vB2IgM9n16momH5uV2Nxh5XIBEM3rKpO5A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB836; 7:Ek8XgOgITgv4PXsJEBMQ+2mg7lkEk2wKzdQ3VD2EDmaBuZ+cHRhqg/95ZNFF7LyjHORFV2gJ4ea8Ocqbvtvb4VUxJ5AH8vpYVCOZLg6YsEIsNvev5Jv6bmEFAsDSLEchyCTm68SK/Lq9K3q4NGc8B03F+BTsInc+dK1UTBcwOImoW8t8QCKqDw7U+F5Uk6Y9exl6HFPMLBReiYHSu761P7GyXv1Ej/9Xj5hG8I5qdQzsZLkmC1enEehHuVxCFR2qU322X2P4D1UVZ+3ablkyQo8f0fFPIBX8LIS7gfTSTseqZZUlXNVZXVn8viPQqQYX+9ZV8Tlh0ioRFd+0z9tvxm7UfrjNvljkwIPb0ZN5l1k=; 20:QwFLw29IC2xUNWIouekqOwJyQqVuD8w9K2kdgasvQSBYgIWWcH1G1U9A17BY+t1XbEfSW9dN8oXc3WyD/9WCxrXi5velu1UPZQ56RBxCrrF7w2b99Oe1a7uQ0rFzbRl3L73bkz/dfuhn4P0mP42RrQ+azUXR9oZ24Pi/37Cn06I= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2016 23:48:27.2452 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB836 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 Use the fix up added by Jason to use the kernel version of pvrdma-abi.h if it exists. Signed-off-by: Adit Ranadive --- buildlib/RDMA_LinuxHeaders.cmake | 1 + buildlib/fixup-include/rdma-pvrdma-abi.h | 297 +++++++++++++++++++++++++++++++ providers/pvrdma/pvrdma-abi.h | 297 ------------------------------- providers/pvrdma/pvrdma.h | 2 +- 4 files changed, 299 insertions(+), 298 deletions(-) create mode 100644 buildlib/fixup-include/rdma-pvrdma-abi.h delete mode 100644 providers/pvrdma/pvrdma-abi.h diff --git a/buildlib/RDMA_LinuxHeaders.cmake b/buildlib/RDMA_LinuxHeaders.cmake index c67b0a6..4689cd1 100644 --- a/buildlib/RDMA_LinuxHeaders.cmake +++ b/buildlib/RDMA_LinuxHeaders.cmake @@ -83,3 +83,4 @@ rdma_check_kheader("rdma/ib_user_mad.h" "${DEFAULT_TEST}") rdma_check_kheader("rdma/rdma_netlink.h" "int main(int argc,const char *argv[]) { return RDMA_NL_IWPM_REMOTE_INFO && RDMA_NL_IWCM; }") rdma_check_kheader("rdma/rdma_user_cm.h" "${DEFAULT_TEST}") rdma_check_kheader("rdma/rdma_user_rxe.h" "${DEFAULT_TEST}") +rdma_check_kheader("rdma/pvrdma-abi.h" "${DEFAULT_TEST}") diff --git a/buildlib/fixup-include/rdma-pvrdma-abi.h b/buildlib/fixup-include/rdma-pvrdma-abi.h new file mode 100644 index 0000000..c7a38c5 --- /dev/null +++ b/buildlib/fixup-include/rdma-pvrdma-abi.h @@ -0,0 +1,297 @@ +/* + * 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. + */ + +#ifndef __PVRDMA_ABI_H__ +#define __PVRDMA_ABI_H__ + +#include + +#define PVRDMA_UVERBS_ABI_VERSION 3 +#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */ +#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell offset. */ +#define PVRDMA_UAR_QP_SEND BIT(30) /* Send bit. */ +#define PVRDMA_UAR_QP_RECV BIT(31) /* Recv bit. */ +#define PVRDMA_UAR_CQ_OFFSET 4 /* CQ doorbell offset. */ +#define PVRDMA_UAR_CQ_ARM_SOL BIT(29) /* Arm solicited bit. */ +#define PVRDMA_UAR_CQ_ARM BIT(30) /* Arm bit. */ +#define PVRDMA_UAR_CQ_POLL BIT(31) /* Poll bit. */ + +enum pvrdma_wr_opcode { + PVRDMA_WR_RDMA_WRITE, + PVRDMA_WR_RDMA_WRITE_WITH_IMM, + PVRDMA_WR_SEND, + PVRDMA_WR_SEND_WITH_IMM, + PVRDMA_WR_RDMA_READ, + PVRDMA_WR_ATOMIC_CMP_AND_SWP, + PVRDMA_WR_ATOMIC_FETCH_AND_ADD, + PVRDMA_WR_LSO, + PVRDMA_WR_SEND_WITH_INV, + PVRDMA_WR_RDMA_READ_WITH_INV, + PVRDMA_WR_LOCAL_INV, + PVRDMA_WR_FAST_REG_MR, + PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP, + PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD, + PVRDMA_WR_BIND_MW, + PVRDMA_WR_REG_SIG_MR, +}; + +enum pvrdma_wc_status { + PVRDMA_WC_SUCCESS, + PVRDMA_WC_LOC_LEN_ERR, + PVRDMA_WC_LOC_QP_OP_ERR, + PVRDMA_WC_LOC_EEC_OP_ERR, + PVRDMA_WC_LOC_PROT_ERR, + PVRDMA_WC_WR_FLUSH_ERR, + PVRDMA_WC_MW_BIND_ERR, + PVRDMA_WC_BAD_RESP_ERR, + PVRDMA_WC_LOC_ACCESS_ERR, + PVRDMA_WC_REM_INV_REQ_ERR, + PVRDMA_WC_REM_ACCESS_ERR, + PVRDMA_WC_REM_OP_ERR, + PVRDMA_WC_RETRY_EXC_ERR, + PVRDMA_WC_RNR_RETRY_EXC_ERR, + PVRDMA_WC_LOC_RDD_VIOL_ERR, + PVRDMA_WC_REM_INV_RD_REQ_ERR, + PVRDMA_WC_REM_ABORT_ERR, + PVRDMA_WC_INV_EECN_ERR, + PVRDMA_WC_INV_EEC_STATE_ERR, + PVRDMA_WC_FATAL_ERR, + PVRDMA_WC_RESP_TIMEOUT_ERR, + PVRDMA_WC_GENERAL_ERR, +}; + +enum pvrdma_wc_opcode { + PVRDMA_WC_SEND, + PVRDMA_WC_RDMA_WRITE, + PVRDMA_WC_RDMA_READ, + PVRDMA_WC_COMP_SWAP, + PVRDMA_WC_FETCH_ADD, + PVRDMA_WC_BIND_MW, + PVRDMA_WC_LSO, + PVRDMA_WC_LOCAL_INV, + PVRDMA_WC_FAST_REG_MR, + PVRDMA_WC_MASKED_COMP_SWAP, + PVRDMA_WC_MASKED_FETCH_ADD, + PVRDMA_WC_RECV = 1 << 7, + PVRDMA_WC_RECV_RDMA_WITH_IMM, +}; + +enum pvrdma_wc_flags { + PVRDMA_WC_GRH = 1 << 0, + PVRDMA_WC_WITH_IMM = 1 << 1, + PVRDMA_WC_WITH_INVALIDATE = 1 << 2, + PVRDMA_WC_IP_CSUM_OK = 1 << 3, + PVRDMA_WC_WITH_SMAC = 1 << 4, + PVRDMA_WC_WITH_VLAN = 1 << 5, + PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_VLAN, +}; + +struct pvrdma_alloc_ucontext_resp { + struct ibv_get_context_resp ibv_resp; + __u32 qp_tab_size; + __u32 reserved; +}; + +struct pvrdma_alloc_pd_resp { + struct ibv_alloc_pd_resp ibv_resp; + __u32 pdn; + __u32 reserved; +}; + +struct pvrdma_create_cq { + struct ibv_create_cq ibv_cmd; + __u64 buf_addr; + __u32 buf_size; + __u32 reserved; +}; + +struct pvrdma_create_cq_resp { + struct ibv_create_cq_resp ibv_resp; + __u32 cqn; + __u32 reserved; +}; + +struct pvrdma_resize_cq { + struct ibv_resize_cq ibv_cmd; + __u64 buf_addr; + __u32 buf_size; + __u32 reserved; +}; + +struct pvrdma_create_srq { + struct ibv_create_srq ibv_cmd; + __u64 buf_addr; +}; + +struct pvrdma_create_srq_resp { + struct ibv_create_srq_resp ibv_resp; + __u32 srqn; + __u32 reserved; +}; + +struct pvrdma_create_qp { + struct ibv_create_qp ibv_cmd; + __u64 rbuf_addr; + __u64 sbuf_addr; + __u32 rbuf_size; + __u32 sbuf_size; + __u64 qp_addr; +}; + +/* PVRDMA masked atomic compare and swap */ +struct pvrdma_ex_cmp_swap { + __u64 swap_val; + __u64 compare_val; + __u64 swap_mask; + __u64 compare_mask; +}; + +/* PVRDMA masked atomic fetch and add */ +struct pvrdma_ex_fetch_add { + __u64 add_val; + __u64 field_boundary; +}; + +/* PVRDMA address vector. */ +struct pvrdma_av { + __u32 port_pd; + __u32 sl_tclass_flowlabel; + __u8 dgid[16]; + __u8 src_path_bits; + __u8 gid_index; + __u8 stat_rate; + __u8 hop_limit; + __u8 dmac[6]; + __u8 reserved[6]; +}; + +/* PVRDMA scatter/gather entry */ +struct pvrdma_sge { + __u64 addr; + __u32 length; + __u32 lkey; +}; + +/* PVRDMA receive queue work request */ +struct pvrdma_rq_wqe_hdr { + __u64 wr_id; /* wr id */ + __u32 num_sge; /* size of s/g array */ + __u32 total_len; /* reserved */ +}; +/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */ + +/* PVRDMA send queue work request */ +struct pvrdma_sq_wqe_hdr { + __u64 wr_id; /* wr id */ + __u32 num_sge; /* size of s/g array */ + __u32 total_len; /* reserved */ + __u32 opcode; /* operation type */ + __u32 send_flags; /* wr flags */ + union { + __u32 imm_data; + __u32 invalidate_rkey; + } ex; + __u32 reserved; + union { + struct { + __u64 remote_addr; + __u32 rkey; + __u8 reserved[4]; + } rdma; + struct { + __u64 remote_addr; + __u64 compare_add; + __u64 swap; + __u32 rkey; + __u32 reserved; + } atomic; + struct { + __u64 remote_addr; + __u32 log_arg_sz; + __u32 rkey; + union { + struct pvrdma_ex_cmp_swap cmp_swap; + struct pvrdma_ex_fetch_add fetch_add; + } wr_data; + } masked_atomics; + struct { + __u64 iova_start; + __u64 pl_pdir_dma; + __u32 page_shift; + __u32 page_list_len; + __u32 length; + __u32 access_flags; + __u32 rkey; + } fast_reg; + struct { + __u32 remote_qpn; + __u32 remote_qkey; + struct pvrdma_av av; + } ud; + } wr; +}; +/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */ + +/* Completion queue element. */ +struct pvrdma_cqe { + __u64 wr_id; + __u64 qp; + __u32 opcode; + __u32 status; + __u32 byte_len; + __u32 imm_data; + __u32 src_qp; + __u32 wc_flags; + __u32 vendor_err; + __u16 pkey_index; + __u16 slid; + __u8 sl; + __u8 dlid_path_bits; + __u8 port_num; + __u8 smac[6]; + __u8 reserved2[7]; /* Pad to next power of 2 (64). */ +}; + +#endif /* __PVRDMA_ABI_H__ */ diff --git a/providers/pvrdma/pvrdma-abi.h b/providers/pvrdma/pvrdma-abi.h deleted file mode 100644 index c7a38c5..0000000 --- a/providers/pvrdma/pvrdma-abi.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * 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. - */ - -#ifndef __PVRDMA_ABI_H__ -#define __PVRDMA_ABI_H__ - -#include - -#define PVRDMA_UVERBS_ABI_VERSION 3 -#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */ -#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell offset. */ -#define PVRDMA_UAR_QP_SEND BIT(30) /* Send bit. */ -#define PVRDMA_UAR_QP_RECV BIT(31) /* Recv bit. */ -#define PVRDMA_UAR_CQ_OFFSET 4 /* CQ doorbell offset. */ -#define PVRDMA_UAR_CQ_ARM_SOL BIT(29) /* Arm solicited bit. */ -#define PVRDMA_UAR_CQ_ARM BIT(30) /* Arm bit. */ -#define PVRDMA_UAR_CQ_POLL BIT(31) /* Poll bit. */ - -enum pvrdma_wr_opcode { - PVRDMA_WR_RDMA_WRITE, - PVRDMA_WR_RDMA_WRITE_WITH_IMM, - PVRDMA_WR_SEND, - PVRDMA_WR_SEND_WITH_IMM, - PVRDMA_WR_RDMA_READ, - PVRDMA_WR_ATOMIC_CMP_AND_SWP, - PVRDMA_WR_ATOMIC_FETCH_AND_ADD, - PVRDMA_WR_LSO, - PVRDMA_WR_SEND_WITH_INV, - PVRDMA_WR_RDMA_READ_WITH_INV, - PVRDMA_WR_LOCAL_INV, - PVRDMA_WR_FAST_REG_MR, - PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP, - PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD, - PVRDMA_WR_BIND_MW, - PVRDMA_WR_REG_SIG_MR, -}; - -enum pvrdma_wc_status { - PVRDMA_WC_SUCCESS, - PVRDMA_WC_LOC_LEN_ERR, - PVRDMA_WC_LOC_QP_OP_ERR, - PVRDMA_WC_LOC_EEC_OP_ERR, - PVRDMA_WC_LOC_PROT_ERR, - PVRDMA_WC_WR_FLUSH_ERR, - PVRDMA_WC_MW_BIND_ERR, - PVRDMA_WC_BAD_RESP_ERR, - PVRDMA_WC_LOC_ACCESS_ERR, - PVRDMA_WC_REM_INV_REQ_ERR, - PVRDMA_WC_REM_ACCESS_ERR, - PVRDMA_WC_REM_OP_ERR, - PVRDMA_WC_RETRY_EXC_ERR, - PVRDMA_WC_RNR_RETRY_EXC_ERR, - PVRDMA_WC_LOC_RDD_VIOL_ERR, - PVRDMA_WC_REM_INV_RD_REQ_ERR, - PVRDMA_WC_REM_ABORT_ERR, - PVRDMA_WC_INV_EECN_ERR, - PVRDMA_WC_INV_EEC_STATE_ERR, - PVRDMA_WC_FATAL_ERR, - PVRDMA_WC_RESP_TIMEOUT_ERR, - PVRDMA_WC_GENERAL_ERR, -}; - -enum pvrdma_wc_opcode { - PVRDMA_WC_SEND, - PVRDMA_WC_RDMA_WRITE, - PVRDMA_WC_RDMA_READ, - PVRDMA_WC_COMP_SWAP, - PVRDMA_WC_FETCH_ADD, - PVRDMA_WC_BIND_MW, - PVRDMA_WC_LSO, - PVRDMA_WC_LOCAL_INV, - PVRDMA_WC_FAST_REG_MR, - PVRDMA_WC_MASKED_COMP_SWAP, - PVRDMA_WC_MASKED_FETCH_ADD, - PVRDMA_WC_RECV = 1 << 7, - PVRDMA_WC_RECV_RDMA_WITH_IMM, -}; - -enum pvrdma_wc_flags { - PVRDMA_WC_GRH = 1 << 0, - PVRDMA_WC_WITH_IMM = 1 << 1, - PVRDMA_WC_WITH_INVALIDATE = 1 << 2, - PVRDMA_WC_IP_CSUM_OK = 1 << 3, - PVRDMA_WC_WITH_SMAC = 1 << 4, - PVRDMA_WC_WITH_VLAN = 1 << 5, - PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_VLAN, -}; - -struct pvrdma_alloc_ucontext_resp { - struct ibv_get_context_resp ibv_resp; - __u32 qp_tab_size; - __u32 reserved; -}; - -struct pvrdma_alloc_pd_resp { - struct ibv_alloc_pd_resp ibv_resp; - __u32 pdn; - __u32 reserved; -}; - -struct pvrdma_create_cq { - struct ibv_create_cq ibv_cmd; - __u64 buf_addr; - __u32 buf_size; - __u32 reserved; -}; - -struct pvrdma_create_cq_resp { - struct ibv_create_cq_resp ibv_resp; - __u32 cqn; - __u32 reserved; -}; - -struct pvrdma_resize_cq { - struct ibv_resize_cq ibv_cmd; - __u64 buf_addr; - __u32 buf_size; - __u32 reserved; -}; - -struct pvrdma_create_srq { - struct ibv_create_srq ibv_cmd; - __u64 buf_addr; -}; - -struct pvrdma_create_srq_resp { - struct ibv_create_srq_resp ibv_resp; - __u32 srqn; - __u32 reserved; -}; - -struct pvrdma_create_qp { - struct ibv_create_qp ibv_cmd; - __u64 rbuf_addr; - __u64 sbuf_addr; - __u32 rbuf_size; - __u32 sbuf_size; - __u64 qp_addr; -}; - -/* PVRDMA masked atomic compare and swap */ -struct pvrdma_ex_cmp_swap { - __u64 swap_val; - __u64 compare_val; - __u64 swap_mask; - __u64 compare_mask; -}; - -/* PVRDMA masked atomic fetch and add */ -struct pvrdma_ex_fetch_add { - __u64 add_val; - __u64 field_boundary; -}; - -/* PVRDMA address vector. */ -struct pvrdma_av { - __u32 port_pd; - __u32 sl_tclass_flowlabel; - __u8 dgid[16]; - __u8 src_path_bits; - __u8 gid_index; - __u8 stat_rate; - __u8 hop_limit; - __u8 dmac[6]; - __u8 reserved[6]; -}; - -/* PVRDMA scatter/gather entry */ -struct pvrdma_sge { - __u64 addr; - __u32 length; - __u32 lkey; -}; - -/* PVRDMA receive queue work request */ -struct pvrdma_rq_wqe_hdr { - __u64 wr_id; /* wr id */ - __u32 num_sge; /* size of s/g array */ - __u32 total_len; /* reserved */ -}; -/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */ - -/* PVRDMA send queue work request */ -struct pvrdma_sq_wqe_hdr { - __u64 wr_id; /* wr id */ - __u32 num_sge; /* size of s/g array */ - __u32 total_len; /* reserved */ - __u32 opcode; /* operation type */ - __u32 send_flags; /* wr flags */ - union { - __u32 imm_data; - __u32 invalidate_rkey; - } ex; - __u32 reserved; - union { - struct { - __u64 remote_addr; - __u32 rkey; - __u8 reserved[4]; - } rdma; - struct { - __u64 remote_addr; - __u64 compare_add; - __u64 swap; - __u32 rkey; - __u32 reserved; - } atomic; - struct { - __u64 remote_addr; - __u32 log_arg_sz; - __u32 rkey; - union { - struct pvrdma_ex_cmp_swap cmp_swap; - struct pvrdma_ex_fetch_add fetch_add; - } wr_data; - } masked_atomics; - struct { - __u64 iova_start; - __u64 pl_pdir_dma; - __u32 page_shift; - __u32 page_list_len; - __u32 length; - __u32 access_flags; - __u32 rkey; - } fast_reg; - struct { - __u32 remote_qpn; - __u32 remote_qkey; - struct pvrdma_av av; - } ud; - } wr; -}; -/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */ - -/* Completion queue element. */ -struct pvrdma_cqe { - __u64 wr_id; - __u64 qp; - __u32 opcode; - __u32 status; - __u32 byte_len; - __u32 imm_data; - __u32 src_qp; - __u32 wc_flags; - __u32 vendor_err; - __u16 pkey_index; - __u16 slid; - __u8 sl; - __u8 dlid_path_bits; - __u8 port_num; - __u8 smac[6]; - __u8 reserved2[7]; /* Pad to next power of 2 (64). */ -}; - -#endif /* __PVRDMA_ABI_H__ */ diff --git a/providers/pvrdma/pvrdma.h b/providers/pvrdma/pvrdma.h index d3df07d..703cb5f 100644 --- a/providers/pvrdma/pvrdma.h +++ b/providers/pvrdma/pvrdma.h @@ -55,10 +55,10 @@ #include #include #include +#include #define BIT(nr) (1UL << (nr)) -#include "pvrdma-abi.h" #include "pvrdma_ring.h" #ifndef rmb