From patchwork Sat Jan 26 05:09:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 10782319 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CE971823 for ; Sat, 26 Jan 2019 05:09:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 170F130183 for ; Sat, 26 Jan 2019 05:09:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B1693018C; Sat, 26 Jan 2019 05:09:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 764E930183 for ; Sat, 26 Jan 2019 05:09:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725838AbfAZFJq (ORCPT ); Sat, 26 Jan 2019 00:09:46 -0500 Received: from mail-eopbgr690047.outbound.protection.outlook.com ([40.107.69.47]:55201 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725562AbfAZFJq (ORCPT ); Sat, 26 Jan 2019 00:09:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rS0mYXLg7EdKqGngbnn8XqzWekWMt0OT2gY2+hqxmNI=; b=NYJarvf5Dbo4f23Yej+4t3X575kSGJ9HhD2bN/0ihCjwKXqO/zYwGAVCIYD8lqbzAx1fjjon3LMN2U6Rln/wo3R4XCEO+jzZIS1G7AC7sliUaxmcAG3IGBUuYrIrlrY5S3LKMWjNf1M168601uIS0R9mBY75WhTeyL1kSFZMafk= Received: from MWHPR05MB3648.namprd05.prod.outlook.com (10.174.251.22) by MWHPR05MB3261.namprd05.prod.outlook.com (10.173.230.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.9; Sat, 26 Jan 2019 05:09:36 +0000 Received: from MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::dd16:7c9c:a228:7c20]) by MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::dd16:7c9c:a228:7c20%2]) with mapi id 15.20.1580.008; Sat, 26 Jan 2019 05:09:36 +0000 From: Adit Ranadive To: "jgg@mellanox.com" , "dledford@redhat.com" CC: Adit Ranadive , "linux-rdma@vger.kernel.org" , Pv-drivers Subject: [PATCH for-next] RDMA/vmw_pvrdma: Support upto 64-bit PFNs Thread-Topic: [PATCH for-next] RDMA/vmw_pvrdma: Support upto 64-bit PFNs Thread-Index: AQHUtTVVdoloSz5WUEudeZZdAiAf4Q== Date: Sat, 26 Jan 2019 05:09:36 +0000 Message-ID: <1548479367-18648-1-git-send-email-aditr@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR04CA0008.namprd04.prod.outlook.com (2603:10b6:a03:40::21) To MWHPR05MB3648.namprd05.prod.outlook.com (2603:10b6:301:46::22) x-mailer: git-send-email 1.8.3.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [66.170.99.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR05MB3261;20:3EZVxz9I9LyP44PchiGKC0CG63yyIqUNtzSv2H+PBIVu9iXhB9CVyXhAg7ZdH2WNr2ABC8R+ayKwjjuBBimZ6wpy617NbqVNyYQ9SMRt1J6ejnygmRMnjNd+WxWp8yq4skGtle+b/u6QcsVFxewFtkU0eSm9DEApV3V6DPp3DDk= x-ms-office365-filtering-correlation-id: 8e95ecb7-2485-4354-ce38-08d6834c775d x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:MWHPR05MB3261; x-ms-traffictypediagnostic: MWHPR05MB3261: x-ld-processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0929F1BAED x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39860400002)(366004)(346002)(136003)(396003)(189003)(199004)(6506007)(52116002)(99286004)(86362001)(2501003)(256004)(14444005)(26005)(81156014)(3846002)(6116002)(8936002)(102836004)(186003)(8676002)(2906002)(105586002)(4326008)(50226002)(68736007)(36756003)(2616005)(106356001)(97736004)(386003)(81166006)(4720700003)(25786009)(107886003)(476003)(316002)(110136005)(478600001)(54906003)(6486002)(14454004)(7736002)(6512007)(486006)(66066001)(71200400001)(71190400001)(53936002)(6436002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR05MB3261;H:MWHPR05MB3648.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: f+ZQT1nNr2E8v5w+15gWnVLg3WpDdLHm8sUQEG3GhjwNWiXf/5Qaq48ddIC6JpvdIREJJ96Rp+U+25hMRSe6AOJDgF9lM7Sa+RxH2mgdAauPfC86ZWi1SiPd0AcQL8d/T9xsz+yAz4taLKcPmitz7A6SpH7+b6XHqSnAUyBWn+o0CKnTdi4VzCtrF7kkZa0HvSyNdETzDOjvYD0HQVLkJfxHYOyVRh5/Mo8YJVFLteEnzTgEwGtlwWiqTTG0GXNnWCgCZzSfHeoN3RScmBTVL+D420FyyDQEgTEWsh2K1e0sFizCI+xbh1J2lWJGLEEuqjzTjxBwwh540TKQWQIYdiHWbOq+8NvhfsFijHdKS2Vffi3iIcD33/xJglTpIY0w0+gnMTyW0Me6jAmvDFS2SihYnwl8w1YGMxZ/R9qZdpg= MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e95ecb7-2485-4354-ce38-08d6834c775d X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2019 05:09:36.0982 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB3261 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 Update the driver to use the new device capability to report 64-bit UAR PFNs. Reviewed-by: Jorgen Hansen Signed-off-by: Adit Ranadive Reviewed-by: Vishnu Dasa --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 15 ++++++++++----- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 6 +++++- drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 7 ++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h index 6fd5a8f4e2f6..8f9749d54688 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h @@ -57,7 +57,8 @@ #define PVRDMA_ROCEV1_VERSION 17 #define PVRDMA_ROCEV2_VERSION 18 -#define PVRDMA_VERSION PVRDMA_ROCEV2_VERSION +#define PVRDMA_PPN64_VERSION 19 +#define PVRDMA_VERSION PVRDMA_PPN64_VERSION #define PVRDMA_BOARD_ID 1 #define PVRDMA_REV_ID 1 @@ -279,8 +280,10 @@ struct pvrdma_device_shared_region { /* W: Async ring page info. */ struct pvrdma_ring_page_info cq_ring_pages; /* W: CQ ring page info. */ - u32 uar_pfn; /* W: UAR pageframe. */ - u32 pad2; /* Pad to 8-byte align. */ + union { + u32 uar_pfn; /* W: UAR pageframe. */ + u64 uar_pfn64; /* W: 64-bit UAR page frame. */ + }; struct pvrdma_device_caps caps; /* R: Device capabilities. */ }; @@ -411,8 +414,10 @@ struct pvrdma_cmd_query_pkey_resp { struct pvrdma_cmd_create_uc { struct pvrdma_cmd_hdr hdr; - u32 pfn; /* UAR page frame number */ - u8 reserved[4]; + union { + u32 pfn; /* UAR page frame number */ + u64 pfn64; /* 64-bit UAR page frame number */ + }; }; struct pvrdma_cmd_create_uc_resp { diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index 1bc415483d9b..7d91640e9311 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -905,7 +905,11 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, PVRDMA_GOS_BITS_64; dev->dsr->gos_info.gos_type = PVRDMA_GOS_TYPE_LINUX; dev->dsr->gos_info.gos_ver = 1; - dev->dsr->uar_pfn = dev->driver_uar.pfn; + + if (dev->dsr_version < PVRDMA_PPN64_VERSION) + dev->dsr->uar_pfn = dev->driver_uar.pfn; + else + dev->dsr->uar_pfn64 = dev->driver_uar.pfn; /* Command slot. */ dev->cmd_slot = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c index e10149248ce2..fafb2add3b44 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c @@ -340,7 +340,12 @@ struct ib_ucontext *pvrdma_alloc_ucontext(struct ib_device *ibdev, /* get ctx_handle from host */ memset(cmd, 0, sizeof(*cmd)); - cmd->pfn = context->uar.pfn; + + if (vdev->dsr_version < PVRDMA_PPN64_VERSION) + cmd->pfn = context->uar.pfn; + else + cmd->pfn64 = context->uar.pfn; + cmd->hdr.cmd = PVRDMA_CMD_CREATE_UC; ret = pvrdma_cmd_post(vdev, &req, &rsp, PVRDMA_CMD_CREATE_UC_RESP); if (ret < 0) {