From patchwork Tue Nov 8 23:06: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: 9418233 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 120AC60585 for ; Tue, 8 Nov 2016 23:10:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 041E728B33 for ; Tue, 8 Nov 2016 23:10:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB4FC28BAC; Tue, 8 Nov 2016 23:10:33 +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 CFE7B28B33 for ; Tue, 8 Nov 2016 23:10:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbcKHXKb (ORCPT ); Tue, 8 Nov 2016 18:10:31 -0500 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:33167 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346AbcKHXKa (ORCPT ); Tue, 8 Nov 2016 18:10:30 -0500 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 8 Nov 2016 15:10:16 -0800 Received: from EX13-CAS-005.vmware.com (smtp-inbound.vmware.com [10.113.191.55]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id CC47740A08 for ; Tue, 8 Nov 2016 15:10:28 -0800 (PST) Received: from EX13-MBX-038.vmware.com (10.113.191.189) by EX13-MBX-000.vmware.com (10.113.191.20) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 8 Nov 2016 15:10:19 -0800 Received: from EX13-CAS-001.vmware.com (10.113.191.51) by EX13-MBX-038.vmware.com (10.113.191.189) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 8 Nov 2016 15:10:18 -0800 Received: from NAM01-BN3-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; Tue, 8 Nov 2016 15:10:18 -0800 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=80G3N1YzuwFGUo/U5N0uUCteJANWg6a4tWUgwNJDk0Q=; b=UJUYVZ8bm3rw4vTW4qUcxp3trpVs0PyCnph0F/+ElncQNvDBg3Q/GkWa3vpKy8cpm24WkDwz5aZPHfLli9IeaopPyVUNGLJ1TYHle59H/+tjmaExYmesDj5CsRcJnvyr06AzHV5yjSaVNqj+9Ag0cGz6MHhPJM8jG7Oz1N3+KVA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; Received: from gandalf.eng.vmware.com (208.91.1.34) by SN2PR0501MB845.namprd05.prod.outlook.com (10.160.14.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.1; Tue, 8 Nov 2016 23:10:15 +0000 From: Adit Ranadive To: CC: Adit Ranadive Subject: [PATCH] libpvrdma: Fix up for ABI file Date: Tue, 8 Nov 2016 15:06:18 -0800 Message-ID: <1478646378-21775-1-git-send-email-aditr@vmware.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: HE1PR0701CA0058.eurprd07.prod.outlook.com (10.168.191.26) To SN2PR0501MB845.namprd05.prod.outlook.com (10.160.14.143) X-MS-Office365-Filtering-Correlation-Id: ea7cbd9f-49f1-4995-facf-08d4082c66dd X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB845; 2:BXlNNS3VLuPgxn7Ul3yJ+Zz8EMLNh6zz+LrmqEhi9Bkn9Wgdw57nc85A/us6LjypWMXKgkWWvqrQICh0CiGPYBmm9J3W0dvMu8JrLI8gxMxY/mSjvMcHulpoHRG8NL7BUyGRUIoxwpsaiqYYR0SYUa3Ox9TyORsjW8DRO7R7GG7fv05qReFqA/PXDqCsPKrAgsYX98vCg7jjhQ/Zhx1wLw==; 3:+W7Tuid7YZ6tN0WOZjULNaun0K3icDTaq5zQUIbuQuWttXSJ2fW0qbiFyCRjAcXW1pwlkbxvvrulFffYGfZIo0ovemt5ZQmhoYBRrGBFQc0YTu7a1fT9nJYX7WtPm/OmvEnjeKRPGxrTc79XDBNUwQ==; 25:OCd0sMigRIjWLyyCy5laKUxOIBKSx5t0jVTcibCpa4H+uPo6qo+yHLgP/kZk9NgmZqxcZNPhof/b6oDBqJujwKSjmdSMC+s4MDH2uS5Cr02Angzpn/5LYtXt4Z1HXJcI0TZxEz8vi4VKVQ8g8uqqIyy0LK3SFrWNsQXZi5363PbW/5PU9LqtvheqPlvTfJ5UvJf1M9f35ea3T92oAwDq7BMFAit2asL4tIRpl+j8HBx2ls9oJNk0r2IyWE6lPqz5alsgHe1bGO+gZ0KqoT3xxiylmyqDfuaYEOffg6cOu/+nqV50tXkop/F4k8ATpBcBTjfp7bBi2dyNk57cZ8+geb3xONE1/aanGpPm0A0Ob6RtMBsQ1NK5nI8t0hnqUtX1yeL95UqlY0DxMcBghkYLW5jThTIgPAxVKr4K4DCnoKIwL3Us16e2dSGquxH25OTj X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR0501MB845; X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB845; 31:TB0n2ysSyqRXVtm8jAClMA/wAul9XsyTmadAOju29kgitkJAdX7+NW0kQ9TdK8o1i6B9wPOdBy4w4x05tIskPFJfGDNYEFEHNQOpd2H7ktQU4Q/r+ykW7SY/tWc34g+GNMxjN2C7FZtlVtCKDwWM/t9v3EXNp/JE4MFAWHYjSflfXLRrHpqtGALluBi/2TZDLzkXbrbx4X2PTjf4c5J2cQJ2s6SVHUqI4eiXipw+9M/nIWJiH0M0AvLyKCNb75EW; 20:VDb3t1esVQ9XXRG4q+e6dx/0WMQBZRQ4/uPTzfAeCKO+ljtZGPH9GH/X8Xa2pmPMppxIUwABWSrZS41ntXaFMjGltHqufhLf0gG4uq8C1IK10vSSPytAKXJ8aNUm9MWkfhdMl1/XhPMcvqt7pjKR0MShXAYDktj7EzgLNlNPO8Auu69Qd+dUyLlZJJ+IgWOURyG9kKUyQ9XdbzrlJBDCbzsF5y20rCkhe/gJi4lxJur8aXpt/6qqmlQL1EtJMlJGl1Qa4QQa84Da1e7qveYhjGmLTn7RzfDSgcRv7Y2fgfzkWHRBGK1GDk3XO/5LWNsiFzN105WSWrQbUIl3kRmsP7SvJGbjYAhQoZLOkYWMtdA8pJVnEy1asuFsq8Ekhk86xsVtZuBitCu9TfezdVP2Rpu9zMEhAzyoDpYODYkpMaH37qMUjnr79MGZNuLFzP7OOdN7aJDjk+q3x/M/G1eEXW6XoCaIQr0kCgjX6UsjwgWFMpHTu/fC1De8bD52mtY+ 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)(10201501046)(3002001); SRVR:SN2PR0501MB845; BCL:0; PCL:0; RULEID:; SRVR:SN2PR0501MB845; X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB845; 4:AvQh56jbEssO8lZvYpo/ZCksyniTvCuT+1Do/hUNqEiZyBagfmuG8qEIbAa4E6HXAjsiYO2++Wqq//xaAfRVdIt/kPMYkc0ZE6pyTov+zg8Ldh9s4shIheGNKUjLwZmTAgf69Mjh/O7KRTHdOHGk51azBTeMHho4K4mqtcyKP1y3Zx81ZlJC6h8w5rMGOBF9TZavcUOeQm0qjBujzRI6BfF84OQD7EtObJ4v1VAEkZokLLZt3lfd24fwnaGcNSzO8vkD4N6O3Ne+UfhZo4BI/p38Iz1ESWELPOoJhkSls/xfGX+h9f783b//q5d8hZwJRw7jnRQYwMvueZbRd3tmMLjNSPS4HwdUxfQJKZTYtWS2eSr3BEMIxHpVIvQOIXryxR4oG2vcbMuNXWIdxxqsb/Sk434cGq4UfbG6Txr4NaN1HXTXR8x1qX7tIIxjWWQLAu/8UwoCV8T2q1TTIQd03T7pSPR6csZXYHrC+VRftGev7JftNstM8u8FcUbbnPqeMgbtP32+Jrmo7E9K26t3nQ== X-Forefront-PRVS: 01208B1E18 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(92566002)(5003940100001)(101416001)(42186005)(575784001)(229853001)(47776003)(36756003)(7736002)(2351001)(66066001)(110136003)(77096005)(50466002)(50986999)(6916009)(106356001)(48376002)(5660300001)(97736004)(81156014)(33646002)(107886002)(105586002)(4326007)(81166006)(7846002)(4001430100002)(586003)(86362001)(6116002)(8676002)(50226002)(68736007)(450100001)(189998001)(3846002)(2906002)(305945005)(7099028)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR0501MB845; 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; SN2PR0501MB845; 23:oKM8cufd86udT2OD/ZFIh/V9UJmuer7zphg2tjic?= =?us-ascii?Q?DChmHl+WaqenVW5dJ2KZgjkfbYFHDipCyZcUV2yRrl3/DONcqu6Q0CwnpCjw?= =?us-ascii?Q?TUHOuXlDfe4AYif0fOKcGncudmBQlMCequbcQtycWCbk6BIQdPQy+obgUgva?= =?us-ascii?Q?okJQKpFWkDb0IZ+XwNYYnFKMzUUjnfHDtJJK1hKSiVFGzq0i5z3BZuU9GgsX?= =?us-ascii?Q?telg/FVvQr0YCNgWOT3WtzH+lWT+JizwBs04sLP1d3GTwtOnMMYgzlYEVw5R?= =?us-ascii?Q?6hKi385GShI7iIQ10YatyLdO8759AtFcAsyNNRvHVi8hXaH0YLdtz23gCAPA?= =?us-ascii?Q?n98x+UNkJjqBa+uHSBfejwhWRjM9yL28FvAMRRPyOUG4QxnExPRupGefygFV?= =?us-ascii?Q?JcyzVh5Jn0hDlwSIdkZOv30hJm5KoMSRTEKlzIQmGVvFilV+9co5TvKiIZkY?= =?us-ascii?Q?4YYCCp2DlnNl2959Zhh8VJ292kNj/giAgozf7UI533wxRz8GWwm4GDK8n+E6?= =?us-ascii?Q?zgqo02eNm5ONVyTf7XAc5Y3JUr0bzuxBmZHOygCP8nM1+9RCHeZhBc8GB9uw?= =?us-ascii?Q?i9BAYndfb6h4j0g+xs3fdqmNvaC4w/ohnKPZ3Jzp9v2ZV7DA2sWHTgLrepZd?= =?us-ascii?Q?BdVsMXPRojY7nKqsnXi9k6I1HSaR15VeDLDxuFLAVmiPLCxzW4mO38cNXo+J?= =?us-ascii?Q?gwkewjAmN4wyHOBmDSZ9ZkEO62Ek4KlnJIzVG4ep6TiKozoyMKRQI6xVhuHG?= =?us-ascii?Q?JZGwWUOjt061gy8HiWV5vctu1Tebr+XhkiXGZtPqnLYUlfFI0b5kczeEj8Mf?= =?us-ascii?Q?+knofVipF0LloFTPZWLFsZKBY/rWNiGa5ytjuTJHPSF9H6pEQQkmw82IshQ2?= =?us-ascii?Q?dVt6mCmThNka+O9qEIi0jnkwtVd25KJcekE1U1REtGGB4LdAoWYUgxU4Xeed?= =?us-ascii?Q?539kOlekpzNPFRC1l/HYJJyoJDLro2f2Ou7lxK5Bw/pMYytcz08SPJ7FLFGo?= =?us-ascii?Q?KsfbgDkm3MRjCIMcX1YzQ93PhVYt2tMXyt5oZpMn6/KxuqC1yNwQVQ8Xzc2J?= =?us-ascii?Q?NJI7gtXIJlpYbFX3B9Bd3rIbpdQQAVkfwsj0awukpNQT2Va65xxkpBVAKiSL?= =?us-ascii?Q?CObwi++CsyU=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB845; 6:yNr8qfHweUnOABA3lLerGB7w+FP0CyEMyaxGWRCHmFke9xH7LSryhE41sapr0nGgH28JjySnPKizFtYYDakVd0qGefXF2hb49QXxQtMhLEZlpHmuLNxE5Fa3OH4XHYT6LaXt8C0zgNfFFLvnf8k/Q16k0sihduSYzFP1lgS9QzeLq8UiwnsvCaG3JQ1Dprwzm8l8yUWfj8OgAWw9jc3EdApLOgyYjRc1Xv03yHZ2/YJKeG/p8Q+cik4Mgci1I8iBdx+kUeW23B+XJd4N9mPM5uR44N6nPJitXragbZR5KjnPesmsKmVyp8TTir7eZMqt; 5:2tS+1uYj5g9klu9jdTQQ65hAFwDVzXw06z3ZZ2sDzIPlaFC/uUrzGgCkG+B74Fh6kjRowrqBuXpPgCnKL4r0kQM0HCTr3vcfk3MaU3M/3n/98hpncQagIVjFp1UuH7PSU8wRguFzsPaDo9XUtRwSWkT/0J32y0rsel3I+Ogs4uw=; 24:w1bomJepUY8L0wXpmp6lnyew6ADC3iSPqCzCAYbVvB9VKMv59MGuOxzxspDmOlcbu3eSm/fp46YhG6JRl9I6J8nkKoJmi7rg9AUYiDOyp0U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR0501MB845; 7:f3qsORaxDfdEDnDZtNJB4ZTBz9CktzRotl2IMq9JRYV0kk8DxNe4J0K8kYhDklJPDONdlMtifcZqe+3dNX9ipKcw9YIlk5oW6Y7I2MIvJtz6w+2NHnwgoJ4jCspJT9bWE4WwPIqSI/EU2CnrHKWFQGvFfHC20rCNeyUoezTbOEKKl9QnXuDOjRZyevIlnquG52j/7BN0YorN3okbtjVkI4ADY55O74dL93wn5En8j5JRMc8NIXeIrHZeSpulXw94pJEJFFEGAIsbmUmstV3+MGCzt7zgR1E5WS5h9jPavMjcuctH0sBJQ7do62DNBnxPORlfzIFmm5nImMVnejCI4zMfcg+6E3UK5/ElXEWQwJ4=; 20:sHczGZ8ZJhFrKIFMJ7l7rNP1qDXg55VoLyZr51p6RjaHpceUlhoeGTdL2I+jAz1u7ROJ8pSR8cZ59W6uVATBUtq48XKTPdeUKr8ExGhbz6ZT60jahelKHfe2Lu57DROFU3Am6lknaTSIw0z1E/f+0I9ibF4t7hdAQ93dQa9eW/k= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2016 23:10:15.0408 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR0501MB845 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 Reverted the ABI file to the kernel version. I added a new file that includes this ABI file and duplicates only the required structures for the library. This should be temporary until the UAPI is fixed properly within libibverbs and the kernel. Signed-off-by: Adit Ranadive --- buildlib/fixup-include/rdma-pvrdma-abi.h | 56 ++++++++++------------- providers/pvrdma/cq.c | 10 ++--- providers/pvrdma/pvrdma-abi-fix.h | 76 ++++++++++++++++++++++++++++++++ providers/pvrdma/pvrdma.h | 2 +- providers/pvrdma/pvrdma_main.c | 4 +- providers/pvrdma/qp.c | 12 ++--- providers/pvrdma/verbs.c | 4 +- 7 files changed, 116 insertions(+), 48 deletions(-) create mode 100644 providers/pvrdma/pvrdma-abi-fix.h diff --git a/buildlib/fixup-include/rdma-pvrdma-abi.h b/buildlib/fixup-include/rdma-pvrdma-abi.h index c7a38c5..5ca0e91 100644 --- a/buildlib/fixup-include/rdma-pvrdma-abi.h +++ b/buildlib/fixup-include/rdma-pvrdma-abi.h @@ -46,14 +46,14 @@ #ifndef __PVRDMA_ABI_H__ #define __PVRDMA_ABI_H__ -#include +#include -#define PVRDMA_UVERBS_ABI_VERSION 3 +#define PVRDMA_UVERBS_ABI_VERSION 3 /* ABI Version. */ #define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */ -#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell offset. */ +#define PVRDMA_UAR_QP_OFFSET 0 /* QP doorbell. */ #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_OFFSET 4 /* CQ doorbell. */ #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. */ @@ -129,55 +129,47 @@ enum pvrdma_wc_flags { }; struct pvrdma_alloc_ucontext_resp { - struct ibv_get_context_resp ibv_resp; - __u32 qp_tab_size; - __u32 reserved; + __u32 qp_tab_size; + __u32 reserved; }; struct pvrdma_alloc_pd_resp { - struct ibv_alloc_pd_resp ibv_resp; - __u32 pdn; - __u32 reserved; + __u32 pdn; + __u32 reserved; }; struct pvrdma_create_cq { - struct ibv_create_cq ibv_cmd; - __u64 buf_addr; - __u32 buf_size; - __u32 reserved; + __u64 buf_addr; + __u32 buf_size; + __u32 reserved; }; struct pvrdma_create_cq_resp { - struct ibv_create_cq_resp ibv_resp; - __u32 cqn; - __u32 reserved; + __u32 cqn; + __u32 reserved; }; struct pvrdma_resize_cq { - struct ibv_resize_cq ibv_cmd; - __u64 buf_addr; - __u32 buf_size; - __u32 reserved; + __u64 buf_addr; + __u32 buf_size; + __u32 reserved; }; struct pvrdma_create_srq { - struct ibv_create_srq ibv_cmd; - __u64 buf_addr; + __u64 buf_addr; }; struct pvrdma_create_srq_resp { - struct ibv_create_srq_resp ibv_resp; - __u32 srqn; - __u32 reserved; + __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; + __u64 rbuf_addr; + __u64 sbuf_addr; + __u32 rbuf_size; + __u32 sbuf_size; + __u64 qp_addr; }; /* PVRDMA masked atomic compare and swap */ diff --git a/providers/pvrdma/cq.c b/providers/pvrdma/cq.c index bb4d1f7..0c7dcf6 100644 --- a/providers/pvrdma/cq.c +++ b/providers/pvrdma/cq.c @@ -214,8 +214,8 @@ struct ibv_cq *pvrdma_create_cq(struct ibv_context *context, int cqe, int comp_vector) { struct pvrdma_device *dev = to_vdev(context->device); - struct pvrdma_create_cq cmd; - struct pvrdma_create_cq_resp resp; + struct user_pvrdma_create_cq cmd; + struct user_pvrdma_create_cq_resp resp; struct pvrdma_cq *cq; int ret; @@ -239,15 +239,15 @@ struct ibv_cq *pvrdma_create_cq(struct ibv_context *context, int cqe, cq->ring_state = cq->buf.buf; - cmd.buf_addr = (uintptr_t) cq->buf.buf; - cmd.buf_size = cq->buf.length; + cmd.udata.buf_addr = (uintptr_t) cq->buf.buf; + cmd.udata.buf_size = cq->buf.length; ret = ibv_cmd_create_cq(context, cqe, channel, comp_vector, &cq->ibv_cq, &cmd.ibv_cmd, sizeof(cmd), &resp.ibv_resp, sizeof(resp)); if (ret) goto err_buf; - cq->cqn = resp.cqn; + cq->cqn = resp.udata.cqn; cq->cqe_cnt = cq->ibv_cq.cqe; return &cq->ibv_cq; diff --git a/providers/pvrdma/pvrdma-abi-fix.h b/providers/pvrdma/pvrdma-abi-fix.h new file mode 100644 index 0000000..3d49aca --- /dev/null +++ b/providers/pvrdma/pvrdma-abi-fix.h @@ -0,0 +1,76 @@ +/* + * 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_FIX_H__ +#define __PVRDMA_ABI_FIX_H__ + +#include + +struct user_pvrdma_alloc_ucontext_resp { + struct ibv_get_context_resp ibv_resp; + struct pvrdma_alloc_ucontext_resp udata; +}; + +struct user_pvrdma_alloc_pd_resp { + struct ibv_alloc_pd_resp ibv_resp; + struct pvrdma_alloc_pd_resp udata; +}; + +struct user_pvrdma_create_cq { + struct ibv_create_cq ibv_cmd; + struct pvrdma_create_cq udata; +}; + +struct user_pvrdma_create_cq_resp { + struct ibv_create_cq_resp ibv_resp; + struct pvrdma_create_cq_resp udata; +}; + +struct user_pvrdma_create_qp { + struct ibv_create_qp ibv_cmd; + struct pvrdma_create_qp udata; +}; + +#endif /* __PVRDMA_ABI_FIX_H__ */ diff --git a/providers/pvrdma/pvrdma.h b/providers/pvrdma/pvrdma.h index 1c9f9f7..29c9991 100644 --- a/providers/pvrdma/pvrdma.h +++ b/providers/pvrdma/pvrdma.h @@ -55,11 +55,11 @@ #include #include #include -#include #include #define BIT(nr) (1UL << (nr)) +#include "pvrdma-abi-fix.h" #include "pvrdma_ring.h" #ifndef likely diff --git a/providers/pvrdma/pvrdma_main.c b/providers/pvrdma/pvrdma_main.c index 909cf1e..9a7e07b 100644 --- a/providers/pvrdma/pvrdma_main.c +++ b/providers/pvrdma/pvrdma_main.c @@ -97,14 +97,14 @@ static int pvrdma_init_context_shared(struct pvrdma_context *context, int cmd_fd) { struct ibv_get_context cmd; - struct pvrdma_alloc_ucontext_resp resp; + struct user_pvrdma_alloc_ucontext_resp resp; context->ibv_ctx.cmd_fd = cmd_fd; if (ibv_cmd_get_context(&context->ibv_ctx, &cmd, sizeof(cmd), &resp.ibv_resp, sizeof(resp))) return errno; - context->qp_tbl = calloc(resp.qp_tab_size & 0xFFFF, + context->qp_tbl = calloc(resp.udata.qp_tab_size & 0xFFFF, sizeof(struct pvrdma_qp *)); if (!context->qp_tbl) return -ENOMEM; diff --git a/providers/pvrdma/qp.c b/providers/pvrdma/qp.c index 8a37b7f..8b7c5a7 100644 --- a/providers/pvrdma/qp.c +++ b/providers/pvrdma/qp.c @@ -100,7 +100,7 @@ struct ibv_qp *pvrdma_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr) { struct pvrdma_device *dev = to_vdev(pd->context->device); - struct pvrdma_create_qp cmd; + struct user_pvrdma_create_qp cmd; struct ibv_create_qp_resp resp; struct pvrdma_qp *qp; int ret; @@ -152,11 +152,11 @@ struct ibv_qp *pvrdma_create_qp(struct ibv_pd *pd, goto err_free; memset(&cmd, 0, sizeof(cmd)); - cmd.rbuf_addr = (uintptr_t)qp->rbuf.buf; - cmd.rbuf_size = qp->rbuf.length; - cmd.sbuf_addr = (uintptr_t)qp->sbuf.buf; - cmd.sbuf_size = qp->sbuf.length; - cmd.qp_addr = (uintptr_t) qp; + cmd.udata.rbuf_addr = (uintptr_t)qp->rbuf.buf; + cmd.udata.rbuf_size = qp->rbuf.length; + cmd.udata.sbuf_addr = (uintptr_t)qp->sbuf.buf; + cmd.udata.sbuf_size = qp->sbuf.length; + cmd.udata.qp_addr = (uintptr_t) qp; ret = ibv_cmd_create_qp(pd, &qp->ibv_qp, attr, &cmd.ibv_cmd, sizeof(cmd), diff --git a/providers/pvrdma/verbs.c b/providers/pvrdma/verbs.c index f20ea6c..7dc9c83 100644 --- a/providers/pvrdma/verbs.c +++ b/providers/pvrdma/verbs.c @@ -79,7 +79,7 @@ int pvrdma_query_port(struct ibv_context *context, uint8_t port, struct ibv_pd *pvrdma_alloc_pd(struct ibv_context *context) { struct ibv_alloc_pd cmd; - struct pvrdma_alloc_pd_resp resp; + struct user_pvrdma_alloc_pd_resp resp; struct pvrdma_pd *pd; pd = malloc(sizeof(*pd)); @@ -92,7 +92,7 @@ struct ibv_pd *pvrdma_alloc_pd(struct ibv_context *context) return NULL; } - pd->pdn = resp.pdn; + pd->pdn = resp.udata.pdn; return &pd->ibv_pd; }