From patchwork Wed Aug 23 06:19:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9916639 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 68AC860327 for ; Wed, 23 Aug 2017 06:19:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A75227FB0 for ; Wed, 23 Aug 2017 06:19:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F51A28556; Wed, 23 Aug 2017 06:19:25 +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 D023F27FB0 for ; Wed, 23 Aug 2017 06:19:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbdHWGTX (ORCPT ); Wed, 23 Aug 2017 02:19:23 -0400 Received: from mail-dm3nam03on0079.outbound.protection.outlook.com ([104.47.41.79]:61327 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753300AbdHWGTV (ORCPT ); Wed, 23 Aug 2017 02:19:21 -0400 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=6EWOKhiekH1Ac4zPwSWcokzTAGPTIlGzFvh5Etw7PHg=; b=Vaz4CaWIHH6z8n/3BvcfGxyHNiOAAUoHiSXtDRH8ujTFXq7LKdC+nHDs0EKf6SdzneG0yaS6aMytfAygVedNROENGDoKc31E8cz3wPQnfezixuburjUFe7m2l3mW6bVFcnUteX9ToZN/COmKOCIizj6k4j+xC44zooImhV43sUo= Received: from promb-2s-dhcp95-136.eng.vmware.com (208.91.1.34) by DM5PR05MB3516.namprd05.prod.outlook.com (10.174.242.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.4; Wed, 23 Aug 2017 06:19:20 +0000 From: Adit Ranadive To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: Adit Ranadive , pv-drivers@vmware.com Subject: [PATCH for-next v1 2/2] RDMA/vmw_pvrdma: Update device query parameters and port caps Date: Tue, 22 Aug 2017 23:19:01 -0700 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: CO2PR05CA0071.namprd05.prod.outlook.com (10.166.88.167) To DM5PR05MB3516.namprd05.prod.outlook.com (10.174.242.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d659433d-edd9-41b2-4c14-08d4e9eee449 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR05MB3516; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3516; 3:orf0SO1nMpoaiAAAZ4O0XEKnDKw2fIxl1bvKGTSqBoqypcJMl3ZMqD8F5QTKaB6FSqWd5nszTfOEk0lwohOJ0Upd5tZsUOdnKVGd0RjqqiR7kv4FYpVmwrvDmJbKHW8YAvo/tFE8bg20amf2gpC56I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gGItvnC6KX6AL9EbXKNO/mgZ976TBOsj1K9cBaSkch5j1NUxByvYum9gqb5d5tubVd+rQlqRas2fjxzcijN8DViT5Y2OMRaNxXXt8Sh2qWy6R0KAMhPKtRDlEBAfkPeUk4cy28eURID+SFMTbxrPJqUXa9ve274smz1ynC7M6SglnEcqx5/5G0HEVU6Tz0OnOh26vDFpkENNi+9bGe; 4:j9BsrwqHpaEQ5540gJW03yZd4wtGo4YLmn60U0r4X81fb1qTEW/hl+XuYEQxn+lNlWUpcgU2dndc+EBq+da+Z4zcb1T33QkELFcFkqFEB7gKjrFEK0VoDHC71VShKrkZB8Bf9qHxCvxGYJVRVS8wLFtokQQKRpQcODMglVJfpLHnd6d+AV1bRexQJMvr5Az/41q1DjvWbpBXL/Jt0FbLv8DeGpF/bmPi2yL2Vr7byLVUGbjT9t7rPodxSd3i1NVm92BTYk+T9o9Liym671xZ+WrYAMPTeJyyYNg9BuL3/Mw= X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR05MB3516; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR05MB3516; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(979002)(6009001)(39860400002)(189002)(199003)(6486002)(118296001)(189998001)(101416001)(4326008)(105586002)(33646002)(6666003)(2950100002)(97736004)(106356001)(305945005)(2906002)(7350300001)(25786009)(53936002)(5003940100001)(110136004)(47776003)(36756003)(107886003)(42186005)(478600001)(3846002)(7736002)(50466002)(81166006)(48376002)(86362001)(68736007)(575784001)(50226002)(81156014)(6116002)(50986999)(8676002)(5660300001)(66066001)(76176999)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR05MB3516; H:promb-2s-dhcp95-136.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR05MB3516; 23:CAek2+XFIa2606+heG0WA/g3BNpMexV3h/ILLmx4u?= =?us-ascii?Q?g9GnQrcPEJlZ48WTqvS7U2zOvdJjZpHeRrxQQvDIDByyWuHN6cfOKetovLQO?= =?us-ascii?Q?7+hC/lk4ooByB17ArFFiX4MMv1fDJmdpnl5P6Vid2UrCFCDCXmQZBUjTgCUD?= =?us-ascii?Q?3W0wCj/8klAIdEq1Iq2kr+SAMrF5VSaFqvZ0Ad/eaX3jKreK13ciVucuSKZ3?= =?us-ascii?Q?XLWYpjTy6uNtazuUQYnmAqdZU/8JwfTpaz92JOYOaGVup4L3SYy2MNhCn6ub?= =?us-ascii?Q?CQiO2fVl1i9+CgYJmWaowU0CI8DYjVhKEcgCD61T6Ncp+E9zkqZovZ9Xm4cu?= =?us-ascii?Q?XY12lWs3fzAD5qYwqc1ZAo1diiSDxxgiy933IyDJV853+l0d2daA9N+fcD9x?= =?us-ascii?Q?sfMJd35Rr1z4G1ADpvoFWQI+37LXQefXrFqs2OKPFiU3wxZ6Z1MDWjRqEbDS?= =?us-ascii?Q?iwHaKpVnnnyjEBPnJrOw7/jeE+7ibGucf4c5knJaz8NcpR15YjUx5R/J13LO?= =?us-ascii?Q?G2VHl8VYL2x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LaiFIX5xzRgwaCdqAZ0/Jr07vPr5m0gB+qfWkV6lwQB3zrhfx7hO2/e0LdYcJ+i+aVDGIisL9ZNEGmKoXJlUSXLTpD3L8Znfdz6pzWFzMBD2vJV2XqzhjS0XhBrH1zpI96YZw==; 5:L8qMZabxdKWuptfRjmGmhaJiQyNooqZZk0T303xJbzRPR05xkJzQEKAeo9qFWl4sTXc4HgTuq7Vs9NAr7Y6v9t/kuJyRn8L8eNTUMdaYKDnw9BBDwtCXDtgTac8YpA5CIWDBte1/ZGZhOhc6920jyw==; 24:9Azy/TBpEkip7K8W1uVSYNvLLED6o+hIh9C+xV2lhiUDSr0lAKaB6ZJSymZJ8lVaM4q78p8po3xm3fHS2UTdCovTJ01m85ZCq8tKP4yCXrQ=; 7:VvOfHMj0RyGp0ei5+4fxIWY+mqT0b+zTusBT8opkeTYMXnNQrmo/qLnoEBK5XhtzASl29ynjJABkbyMy3BlB/RlVM5I8QBJKtpPD2bWXPpvlD2XfohtQ9szs7HLuVKpdJwLyhyPTQLNKwtp4Q/yV7QU41/fCgFsv8uxUkjz42gimyyyzO3ZeWdfW0LLZYnz6jtKy41vFoyWYN8ogOyoAECosB5u6HDqPfBZ0OnVTVNk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3516; 20:ZETVc6d7xQaVvZQH6CEif2D2syZBHwKJyTm5VB0JVarmq0fFA0YvlSAindT13UFhsI7pEZwR6iO3Zuyp5vTu4oRhsr5+1nk7PIrS7tdPkrb6nBNFbX2ChUOYKvndzeuo8R1XD1YwVQka4s80iLw3wEjKnnRT30h0Y1Q3056oLeE= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 06:19:20.2110 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3516 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 Added support for two device caps - max_sge_rd, max_fast_reg_page_list_len and the IP_BASED_GIDS port cap flag. Reviewed-by: Jorgen Hansen Reviewed-by: Bryan Tan Reviewed-by: Aditya Sarwade Signed-off-by: Adit Ranadive Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 9 ++++++++- drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h index 3a308ff..df0a6b5 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h @@ -149,6 +149,13 @@ ((_dev->dsr->caps.mode == PVRDMA_DEVICE_MODE_ROCE) && \ (PVRDMA_IS_VERSION17(_dev) || PVRDMA_IS_VERSION18(_dev))) +/* + * Get capability values based on device version. + */ + +#define PVRDMA_GET_CAP(_dev, _old_val, _val) \ + ((PVRDMA_IS_VERSION18(_dev)) ? _val : _old_val) + enum pvrdma_pci_resource { PVRDMA_PCI_RESOURCE_MSIX, /* BAR0: MSI-X, MMIO. */ PVRDMA_PCI_RESOURCE_REG, /* BAR1: Registers, MMIO. */ @@ -251,7 +258,7 @@ struct pvrdma_device_caps { u8 atomic_ops; /* PVRDMA_ATOMIC_OP_* bits */ u8 bmme_flags; /* FRWR Mem Mgmt Extensions */ u8 gid_types; /* PVRDMA_GID_TYPE_FLAG_ */ - u8 reserved[4]; + u32 max_fast_reg_page_list_len; }; struct pvrdma_ring_page_info { diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c index 2851704..48776f5 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c @@ -83,6 +83,8 @@ int pvrdma_query_device(struct ib_device *ibdev, props->max_qp_wr = dev->dsr->caps.max_qp_wr; props->device_cap_flags = dev->dsr->caps.device_cap_flags; props->max_sge = dev->dsr->caps.max_sge; + props->max_sge_rd = PVRDMA_GET_CAP(dev, dev->dsr->caps.max_sge, + dev->dsr->caps.max_sge_rd); props->max_cq = dev->dsr->caps.max_cq; props->max_cqe = dev->dsr->caps.max_cqe; props->max_mr = dev->dsr->caps.max_mr; @@ -101,8 +103,14 @@ int pvrdma_query_device(struct ib_device *ibdev, (dev->dsr->caps.bmme_flags & PVRDMA_BMME_FLAG_REMOTE_INV) && (dev->dsr->caps.bmme_flags & PVRDMA_BMME_FLAG_FAST_REG_WR)) { props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; + props->max_fast_reg_page_list_len = PVRDMA_GET_CAP(dev, + PVRDMA_MAX_FAST_REG_PAGES, + dev->dsr->caps.max_fast_reg_page_list_len); } + props->device_cap_flags |= IB_DEVICE_PORT_ACTIVE_EVENT | + IB_DEVICE_RC_RNR_NAK_GEN; + return 0; } @@ -143,6 +151,7 @@ int pvrdma_query_port(struct ib_device *ibdev, u8 port, props->gid_tbl_len = resp->attrs.gid_tbl_len; props->port_cap_flags = pvrdma_port_cap_flags_to_ib(resp->attrs.port_cap_flags); + props->port_cap_flags |= IB_PORT_CM_SUP | IB_PORT_IP_BASED_GIDS; props->max_msg_sz = resp->attrs.max_msg_sz; props->bad_pkey_cntr = resp->attrs.bad_pkey_cntr; props->qkey_viol_cntr = resp->attrs.qkey_viol_cntr;