From patchwork Tue Apr 26 23:10:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 8947851 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 41B989F441 for ; Tue, 26 Apr 2016 23:10:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CB7D2011E for ; Tue, 26 Apr 2016 23:10:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CF3E20103 for ; Tue, 26 Apr 2016 23:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166AbcDZXKf (ORCPT ); Tue, 26 Apr 2016 19:10:35 -0400 Received: from mail-bn1bon0095.outbound.protection.outlook.com ([157.56.111.95]:3328 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752147AbcDZXKd (ORCPT ); Tue, 26 Apr 2016 19:10:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1P2ZCOoChIAtUtDrWfz8u/jgsVGZgt6BMNfsYnPkgdI=; b=TGnVLDLmcRwj6jdkQ4ItUOfpGPt592yw/osFJTEQOqzG26jGFc99XPu0ikHXqq8Cpr3orMIyVw4giphNwHpPbDW9w9FiNxxNKd6GP1agtB8MSQPaACbcGkUZEhqN0UGXD1/T7QM/gjA8S9O/fBfqlYrfduaXlWBUwvJMf9LG6Ek= Received: from BY2PR02CA0013.namprd02.prod.outlook.com (10.242.32.13) by CY1PR0201MB1930.namprd02.prod.outlook.com (10.163.56.28) with Microsoft SMTP Server (TLS) id 15.1.477.8; Tue, 26 Apr 2016 23:10:30 +0000 Received: from BL2FFO11FD052.protection.gbl (2a01:111:f400:7c09::156) by BY2PR02CA0013.outlook.office365.com (2a01:111:e400:2c2a::13) with Microsoft SMTP Server (TLS) id 15.1.477.8 via Frontend Transport; Tue, 26 Apr 2016 23:10:29 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Tue, 26 Apr 2016 23:10:28 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [172.22.12.162]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id DD.2D.04010.FE4FF175; Tue, 26 Apr 2016 16:08:31 -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.279.2; Tue, 26 Apr 2016 16:10:26 -0700 X-AuditID: ac160c71-33bff70000000faa-6a-571ff4efb9fb Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 02.5B.02566.265FF175; Tue, 26 Apr 2016 16:10:26 -0700 (PDT) Subject: Re: [PATCH 11/11] IB/srp: Prevent mapping failures To: Sagi Grimberg , References: <571A936F.7040409@sandisk.com> <571A94AF.7000609@sandisk.com> <20160424083538.GF7974@leon.nu> <571D6975.2020905@sandisk.com> <20160425055433.GG7974@leon.nu> <571DE793.6090705@grimberg.me> <20160425155320.GH7974@leon.nu> <571E42D2.70705@sandisk.com> <20160426141229.GI7974@leon.nu> <571FD8D3.1060403@grimberg.me> CC: Doug Ledford , Christoph Hellwig , Laurence Oberman , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <571FF562.3040902@sandisk.com> Date: Tue, 26 Apr 2016 16:10:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <571FD8D3.1060403@grimberg.me> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsWyRoxnke77L/LhBrNXq1q8PP+B1WLl6qNM FlN+LWW2eHaol8Xi/IdXTBbrXr9ncWDzOH9vI4vHplWdbB67bzawebzfd5XN4/MmuQDWKC6b lNSczLLUIn27BK6Mn2u2MBbM46yYev0NSwPjRfYuRk4OCQETia13zzB2MXJxCAnMZZK48Ww/ O4Szg1Hi6/XHLDBVy/bsg0osZZRYtWY5I0hCWMBaYuarBjYQW0TAXGLX09/MILaQwGkmiV3v q0AamAXWMko8X78eLMEmYCTx7f1MsKm8AloSy288AhvEIqAq8e7oHyYQW1QgQmL1umvMEDWC EidnPgGqZ+fgFNCWuO4EEmUWMJA4smgOK4QtL7H97RxmkFUSAgdZJfb3XGeFuEFd4uSS+UwT GIVnIZk0C0n/LCT9CxiZVzGK5WbmFOempxYYmugVJ+alZBZn6yXn525ihERK4Q7G17e9DzEK cDAq8fAqLJMLF2JNLCuuzD3EKMHBrCTCK/NZPlyINyWxsiq1KD++qDQntfgQozQHi5I478Xo j2FCAumJJanZqakFqUUwWSYOTqkGxmk6Ox2swh7NbmGIeDi/ummnrZPfmhsq19qu5Vk671lZ Hd6xj3G5l+E658BrpckH+vcoZxn2L1OY9po/YMYHwaL7j6Vnlfh+fVmroMEoxabj+YM/gMtz dXjKZYNos9N3/z32mP3qd2lhApN00vrI0rV1itt5Vsm4p4QqvSo4u6aiL/2djfRpJZbijERD Leai4kQACKoMUJACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIJMWRmVeSWpSXmKPExsXCtZEjRTfpq3y4wbdeXYuX5z+wWqxcfZTJ YsqvpcwWzw71slic//CKyWLd6/csDmwe5+9tZPHYtKqTzWP3zQY2j/f7rrJ5fN4kF8AaxWWT kpqTWZZapG+XwJXxc80WxoJ5nBVTr79haWC8yN7FyMkhIWAisWzPPiCbi0NIYDGjxKpTy1hA EsIC1hIzXzWwgdgiAqYSOzbvYgaxhQROM0nsel8FYjMLrGWUeDdRCsRmEzCS+PZ+Jlgvr4CW xPIbjxhBbBYBVYl3R/8wgdiiAhESq9ddY4aoEZQ4OfMJUD07B6eAtsR1J4iJehI7rv9ihbDl Jba/ncM8gZFvFpKGWUjKZiEpW8DIvIpRLDczpzg3PbPA0FCvODEvJbM4Wy85P3cTIzhQOSN3 MD6daH6IkYmDU6qBMWDKYmMvmzTBsMgEzi96PG8KmTIvfP7JsD9Z/s9MsbnJ5sob2zPmP+JI nvDrZMaVyocm2jJ20Zt+n5kyteul5cw9/yf/LTknXfG6RWL2SbnoOycX9TIZvWf+uS/7Rvu9 xFWF17i4Tm/mEa84Zfm66brJ121Jd1/+cpFNL+D5zPF9mu0njso/LUosxRmJhlrMRcWJAK7x Z18EAgAA X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(377454003)(24454002)(189002)(199003)(1220700001)(87936001)(2270400002)(53416004)(1096002)(4326007)(77096005)(2906002)(586003)(65956001)(5001770100001)(65806001)(5003600100002)(4001350100001)(2950100001)(47776003)(189998001)(93886004)(81166005)(230700001)(23746002)(50466002)(36756003)(106466001)(5008740100001)(92566002)(6806005)(33656002)(76176999)(54356999)(87266999)(64126003)(50986999)(86362001)(80316001)(11100500001)(65816999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1930; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD052; 1:09A7snrtseYgIGuYIaHxC1gdqIRWt1X4q+2vhjD5KS2s1qqUITf3GnZqeodSN/jQOQuQok/nSEOGEQE6gFholxLzmrtcJlUga6L3tKJnoCyQIq0HtcoYDzdfm8KBUsHaxHGA+45p2yGnhYNEe1V5NDe83nbDo5G7+WvIQyArNIRYbgEzJ/3bFHao9tbKY+V4VBPzq6inADzimqbnjqOo44CVz9Hqatj1V8xTMTwtu/sggeW21Y6AAgn0AanEPThscl+vHJPfspAQdNEX+YL4dX5cwRK82kPy+9LA+ipPAdeK76ox1GHZPWxcF6fq6BI/ejs0VdyLsVcDElrn3d1CQE4TXybSN0Pbm5LVM/MVhvblP+P+JDsBYTB8KF7KU7RG9TecOw5icgfYNRNHnyliE3oJFjmebhn0iheciYjJQA3H3wdtKbAvhqE5YFwq3gI0YxJzqtg5eR7rajOMwLKSo3yFPIfLZVcjvvkydgmaFYY= X-MS-Office365-Filtering-Correlation-Id: a7e75928-8ba7-4175-8f02-08d36e27f598 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1930; 2:lNu9rroWVwIdCIgXuUsi3sC9g6H9JV1emtApYzTDYYYpqYtODaYAADxxT96450i/cnqHRPBXepc6TEORYML34ORhPK+mJMp+8CFCLXlX5jRQAlCGiOaivpSpuvFksLCht5BgPXhrFaliQy24w2JBg2MF7NqeLhOq0Vds5IGc+90U4IZTWrUSuz4eD+aMAotl; 3:jmBVrMmHUhzCxk8xp3br3C84X1hKYDNEhm50n0KxrMGtKKGHQcBny+lQzwm7nt5ntVhiF8EntSCytS9F5rAInijy7Jmv9Yhb/SgdytKxc6IUdF/M3VFRc+6R9f3jLPeAkXfqSNIsafI14ENK/BaQnNLSEcXPZYx+51xC2S5RP1jSY9j0X2mBllA69JLI70wlYEGFNaLv7d8i7lWZQWhrTX6MNzqkltccsS65RQaHKYWgS+KN0x5tN/j9fhk4caG1pZVzN0L5RcdpN5ZY+vJRig== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:CY1PR0201MB1930; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1930; 25:vlTmAOndCXRVpRND6ljlbyQvn/OceV53VPouFx+vUyr3IwZcoHgIJ+UZcdHUqwrHSdGdYMZ8hhR43ybkTAkMI/ABvyegv4GMBF8+/d33zEGIAMMZuG71qNetZUNrSOg5+Ym5hsRUVAEpTXorNriqk0GXdhagfUm09Klk1uy1G/UgFZHTcyCQor9mnUBU35A8yFAvnqlsyWZ39KfQmKI8zFOinu3J7faWrxEPUgpfbI84Me1He49jF2ljAx/d8uP8DH26nexO2I1GoTG7TF9bFp3rHSwfO4Ch3nbJbWNoI/Lx3E0FBcvAEmeszOPQOAdymTNJCv7tZN98Qlj7tyh/kLHjuGbNHRAQIOAzGtc6z4VtdNXmbBOrXQx1HZxTVb63b8rt7NYKXbbafZ/RH3V5tYV254tkagkj+YbxoyZClXXBb1zjiuhpMAuVFOlabKIsRLwocc2RJbDr2HSI8LO+8qZuy4W8ZPzOaDIyyeIf86bDHDQqKU6pLqySLEffs2qTBDPOfy9f8ZRpE+MSjtKimIeF+VqBitPSeGMbTFJ37euettk0/B6pQdPGuUt0UMTtF6Qes/Rd3l9YeeJP8Ocl0Nyx4dv7v9VmfzFfm8SkVaVXG2y8zlG+KmeRA06HHlCr6U5u3XMLCKLXYOSt+dlkaZ12B03AfiHJiREbmmbdPlFlgqTsXHX1cdxDuxTg9CngbX+4Pt+yKPg0VPGAAF5csg== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1930; 20:JBEQJpSRLgQ7Aic9EA5mmM3VV+v3TOUicoddvsljt6OZWJETzO0gMChN17Y1y1vY2CQ3YNtqYEQXOxoVVjvJyiW1PLQxLgO40ySoarkJ1MrAckSW/NHWDNQXverE+v7sHpbiLDI2uYTURGTYYGBgfOqypJrUK+UmAmStGwBNMzClV6TM05L+mHGbonfo7i836slAc0WgOd4HSQrgnmC/4H9QVvEsOXDzL5FBIGN1+FWLSaWoRLSSAewkRuGf04oargQNpici5iJRJEevzRbCnKlFaIZ4vOp5OB+ue7xNWtkYfAMX+4s6hNYkTYe4gAX3Wdy85An4heK7u8/1Dvk4RTanwxfTr2l6UfS47hnOtEE2YrgVHQrUYjB9ukW5X8Qmj+4DxbvsKhIlYUWvoDYDuZgmDeyT+kTyLlY+hUWfhoQT3QP+Md7jwA0yEoj65+k6IhD8BpBys8/DHh9hgI4ntO9ko602PZ1da3SSPe9nXE9mHZ7eZN+Qiu0e+SXTUS2f X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(10201501046)(3002001)(6055026); SRVR:CY1PR0201MB1930; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1930; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1930; 4:yJzcmR65iEcAgTWYeuMWUhK2hqbpTykJSaqNH6i2rTY+1EekpRYxXA5TMzNhRrv484KNsazK1wZKt8810PnS2w6Sx0IZd5xNN5gaOgLk/cVVq4YovJhT5nmeXFzU5NpmihRTtWVc2O7HGrv+WXwxJghYozEOmRouhQ6jDdXz8jFOnDrMIBWVIQKqSiWZnjKeiFiESt2x+oiifB0AF8nxs00I7ki/WJLFRJNXKCst3HePVxURcB43CMazOMf3HXJ/ZASlgEHI/51EaHwPPx2ExiNHG72SlUoFec86qlypC2dHUatBqdItMGGOatyMdd7HcNEKGRCCeZ2vSZCjz7XhfHb2t58BHXDYVyIF5l7Ec6CKsq17StSRdguAhMiUCZxCrWi7idUrEcLRc0XbWFq5p+6EptD3yNaoEPjCd2l7P8HMleFY0ZMFERSJMCo4zqMCSW7VD/wDrdhUcRAQJdvBSA== X-Forefront-PRVS: 0924C6A0D5 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR0201MB1930; 23:nVH5c/45WN3rfzrYqHQpzZPXx6SSm4Q9ff7?= =?Windows-1252?Q?ZG+MFXCoUD8r/Xxiok3zsAT5ka8KEOzkZ+FzVMuIO+unTX8BBDUgxQ9k?= =?Windows-1252?Q?8wewrmMo2Dysygg/Bs0+yCK9mKITf/965HAOIXdj6vRhiJUnIf5G+R5p?= =?Windows-1252?Q?3WNC8ZpjEQvYV7oBkCZMsEu/TMrsCle4LzXDCVwRV4tg7oVUrGwE4ZjY?= =?Windows-1252?Q?hL0qtnyAJWeFvAHjWpJ/ZNmcVNhEbYquYe5rE2Bm5rIeR7sh8KdIm4S7?= =?Windows-1252?Q?ySkXQ25jBjHAUO2clSBNTFPBusX3Oe2lvRO23gJIAsLZ1A880eGh1RVU?= =?Windows-1252?Q?dAqzMNuh6HGHnEmDwjcqAwkKYKLyRVYp+K0Mgel+n5Y5u8ySUS+BGEnf?= =?Windows-1252?Q?DwG07KVhxWNZTgTSl9aNfhOc56Txq+NSg7ECOqe1s3ryIcIA7Gw8VVC6?= =?Windows-1252?Q?Z2vA3MUWyrhk0lEMPKJiC68zXQcTx72IfPPjBKjDZSLoSSYajYnKgxhS?= =?Windows-1252?Q?UHKol58WoL3iLrDhXzq1FUEEKMmV1XHDDGIl/8frB04WUASuvljjddP7?= =?Windows-1252?Q?nHod3oz2Az/SoeC6s4wU3Bz5AKoX6z62jnW5VkarM8k/7Z1jbWjmyU9l?= =?Windows-1252?Q?iKdo3kseWoCKkEhReeIGo4VdjEBGGdhDZgHk66UPMlYHAYyYYqT5smyx?= =?Windows-1252?Q?2euLmbiWfoSxTEaOdPlXFo+NCYih4ML7eg1PeTPtMZhddWZKqK0j6GOu?= =?Windows-1252?Q?g6V/4y5puPLhS4VCs4hqL2qiyVubG+rlhzjpmBgnXFkpDLZ2RKmKkyN3?= =?Windows-1252?Q?BaNNBukl17lN7sPJEL5uM6PWCcC6HFs87bfLt4ZUhpoh8+SE87peuJd6?= =?Windows-1252?Q?HmaC7Iwtb7LFYd2DepxD1RPeLvV/KKvQFghJMTpjCmswUK4ezMzj2h5l?= =?Windows-1252?Q?quPGy5adAkGUV1+DMcSnZ+guyWq9sfxRczxIl+fMuoOXVbwbd28gTEPM?= =?Windows-1252?Q?p1OyULZF6ALB87rhyK3RJMxwC+jh2FhCFlkG4++A6i5HFCq3rvNFfbaR?= =?Windows-1252?Q?dp1I2ZcsOK/Fu2lfGGL08taSYkn/SS0J1uHoXhbkPFnCwWKgZRFpV3BW?= =?Windows-1252?Q?BovuiMdl97rjW1CMdpykq4mc+BurVoRrVms4Uf7XlMGG696kkyCzWhBq?= =?Windows-1252?Q?acBf/AZClp+PSzHfkNtNkBMKCrdC1Gn4nuFZbclkn13DNjUSommna?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1930; 5:ds0Juhp6II/IvanWN8FpbBtE08ZMVjTx1kbgCHLL42p65zzrPuBfiLnm2d/xisRm9f3hMgkPflVmQSJRX1wmPKjRqYBbrzq5Cqd87RKSZ4mwRAKdsMD9d9XH3MQEUHaTJGGaUz6MqMlV58qRuKnhFA==; 24:7uY5iJOrB55rkHe7xiTQAry0UvphnK0KCcw6lwh6m3znQU4KEWWmI6K9trLq5vDGvmcZt1WnYCqsH22L9gC7F0Dx608oNKw3yFvGRuwmYMg=; 7:cowmAuWUca7VuxJbpt7bVX4zaH84NYDNREf1PHBvrWfTwZ1t+BmVumVHZprunfauhJHhvdJM81xhQQq40HvvApFs0g06kUNCTyQcgC14tsaYwG9oVjw84dM2T8rYwGwJE9NGLw0xOuQfbADLV3F3X/TRtpWX2S2FGX2guqki0sixvRGFN80NSQs39yvUmyzR; 20:74rGJezboEvGvb8fyA5h45zvnNqODGj9I65bKy0Sb4/1sWRr60sEV3Wt0NMS51i6D5uNV82SKF46MhBaO73XOOkgwXislR8fHQ8W9n7kpwaVFKlHoOQStH+WzGju5AxT65wKkmf4TTukCCidgh6GNYaMQa169aRLl5U8CZ5y6ktKa34EcFCfxRhL5UasS7Z4AXwWKqEDZin7ovvP/ZQfHmKAC3QI7ywx5fErYyfCcFsL5LI9svCxru4iAvAX11RX SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2016 23:10:28.0711 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1930 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 On 04/26/2016 02:08 PM, Sagi Grimberg wrote: >>> I can add a WARN_ON_ONCE() statement for max_pages_per_mr == 1. That >>> will >>> make it easy to figure out where to start looking if in the future a HCA >>> driver would be added that causes max_pages_per_mr == 1. > > If we're on the imaginary path, you can flat out fail the host creation. How about folding the following change into this patch - this change disables memory registration if max_mr_size <= 1: Bart. --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 8ae1543..9072f7f 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3586,7 +3586,7 @@ static void srp_add_one(struct ib_device *device) IB_DEVICE_MEM_MGT_EXTENSIONS); if (!srp_dev->has_fmr && !srp_dev->has_fr) { dev_warn(&device->dev, "neither FMR nor FR is supported\n"); - } else if (register_always >= 0) { + } else if (register_always >= 0 && device->attrs.max_mr_size > 1) { srp_dev->use_fast_reg = (srp_dev->has_fr && (!srp_dev->has_fmr || prefer_fr)); srp_dev->use_fmr = !srp_dev->use_fast_reg && srp_dev->has_fmr;