From patchwork Thu Jul 21 20:03:30 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: 9242441 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 5035860574 for ; Thu, 21 Jul 2016 20:04:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4214127A98 for ; Thu, 21 Jul 2016 20:04:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3652927D85; Thu, 21 Jul 2016 20:04:01 +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 C690127A98 for ; Thu, 21 Jul 2016 20:03:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914AbcGUUD7 (ORCPT ); Thu, 21 Jul 2016 16:03:59 -0400 Received: from mail-sn1nam02on0046.outbound.protection.outlook.com ([104.47.36.46]:27472 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753877AbcGUUD5 (ORCPT ); Thu, 21 Jul 2016 16:03:57 -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=MaOAhWqjL3vJUioO3MKSX6j9SbRf7Br3Pp7DeguLNBY=; b=YUhEBIRYu27Kj4LMhFG4sBKtS+91aMxbdGkLO/jA6o0AXTgXjREoiaoBOiILZQEtrZIgwewKpocBIK/iLagzqbhz6Mwaq7XaofLrZ2u9ADMrGQo6b0Kd4aWjppMw8XPKfJCKQvCV3oU4gV/qjnXBCWflMZ7egugZNp1WrL0ZU8k= Received: from BY1PR0201CA0032.namprd02.prod.outlook.com (10.160.191.170) by BLUPR02MB1698.namprd02.prod.outlook.com (10.162.213.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Thu, 21 Jul 2016 20:03:32 +0000 Received: from BY2FFO11FD055.protection.gbl (2a01:111:f400:7c0c::176) by BY1PR0201CA0032.outlook.office365.com (2a01:111:e400:4814::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10 via Frontend Transport; Thu, 21 Jul 2016 20:03:32 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.de; 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 BY2FFO11FD055.mail.protection.outlook.com (10.1.15.192) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Thu, 21 Jul 2016 20:03:31 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [172.22.12.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 39.A6.03698.83921975; Thu, 21 Jul 2016 12:57:44 -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.301.0; Thu, 21 Jul 2016 13:03:30 -0700 X-AuditID: ac160c71-eb3ff70000000e72-9d-579129381d91 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id E8.C4.02783.29A21975; Thu, 21 Jul 2016 13:03:30 -0700 (PDT) Subject: [PATCH v4 2/5] IB/core, RDMA RW API: Do not exceed QP SGE send limit To: Doug Ledford References: <75fc8647-16a6-5a89-400f-f5f418a8d6eb@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Steve Wise" , Parav Pandit , Laurence Oberman , "Nicholas A. Bellinger" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: Date: Thu, 21 Jul 2016 13:03:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <75fc8647-16a6-5a89-400f-f5f418a8d6eb@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42JZI8azSNdCc2K4wd0bohYvz39gtVi5+iiT xbNDvSwW5z+8YrJoW32G0aLxkoHFutfvWSz+re1mceDw2DnrLrvH+XsbWTzubz/C5LH7ZgOb x6Pn5xg93u+7yubxeZNcAHsUl01Kak5mWWqRvl0CV8b1A5tZCx6JV7xbepe5gXGxcBcjB4eE gInE/bPBXYxcHEICS5kkHkzZwQLh7GCUeLqsj6mLkROsaP/Ly2xQVYwS/U1z2UG6hQV8JTr2 VIHUiAioSWx6tYgdxBYSsJM4tWEL2CBmgfVMEn+W3WYBSbAJGEl8ez8TzOYFKmpY3gtmswio SjQuWQrWLCoQJjHt7lt2iBpBiZMzn4DVcArYS2xvb2UB2cssoCmxfpc+SJhZQF5i+9s5zCC7 JATuskrc3PUV6gh1iZNL5jNNYBSehWTULIT2WUjaFzAyr2IUy83MKc5NTy0wNNErTsxLySzO 1kvOz93ECImlwh2Mr297H2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63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(52084003)(189002)(199003)(65956001)(77096005)(8936002)(83506001)(92566002)(64126003)(68736007)(31696002)(8676002)(47776003)(33646002)(23676002)(2906002)(65806001)(50466002)(36756003)(305945005)(575784001)(50986999)(54356999)(76176999)(5003600100003)(87936001)(7696003)(356003)(7846002)(229853001)(4326007)(86362001)(2270400002)(4001350100001)(81166006)(586003)(106466001)(81156014)(19580395003)(6806005)(189998001)(53416004)(31686004)(19580405001)(11100500001)(69596002)(97736004)(2950100001)(110136002)(230700001)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB1698; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD055; 1:aq9y6WP9H10EvwWoU2m992Jyh2qcGNKYKz9JmGj7snicTFEsPOjmmLzCyG4+4HT3/Gt+VW/C8KbwLRseUIWGq1gteWAmVHTNiwHeL2FmpdkcIFmoiTMWU16dx74/SBA54XrhhOd0dwS7UlKBAvEgmc6Ax2AGn07V/l1dTRVRWIAwOkbowbzQBZRwAsJYwS+gxL8N+hW4ptySf1ZYjvJ0ZZaYELHtxTIknkBGaewnyE8K9wkShTN26W2NpBrAE1ZUG2kdU3SL4TLatJA+HGPENGEr/2gy1P6o1zRfEcpdQk6jYsSXPH266WQV/IGKu7YuX0flBgYpWUlZTGxm3CQM2Pd0EfoRmj5IwyPjtnY7BmdzgbPDHJTosghx1YUThqXjOj+cb0SQn1eo5pf/wb+ILynMC+GFAnAvDrczjk122YJ18dkx8tWMVmj+cD3Rb8tvGiBmWBm2EGIZ5AYlrLRVn24deXPmSTowEXwIa2y5YWhtW3epOUHUJcJYtnh4noinEDH1VUhc4mGvgcaydL1byg== X-MS-Office365-Filtering-Correlation-Id: 656c34bf-33fa-4531-b4fd-08d3b1a2176e X-Micro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vIaJ+J6m/JehErgcStFOTsHapmCgGJzRsgB3rnvkURDtKUuhrBv1J6ci1j5QEuTtP9+oaNpdMLJzeeCNpk907uUTKdZZAIeZrir+y5tWmVQvureKvj40Eodwq5ke6Vma91QMQ7bb1ceNO+HjO84BFYqeH++6QEp8TCZQkVqa6GaN0GEfBbe8nLgcpCw==; 20:h1xpMld6mcsoUM0WdEtRSaZbIxVAyE1rJ82qoY2IH8wBZ/DRlfP1kI2XU7LCshhQzbOMpCJ0aAvInATN1atjr0n0T2KhW0KfWObDekv0DhCYS87fayOyifOItgI+nX5ecN52376NqER6SdmrSUzBfhpSUWaGiWoMb1mBKEDSx2MomUa6APVPiSbha/wtzCYwdwDH/KNsCncSqZcbMqaJWEGNEMG9AOvTju+Od3Pl+lucVfx5DWeBSVAD9zGELv5dD85A6ZUHWSW894SPLRYYR/pSvgl+Ai3gg4756QbgOVk7e2Vmisv9aE2OBzdY+kcRSKJnI+tahlyrf1YRtPd/UonYr0UhWcbtdNCatk5iBQGIUnDWupwftWeX0kROFNmWC88nRyqeT/2ssLW8uwNPsnPzS50++Y9cTgx1KECdCKOYfYkTV/qTxOUAivZ556LxrbsM4wUL/yVI9//1UbhfxU3182BlSBVcTswm/1CeC4dLUWCptVt88KfnZl76o0rR 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)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(6055026); SRVR:BLUPR02MB1698; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB1698; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1698; 4:zE91x/GJojTIlRkWhCN2S3/K5QBJeDIEuhnHQew2q2nmSL7ljX3FDEVri3JN6YfxdipvMx2nuEswzHO4ZZkdauZX5RESthnYEG2XLafhEa5DzkpcsjIHE0uDRN5xMfWiBHtLeOl9/IdYV+LD9Z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PL7wfwSwaDQQWenijo4LmwdnFvPqA=; 7:d1wlrQC5/7sFF/BH264ptIFyFaxa/y3KQZdhti6RscOUPgFSUoK6BUIyA6kVM/P03kfhBi9gUNZEGfejkFYClN2opTI51cbQouNtLVNbMIHhHXL6xuCzS37kU6FNO6GHxl5rn4fDqIvF4zojzFAeP1DG7AyiGHDQReIdvSqLwYwVDzmhOlsDQ0QuZsux+xxTcOOLjMnGpKpUQYbw4xXZJK/9LgTBPfJkVFQg3/mFNjg4JuB54pn9p5vo5QBQm5lp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1698; 20:geEBcPx0Ik4Myy09S1EHbfQUTdviKHVPknW9F8BsCISQ+E/HzaNt6yDJJ1yeURTD34x2PiiVmZFAwewvSRLWub7ECnC1jqNV2dNqB/Se50DwhXXSKyMdxtIKoQ+0PEMTKI4uSRfzLgiKE+CaxblQ2ejc0tEZqNvrnsQ0f7sEm8tdjrt2J5HxNm29MQT2BBeZCbnp0N2MUqF3MDq3y19jZTdYk+QdMDG1SQuh/KPsRzRvEQOxiVOn17HUswW742m4 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2016 20:03:31.9237 (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: BLUPR02MB1698 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 Compute the SGE limit for RDMA READ and WRITE requests in ib_create_qp(). Use that limit in the RDMA RW API implementation. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Steve Wise Cc: Parav Pandit Cc: Nicholas Bellinger Cc: Laurence Oberman Cc: #v4.7+ Reviewed-by: Christoph Hellwig --- drivers/infiniband/core/rw.c | 10 ++-------- drivers/infiniband/core/verbs.c | 9 +++++++++ include/rdma/ib_verbs.h | 6 ++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 1ad2baa..dbfd854 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -58,13 +58,6 @@ static inline bool rdma_rw_io_needs_mr(struct ib_device *dev, u8 port_num, return false; } -static inline u32 rdma_rw_max_sge(struct ib_device *dev, - enum dma_data_direction dir) -{ - return dir == DMA_TO_DEVICE ? - dev->attrs.max_sge : dev->attrs.max_sge_rd; -} - static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev) { /* arbitrary limit to avoid allocating gigantic resources */ @@ -186,7 +179,8 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u64 remote_addr, u32 rkey, enum dma_data_direction dir) { struct ib_device *dev = qp->pd->device; - u32 max_sge = rdma_rw_max_sge(dev, dir); + u32 max_sge = dir == DMA_TO_DEVICE ? qp->max_write_sge : + qp->max_read_sge; struct ib_sge *sge; u32 total_len = 0, i, j; diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 6298f54..e39a0b5 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -814,6 +814,15 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, } } + /* + * Note: all hw drivers guarantee that max_send_sge is lower than + * the device RDMA WRITE SGE limit but not all hw drivers ensure that + * max_send_sge <= max_sge_rd. + */ + qp->max_write_sge = qp_init_attr->cap.max_send_sge; + qp->max_read_sge = min_t(u32, qp_init_attr->cap.max_send_sge, + device->attrs.max_sge_rd); + return qp; } EXPORT_SYMBOL(ib_create_qp); diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 7e440d4..e694f02 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1428,6 +1428,10 @@ struct ib_srq { } ext; }; +/* + * @max_write_sge: Maximum SGE elements per RDMA WRITE request. + * @max_read_sge: Maximum SGE elements per RDMA READ request. + */ struct ib_qp { struct ib_device *device; struct ib_pd *pd; @@ -1449,6 +1453,8 @@ struct ib_qp { void (*event_handler)(struct ib_event *, void *); void *qp_context; u32 qp_num; + u32 max_write_sge; + u32 max_read_sge; enum ib_qp_type qp_type; };