From patchwork Thu Jun 30 13:50: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: 9207661 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 579AF60752 for ; Thu, 30 Jun 2016 13:50:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 495B8285BA for ; Thu, 30 Jun 2016 13:50:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DCDA2865F; Thu, 30 Jun 2016 13:50:57 +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 05BA028673 for ; Thu, 30 Jun 2016 13:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932081AbcF3Nuq (ORCPT ); Thu, 30 Jun 2016 09:50:46 -0400 Received: from mail-by2on0066.outbound.protection.outlook.com ([207.46.100.66]:12288 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752142AbcF3Nun (ORCPT ); Thu, 30 Jun 2016 09:50:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sPclm6hnw9QiWkWwaMEwd92Egd4jm61NpRFy/2qWagc=; b=Uv3+3e7k9QFsuaeslReBbvmJbk4UYrxkkJRJ/rw1WTVocThq9cZFFfx3vXXllCBmy4904yu4W5Jmd5ShswAFR5xrMe+AgsvZqchG4CZaWVtqM3BRiGXRKqbD/89CO+w+sjQYRo70o8hdxU2FLfIDYJPW/mgouO4+4FLVtqtseD4= Received: from BLUPR02CA056.namprd02.prod.outlook.com (10.160.23.174) by BY2PR0201MB0807.namprd02.prod.outlook.com (10.160.125.148) with Microsoft SMTP Server (TLS) id 15.1.523.12; Thu, 30 Jun 2016 13:50:41 +0000 Received: from BN1BFFO11FD047.protection.gbl (2a01:111:f400:7c10::1:157) by BLUPR02CA056.outlook.office365.com (2a01:111:e400:8ad::46) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Thu, 30 Jun 2016 13:50:41 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; opengridcomputing.com; dkim=none (message not signed) header.d=none; opengridcomputing.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN1BFFO11FD047.mail.protection.outlook.com (10.58.145.2) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Thu, 30 Jun 2016 13:50:39 +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 8E.EA.03023.35225775; Thu, 30 Jun 2016 06:44:51 -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; Thu, 30 Jun 2016 06:50:31 -0700 X-AuditID: ac160c69-6db3098000000bcf-a4-57752253f1e8 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 33.EC.02607.3A325775; Thu, 30 Jun 2016 06:50:31 -0700 (PDT) Subject: [PATCH v2 3/5] IB/srpt: Limit the number of SG elements per work request To: Doug Ledford References: CC: Christoph Hellwig , Sagi Grimberg , "Nicholas A. Bellinger" , Parav Pandit , Laurence Oberman , Steve Wise , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <908f9aa5-1afd-2eab-29d8-475626e0db49@sandisk.com> Date: Thu, 30 Jun 2016 15:50:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42JZI8azSDdYqTTc4PldYYuX5z+wWqxcfZTJ 4tmhXhaL8x9eMVm0rT7DaNF4ycBi3ev3LBb/1nazOHB47Jx1l93j/L2NLB73tx9h8th9s4HN 49Hzc4we7/ddZfP4vEkugD2KyyYlNSezLLVI3y6BK+NF7yu2gnP8FTPPJTYwruPtYuTkkBAw kbhzaylLFyMXh5DAXCaJt00T2CCcHYwS8y4fYoWp+vXiD1TVUkaJTQ8nAlVxcAgLBEuc31QM UiMioCax6dUidhBbSMBOYs6GuUwg9cwC65kkuqcsZwNJsAkYSXx7P5MFxOYFKjq26AMTiM0i oCqxu/U8WFxUIEKi99cSqBpBiZMzn4DZnAL2Ejt2LmMF2cssoCmxfpc+SJhZQF5i+9s5zCC7 JATuskq8an7EAnGEusTJJfOZJjAKz0IyahZC+ywk7QsYmVcxiuVm5hTnpqcWGJrqFSfmpWQW Z+sl5+duYoTEUuYOxrtPvA8xCnAwKvHwOjCXhAuxJpYVV+YeYpTgYFYS4X0lXxouxJuSWFmV WpQfX1Sak1p8iFGag0VJnNft3pcwIYH0xJLU7NTUgtQimCwTB6dUA+PMtznv2Ccs0jr7QeyW V6b3pslcPOz2v388eKvGKXhetUX6eO9FcY6t3wXuZK4pECvKk82ZqCqgrWT1qEpGep59dP++ axL7TLw3fK7se9s1U1yXdz1j4Fe3iU4Tt+RJ5LlLml3a7JFby25VsGRp078zPsePrfQymPas gsX02I1pMX/y3sT+vKjEUpyRaKjFXFScCAArugkyoQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplluLIzCtJLcpLzFFi42Lh2siRortcuTTc4Ow3HouX5z+wWqxcfZTJ 4tmhXhaL8x9eMVm0rT7DaNF4ycBi3ev3LBb/1nazOHB47Jx1l93j/L2NLB73tx9h8th9s4HN 49Hzc4we7/ddZfP4vEkugD2KyyYlNSezLLVI3y6BK+NF7yu2gnP8FTPPJTYwruPtYuTkkBAw kfj14g9LFyMXh5DAYkaJb23HgRwODmGBYInzm4pBakQE1CQ2vVrEDmILCdhJzNkwlwmknllg PZNE3+cHTCAJNgEjiW/vZ7KA2LxARccWfQCLswioSuxuPQ8WFxWIkOj9tQSqRlDi5MwnYDan gL3Ejp3LWEFsZgF1iT/zLjFD2PIS29/OYZ7AyDcLScssJGWzkJQtYGRexSiWm5lTnJueWWBo qFecmJeSWZytl5yfu4kRHNCckTsYn040P8TIxMEp1cDYN/fKg53u2zlLZFkfRLwS+SMhGjrt 2xfts1Im2lMNCh+skH3KfDuge8ucZm8TxbRre6+z6m5NPX/nhciy+WYaKn13uebnTZz+RfPQ rf9KTiav173b3iPm0NCiWSnIfabnhkpbcFBJI+9rUwbr8yr9dzlatbmK18ascPj1/q/f1+ir M9LMN+orsRRnJBpqMRcVJwIAkADYnRgCAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(52084003)(199003)(97736004)(4001350100001)(4326007)(106466001)(229853001)(110136002)(189998001)(305945005)(53416004)(31696002)(2906002)(77096005)(68736007)(50466002)(19580405001)(19580395003)(69596002)(2270400002)(8936002)(586003)(31686004)(11100500001)(6806005)(81166006)(230700001)(87936001)(356003)(23676002)(65806001)(92566002)(86362001)(2950100001)(47776003)(64126003)(81156014)(83506001)(33646002)(8676002)(7846002)(7696003)(5003600100003)(36756003)(65956001)(76176999)(54356999)(50986999)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB0807; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD047; 1:/HZXHKXc2aYB1/y4jaHPNHyeR1fZ9PybRdb33gNxYhm6HiUQFK2Bbv58YhFXe92cMljps+dB42XtMt0c/Z32HhvnUzoBXZXz1sGtfBT0BLn2jN5RxOJC61gSL8VaH0vxCEVQqWR1caig8z4opmlAScwj3Uu9JHo3vbMWsFrlHimDSt9fEZhoN0N7SojT158GBitLeoZd2BAcfRpInvaxrOhkqeILoBOi9oqhHB8xIhRNeb8SsIWSUgZoEyTWXBtUsvCl2/AH9+mlaSjOMlj+9uRztSFJDFvFVIBXW8KKWlJarK/k4wJOPxfTN9K9JaZF0rJB7Ca5SuFu6AlCWrXXnTTs3TDPTI94aM1QUCUpyaO3GlsM6v86oNDTo/2vOTA/Jl24kECPRpVn3TlJHij1oOZFxCs3SAQR/L2bw0UbuPok5mKBayVay74JCs2uQwsgx14kGGkoQHez6Fz2t1Y/jGdDqwY0LzVSZhL1WR6B3SdbbCvvYnoOBLTj3/9yvJY3RTCe0/rZppPgA1lFmUZpQw== X-MS-Office365-Filtering-Correlation-Id: 603b3224-058e-4a5e-a9b5-08d3a0ed8627 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0807; 2:5+m0f6y5jk+zzxcdZYn0GFMfP61DnIWoLtgtuyleKqQYwldyuXguhhjc+AFP33bCE/YlOIFwredAc0Ig7R4LLzFySNqjJSsCkYpgUBJX9ISgK0dZ9KfkrrVWc6tgIHPZs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fwL+gyV5OfNC/8Z86sTMwWzBMeaMeRcnAXUgCsch7wciY/bakE6D8wxqT7qJffc2Gweahg6UChvba5uc89+Sxi0ohmlCBCW2tshYdEiZhlXavyfDnW0Fkc5QT6LS5CMLIreOdhNWI2cXa078ce+Lsv1G+MhVocKqKlzHsQ39ofKI+NP+n3li06nSJ0cRytgyvnbNZFMQ1q5klRMBCO08pJTNAhKJ4bW+ar08JUCDjmN7xfO1tfhIvabWMxAIS0Q1F08RFB3snp72Iryp5QRqKGQmUF3N5uXM0DwbuHx7O9CkisRiQVi4brHq0/C X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(131327999870524)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001)(6055026); SRVR:BY2PR0201MB0807; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB0807; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0807; 4:TdxuhU2+u3s8CNJIqa1z9jO23QxJTaKBrIRp39VNli4o+u8/6FwaFuLAlynkyjqoJRTYyV7ZIRbzgqGUngHwXvj32WOYqhJsJM8IMoe7rIIChkbh50wQx1SzPj8sPwiTly7vaahjl6vLyznh0YLq2yRWVlGD9jbHCe4rMjUcfEpyj1EjFUbJ3N9Xd5eTU4gC43ytEX4m8c0bCvx+niPvVou3rIvZCAEFbxTe3yrNizB3uco5DRu8CjSr0KL+czGItdx8/bncS8Z25I9b/qGAKjipN9JTyZiyi55quX2zhxuOx1JdjBb5g3EXxs1crsvnl/1AdbsuAp2p+tTGJOzkgcT8txwUskg3bXgbw4KHRyYw2B3v6RkpFdpMJHkrkzMyeUSX14V3Q3XbpL3+tkb1qckY0vFBTgQHi8yKS/Cv9EyyzHX2zaZBkePzww1baQOhUd8HxyRzSyVf3tyH0RUASq+IdljSzoFKoIILmQ/v64H5hXMyre0vyYTlj9FKYz13c816g2vkP/57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Qmk3cUpXSjZSNktwYzcxalRzZEc5N1Vq?= =?utf-8?B?aGsvb0hUVHhGYk5yU0I2WkFRPT0=?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0807; 6:MsRSfapPFBNu7P4SwQ6yri9jbXbTsbHI51iuN7liUDm8zrb5KBbNbanTNas+2K/rINib1INlIQffXbuRAPzPhf6aGUgyIGCwzKJOXTESIMX9HQuaH2o/32enXNM+CD/v8iEJHowHgk3vkQ988TpsTF6rWCfuTIheyBu4/mDo19JVN2S+oqlRTBUOPzNx0IY2MXNdZCXveaNSchXIfmmWnDbi+41bWC+jV58OZFn8vb6nmT8DqstEwqN07MxbIUY0N1/j7yEdTKoWh6e02m3OdcXd3M4YXzj9lieKyFkmlcZJYGr+Zyg9fJW/lUnpL0Pdc1X7MciPjNrzXafQ6zVse+MFPsc9vGR3A2nNZWO99M0=; 5:rItFzW4FPSF+bvEt/hlQcwe06zPNauCRDx6LDz+U5q8y2nu0bi5TsQbXHZSwAQadOjEh57n2liCE4A1lEMY5/DG/qp/KblZdU4ZA0ZtOm7c7XSUiAtjoOXYUplbNkbPmSux9K8IlEjXmExc01sZ0cw==; 24:X9BXrAUWzTD5xy8t3FfwzUDAIx5qCXWGCcU1N1Fd1yoNJHd76Cke2RNGwtpHkdEpFHjPA9y+H5YVQgsDi7aQ06baL/RNVUXpEUe4X307R28=; 7:AiNwehYYr37MDpdCDNf6OhUi1z6ymKuc8jbR/dxmp5cQwwamP23JwdJFKlAMNm5y4egfTnLV6EYm15Q2+u3Dny414BlKR5iRHDrG8oiKGR7vdgP1YTnJ9DrB4FJ9SeyxU5OrIXegNn89hLml9hitJJFpdVCG/4Q2jcQ0SOZbSjoVnop0o+dTGnrX+QdsUYbXwMEzNsr280FeNOL4GEX1YfCp0golo1A5dsAOtbUjbyiHTB1UuioA2b8MrPlkj/2ajeP7IC+Gk//Fif1VuaR+ww== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0807; 20:HDmVBaJaYhX4AVkxI9XuZeHB4XkHDNiVARpRPeDUGFKwu1xQ6m4MwJc0AqaUYhEDQDIEZD5XgKpRNh/XY6kN3FuKBeoWphcmyh1FDrWEqS/MVuDlxOWxhewB1Hol69oT6VOhBV86+C3YXSQPgxLPO0qifj3No/J57akepIIXL2zuSlzWqzJRHiFfFz1HlcS9m0xXr2zDtkStPauXbK7Z+MRzoKKeROjkecRm/+GFkAo/5a6JxEKoaMGMPd9oi3kO X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2016 13:50:39.9855 (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.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB0807 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 Limit the number of SG elements per work request to what the HCA and the queue pair support. Fixes: 34693573fde0 ("IB/srpt: Reduce QP buffer size") Reported-by: Parav Pandit Signed-off-by: Bart Van Assche Cc: #v4.7+ Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Nicholas Bellinger Cc: Parav Pandit Cc: Laurence Oberman --- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 ++- drivers/infiniband/ulp/srpt/ib_srpt.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 4a41556..9a3b954 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1601,6 +1601,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) struct ib_qp_init_attr *qp_init; struct srpt_port *sport = ch->sport; struct srpt_device *sdev = sport->sdev; + const struct ib_device_attr *attrs = &sdev->device->attrs; u32 srp_sq_size = sport->port_attrib.srp_sq_size; int ret; @@ -1638,7 +1639,7 @@ retry: */ qp_init->cap.max_send_wr = srp_sq_size / 2; qp_init->cap.max_rdma_ctxs = srp_sq_size / 2; - qp_init->cap.max_send_sge = SRPT_DEF_SG_PER_WQE; + qp_init->cap.max_send_sge = min(attrs->max_sge, SRPT_MAX_SG_PER_WQE); qp_init->port_num = ch->sport->port; ch->qp = ib_create_qp(sdev->pd, qp_init); diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 3890304..d444f8d 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h @@ -106,7 +106,7 @@ enum { SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2, SRPT_DEF_SG_TABLESIZE = 128, - SRPT_DEF_SG_PER_WQE = 16, + SRPT_MAX_SG_PER_WQE = 16, MIN_SRPT_SQ_SIZE = 16, DEF_SRPT_SQ_SIZE = 4096,