From patchwork Tue Aug 11 00:06:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 6986991 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FCF5C05AC for ; Tue, 11 Aug 2015 00:07:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93B87205B4 for ; Tue, 11 Aug 2015 00:07:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0F2020595 for ; Tue, 11 Aug 2015 00:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933436AbbHKAHG (ORCPT ); Mon, 10 Aug 2015 20:07:06 -0400 Received: from mail-bn1on0067.outbound.protection.outlook.com ([157.56.110.67]:57556 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933067AbbHKAHE (ORCPT ); Mon, 10 Aug 2015 20:07:04 -0400 Received: from BY2PR02CA0074.namprd02.prod.outlook.com (10.242.32.32) by DM2PR0201MB0750.namprd02.prod.outlook.com (10.160.94.26) with Microsoft SMTP Server (TLS) id 15.1.225.19; Tue, 11 Aug 2015 00:07:01 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::162) by BY2PR02CA0074.outlook.office365.com (2a01:111:e400:2c2a::32) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Tue, 11 Aug 2015 00:07:00 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.172) smtp.mailfrom=sandisk.com; obsidianresearch.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.172 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.172; helo=milsmgep11.sandisk.com; Received: from milsmgep11.sandisk.com (63.163.107.172) by BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server id 15.1.243.9 via Frontend Transport; Tue, 11 Aug 2015 00:06:58 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep11.sandisk.com (Symantec Messaging Gateway) with SMTP id 8C.EB.04667.2AC39C55; Mon, 10 Aug 2015 17:06:58 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.224.2; Mon, 10 Aug 2015 17:06:11 -0700 X-AuditID: ac160a68-f790b6d00000123b-e1-55c93ca2b5d0 Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id 6A.5B.03643.1AC39C55; Mon, 10 Aug 2015 17:06:57 -0700 (PDT) Subject: [PATCH 2/8] IB/srp: Use multiple registrations for large memory regions To: Jason Gunthorpe References: <55BBF4B8.2050700@sandisk.com> <20150803152420.GA24193@infradead.org> <55BFB40F.8000500@sandisk.com> <20150804180933.GB5038@obsidianresearch.com> <1438756876.5698.2.camel@haswell.thedillows.org> <20150805195122.GA31595@obsidianresearch.com> <55C2840C.5050301@sandisk.com> <55C2912A.50709@sandisk.com> <20150806001006.GD2483@obsidianresearch.com> <55C2A7FE.7020904@sandisk.com> <20150806043642.GA14153@obsidianresearch.com> <55C93C61.9010508@sandisk.com> CC: "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <55C93CA1.5020905@sandisk.com> Date: Mon, 10 Aug 2015 17:06:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55C93C61.9010508@sandisk.com> X-Bright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DlnALaEo1TZSEmqkv8mXcJarq8xPa3c5gnMPLPQtIxC0nZLCRlCxiZVzGK5WbmFOemZxYY GuoVJ+alZBZn6yXn525iBAceZ+QOxqcTzQ8xMnFwSjUwxvJo73/yf8HrrMeCQbwiZa+EN2Xt Os3waPablYY7Srllp1kWufYxT3V2ipdcZ+/AUG5h8WGBqHjU8SI/8QRLnx7ZN7mO/26VvDzx KFltxefvEhM/PpsroHa7N2Sl+CTlPfe/PProKPDo3v5U2cV6X18fidiq6O4gaH9efPnhSNnb Zw5ct769XImlOCPRUIu5qDgRAOeh4kjsAQAA X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:1wdakFD92uFQKqzeUJGHs06YztOnw4pylbm8vQtFulWJNRyBOzE6WmuBhAx5SgFk5BznU7TwVvxMVFncS5MISRVBmQxvM8GRRwDp9OaQKeep6qH9gP5lG3jwzkCdXeFO8EmmULYZ3XzjSDgaajeDZz7S3Lg8xybJuTI15BO9xO+yGpFU8Pd44t5xnNaAqPc2JP1gMyZ9KYYb88hjgvqECjb2kSXpGtaQwDy5Z5FiGEdxgAAmnBte3BvftTpalnh6xnY4f78vsrnA2sLs5ryEXB+4pvZgpn8uUiVFWKmA+2rod13nSGqyO2iGmYO2Htkdsx15wDzmnuWi9kryn1uqBQ== X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(3050300001)(189002)(199003)(62966003)(87266999)(19580395003)(4001540100001)(2950100001)(19580405001)(80316001)(189998001)(68736005)(92566002)(59896002)(50466002)(229853001)(77096005)(87936001)(106466001)(46102003)(5001960100002)(65816999)(110136002)(50986999)(36756003)(5001830100001)(33656002)(64126003)(86362001)(81156007)(64706001)(93886004)(69596002)(54356999)(47776003)(83506001)(65806001)(23676002)(77156002)(65956001)(76176999)(5001860100001)(4001350100001)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0750; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0750; 2:J1R6K+7PFic45oo4rVg5k5DIqWL7+N0MOAjTIgmV70UgQmtUrZ9AyYrwemO7jC812HawdiWYdFNvp1PtT/kOwGs9MiQuQ3fOJG10KrEI56Wt3xIb6n60b6gOL1gUv7zDU0i27AyEjVrjN1ftLc0ZOZbuZumKL2pxy6+1Cvz9eJo=; 3:K/DWwGzwKlImHKwtKXCHCKI6Zk7oXrkxYbQJ0SwT1N0XR2KcDErZTj2FoNksaR2mOkhoMsUBhkKe3P5O20XordWg6/1DwqzYOhBkYeCtV70TtG18CdUL7MrmsF3mzANfQW4Zv9DNApvjpUs/TzzsD/ib31Nnllaw6SuvCUpCrkgj4GXC0wNZqvhgBMXd2HJvt617iWwXS1Xv13w33AgOk4jNrSXGccOtM5AzpeXbnAu3DGxWkdSejY4FyZHqM606; 25:K5h8w/igLmvbbIKLH5Qm+PwjdebFtxhWTEjWSHXEdwOIC7oZO6r+kPx6cKVlliRLzz/9dImUKAROzOLc3Y0X4xVsb7oUIdQJc4cpVPVBpTvub3iAmHz8CvdOcJI0x40cSoXJPUablxswAjrgJMhKsvwIE6G/KeKvitRBES+vFGwsFbTFCndsw+2dkg1Ivge6iUr88SuPJ8SAgR/8tZL7Y5jKdIkNmag/Zusve/dnraqiQIS9QOpodfIwUBSzVRNybQ1H/lOrPrZ8BbcgwkBoQg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0201MB0750; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0750; 20:kvDnya+Ld3zp+gPPrc8Fk+1FshoMsTjakE6uHR9wOBb2xK9t/K4SOzzVESwIiOZo4I7iG9bE1QpbM4lsStOS7DHDWJaWSym9gr5SuIRN3Kv+xZ+9k2fNHZkBiv1oQiqYD5kmTfXo6L3xweVn8Yqnjd13iVZ0+nYRXXO51SW+IlN12xG+qMK1+0bTYqcy+xudDSVm8Bwrt14CWRiDIh6W1TBPtGI4HlaQPzT58C9awUslEH5GWDrArz4caN2v+U/hjRNwlIEukDxcExIHqajyeyLeUTXDaetowx/+Sp3Q1igw2Mk84EsyekP1fFLgrpBWj02p/6ib9VqGHw+HS5KiY/z6WTEAm57q1HgFtu/BRMfDrYWtspPAHhDb4yt1j48f+6B6PPrQR7YW/15dN//VUHjd8hToVvAwAjFZwnDx93HdSvYzaCUyN/5nKS2MAyj0mo0b6OeKRqaIM/hZ3dEy57XOqcSHIbwsW/u001o7x20vyv8WqRWckyDSaUKvO17B; 4:8CFDcD3vb06It59SslXSHx3tWTtXj+Fs+sDoiPFO0GJ4+uBpUdC2Inr/u0/tWvQB5M5zdh8UfHqAdOU4UEvHCzS7MNTPvUJsao1EqyYKXELXu5frluQ0SBIvPaEgw1EAy0hy+ibkYDsicMUXj53+in2cXNIKMQ89UQtRmWVu+Nuru4plIZll67JqRbD5F/7cctNp6buDFpEwh85ARWHHpKxIDVKvYrTupHjdnbeHckradC25c44NB/87p8swkGnRDNuwmGrmouEu4gOhLKjatW6ESm1SyJ8ahNOXuTV3wRE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR0201MB0750; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0201MB0750; X-Forefront-PRVS: 066517B35B X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTJQUjAyMDFNQjA3NTA7MjM6eWdTdkEvUkRJaWhCeXpLYWE4UFA0clg1?= =?utf-8?B?YjdocGJxa1ZhTy9GUGl5emppSVF0NXhKc0Vya2s2L2NFNkZhVTVWclg5K0ZC?= =?utf-8?B?alM4RWlvNTFUZjNXbnR4Uk81NGttMnRDK3NYdTdXRjluVGtkcFZLUGVRb2VZ?= =?utf-8?B?NmdYY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PKD2RNhaqQTp6YwwnLCe6uMNptbZc5gWYw5Orj5YSUWliHidzdar4IVvPxHhsjIThr/RHaremRYyKpNsMsN8xEI5+TKJFNE2bkIiHWJWrgtWeE+2zy1JMv1l80jCtftq9645+4AjRCeBpg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2015 00:06:58.3856 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.172]; Helo=[milsmgep11.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0201MB0750 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of using the global rkey for large memory regions, use multiple registrations. See also the while (dma_len) loop further down in srp_map_sg_entry(). Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srp/ib_srp.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 887e8ca..b6b9a55 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1393,16 +1393,6 @@ static int srp_map_sg_entry(struct srp_map_state *state, return 0; } - if (dma_len > dev->mr_max_size) { - ret = srp_finish_mapping(state, ch); - if (ret) - return ret; - - srp_map_desc(state, dma_addr, dma_len, target->rkey); - srp_map_update_start(state, NULL, 0, 0); - return 0; - } - /* * If this is the first sg that will be mapped via FMR or via FR, save * our position. We need to know the first unmapped entry, its index,