From patchwork Thu Jun 30 13:49:44 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: 9207647 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 8E3DA60752 for ; Thu, 30 Jun 2016 13:50:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F37B284A4 for ; Thu, 30 Jun 2016 13:50:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73BE3285BA; Thu, 30 Jun 2016 13:50:19 +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 0CFDB2867D for ; Thu, 30 Jun 2016 13:50:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbcF3NuM (ORCPT ); Thu, 30 Jun 2016 09:50:12 -0400 Received: from mail-by2on0086.outbound.protection.outlook.com ([207.46.100.86]:23584 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751945AbcF3NuF (ORCPT ); Thu, 30 Jun 2016 09:50:05 -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=n1k+XZTznBMyuuQxm5gUs9fEe/Ng55hTzqlz2LtxDH0=; b=TYCh1VLKu/9KL42IafhPWQrrdoqnMLmuiTLezYxJIF2KEv/l0xdlc8AQ4f2vIBkEa+ykTI2sfGdpD1vlvBOIF4RejUARkqHGPNSyi/CnYY3i2OLkvR30TPHHULBU1U3lTNyC/eU8/8dO16CdftRoQzJWCgG79pLXsANaBJWq7O4= Received: from BY2PR02CA0080.namprd02.prod.outlook.com (10.242.32.38) by DM2PR02MB512.namprd02.prod.outlook.com (10.141.86.28) with Microsoft SMTP Server (TLS) id 15.1.523.12; Thu, 30 Jun 2016 13:50:01 +0000 Received: from BL2FFO11OLC011.protection.gbl (2a01:111:f400:7c09::144) by BY2PR02CA0080.outlook.office365.com (2a01:111:e400:2c2a::38) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Thu, 30 Jun 2016 13:50:01 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; grimberg.me; dkim=none (message not signed) header.d=none;grimberg.me; 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 BL2FFO11OLC011.mail.protection.outlook.com (10.173.160.157) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Thu, 30 Jun 2016 13:49:59 +0000 Received: from MILHUBIP04.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 70.DE.03838.F5225775; Thu, 30 Jun 2016 06:45:04 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.279.2; Thu, 30 Jun 2016 06:49:47 -0700 X-AuditID: ac160c71-d741198000000efe-29-5775225f2042 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 78.5B.03875.87325775; Thu, 30 Jun 2016 06:49:47 -0700 (PDT) Subject: [PATCH v2 2/5] IB/core, RDMA RW API: Do not exceed QP SGE send limit 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: <7b9f8bca-38fa-b289-a92f-19cf93955e32@sandisk.com> Date: Thu, 30 Jun 2016 15:49:44 +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+NgFprAIsWRmVeSWpSXmKPExsWyRoxnkW6CUmm4wYbz7BYvz39gtVi5+iiT xbNDvSwW5z+8YrJoW32G0aLxkoHFutfvWSz+re1mceDw2DnrLrvH+XsbWTzubz/C5LH7ZgOb x6Pn5xg93u+7yubxeZNcAHsUl01Kak5mWWqRvl0CV8bsr83MBbuEKuZ+ncbUwDiZv4uRk0NC wETi3N8jzF2MXBxCAnOZJA6fWc0E4exglPiy7DEbTFXP3g6oxFJGiX/LOllBEsICvhLT7j1h BLFFBNQkNr1axA5iCwnYSczZMBesgVlgPZNE95TlYJPYBIwkvr2fyQJi8wIV/b7wHyzOIqAq 8XTdTWYQW1QgQqL31xKoGkGJkzOfgNmcAvYSO3YuA1rMATRUU2L9Ln2QMLOAvMT2t3PAXpAQ uMsqsXvTdDaII9QlTi6ZzzSBUXgWklGzENpnIWlfwMi8ilEsNzOnODc9tcDQRK84MS8lszhb Lzk/dxMjJJ4KdzC+vu19iFGAg1GJh9eBuSRciDWxrLgy9xCjBAezkgjvK/nScCHelMTKqtSi /Pii0pzU4kOM0hwsSuK8F6M/hgkJpCeWpGanphakFsFkmTg4pRoYpSbWTlmo1r8z8rpXlcNt jfnJUp65iwqDHHvi3eKSHy04lhH7zFTpVhNH9L+4uKq9e9+FNLTv3N1Y3TYpNJdBwvHhkqUG x9yevc17ZN77duJR1iBZYyWTCeVb/fx3zSqbUXi8VKP4w3UrKfWzzmsa1i9Z+OjCmf26ZzUf p4VkJm0MrTqy+v5xJZbijERDLeai4kQAW0ok2qMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnluLIzCtJLcpLzFFi42Lh2siRolutXBpuMP8qh8XL8x9YLVauPspk 8exQL4vF+Q+vmCzaVp9htGi8ZGCx7vV7Fot/a7tZHDg8ds66y+5x/t5GFo/7248weey+2cDm 8ej5OUaP9/uusnl83iQXwB7FZZOSmpNZllqkb5fAlTH7azNzwS6hirlfpzE1ME7m72Lk5JAQ MJHo2dvB1MXIxSEksJhRYuquuYwgCWEBX4lp956A2SICahKbXi1iB7GFBOwk5myYC9bALLCe SaLv8wMmkASbgJHEt/czWUBsXqCi3xf+s4HYLAKqEk/X3WQGsUUFIiR6fy2BqhGUODnzCZjN KWAvsWPnMlYQm1lAXeLPvEvMELa8xPa3c5gnMPLNQtIyC0nZLCRlCxiZVzGK5WbmFOemZxYY GukVJ+alZBZn6yXn525iBAc1Z9QOxusTzQ8xMnFwSjUw8vtrFNaudzmt9MRNZspF48f60gV3 PeYx6OXsdGRov3To8/prMu1133MneB1W15HNrOKX2fjPTklla5zuLmWFyulSM83Vjyjt/9bU XcB114p1Y2lXz+8Cr+/8DfVurYaqT1fyn3ad+U++e+WTko9CZnf0Ffe/YRVevrhhd+A0uy3t XK1B+UpKLMUZiYZazEXFiQB9DIkOGgIAAA== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(64126003)(36756003)(33646002)(86362001)(92566002)(76176999)(19580405001)(50466002)(69596002)(230700001)(54356999)(586003)(19580395003)(83506001)(7846002)(50986999)(356003)(81166006)(81156014)(6806005)(2950100001)(11100500001)(8676002)(31696002)(229853001)(87936001)(106466001)(110136002)(189998001)(77096005)(65806001)(65956001)(2906002)(68736007)(4001350100001)(5003600100003)(4326007)(7696003)(53416004)(8936002)(305945005)(97736004)(31686004)(47776003)(2270400002)(23676002)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB512; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC011; 1:Fr7cdITiluMTjEu9cdf2pI9xFqG/XRzAB84NGWmDtqbOzzUfptgZNHMFrqL8TVYPCZDYCb6e7N+B1jIaZCqjLALjd+8J+RJtqHor1a4LwaigMbcrcf45GTJmPgzGF+OMHUC/ydPcdibqVnN9JHIitsmohBjw3dKNsViqCTYIEkstOMmrLS/MOp/SM+dhc23btIjYdYdoXuba04C2sn8Ki1Nq9VI0ClgoLZqQ/fKtplXZg6bDixhrCAFwdlyKQlIYBlWE/ha4uixNBae5t65R3qgEYVoKz9/8BYpwYXg5s/oBstBmwWwMGLVbMBI/OacPDAKRkO9bSjztr836xZC5DX7bK52eUB2G+BLsZRV6A5UuaBdapJDn+Rw9yruiKnJr4h0kFI7KXkZis1kh8mzfHAS+8cxe8dHIFkCNDqT56Yv4A0Ujz0k4l3IuARNhkxlZqqUzMntGbiA1TexJTSiQLD8rHZBViac6lnQymBi/zyX1bk/23d8qMSfAmLNWtzKuvLfEfKFq4FCe8TmY6JfF7g== X-MS-Office365-Filtering-Correlation-Id: 2b514166-1c01-4640-0c9d-08d3a0ed6e37 X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB512; 2:NKoIVZ9SvH20gowveTp6bprOQ/6zhBLvuA2vxvp+Hj32QZ2UmJxFAyI/vB5r+Z3gQiu8eJwSw0Rqy0UZe8eaQzL0seZ1jancjU9GWrplxvFYAr+7wiD6WhYdEBbvlg246mgU7iC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OXEH940K19rDKLWdTMaUYmjk29z6An1qKSkYka7Kr2TpVA1nVCNbZtvRBr4EIDGsg9scob7Cc/5Y1W3H9Jgyp6PyhUCdEErhXfJwPCBinEyS9IFW+ze0pL0RWmkjsXTxcu/B8cQjmVpTC5IbAw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB512; 20:5LxkYvNOOrhH/Rzu9oA5nckOUll+5zyZhO9csSI9OnGh3Mma+KyDl8IrMkceKPuBjJRhM6gg9Cm7SvMQ2QKbso32s4WMuw9Dqxb31LkqHYPhPMmtsSHnw5NoOgRvxXYhATGVYFMmYQqdZ/XY/oOffKJ/1nzPUkW2Z+8qfNbA5wE11tw/eL5QMZeqjQLE1LdI7Fc4QhpN/H9HQJSHrZ+77sbSbxNeg6NB5RDmYqxcbNrfu1a28FyEihVCFL9R8CDHAa/IEN0FOtn0r9R/5AJ2zYGlZaRnKP2VUUjEjFAT9iBXy7jMUEzMifSpXBuIsR+9kq7aBkIjRkk2Mcj20RCIPnP9st0jUIuGJRls1G9H+rZ6gwOFQyRteFi03/GmTSqiEO5Ob8tyUF53O9rLCKEKK7uqJUw17snPKCMLXrrDzMZa7Rza0WAj47dlMeH6ChikjjH3bpD4PQ6VKqnZ9owBJ57tzbEEZMWML/QD4YPiQ3z02EQu6dJ4Hr+381kXVpKV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001)(6055026); SRVR:DM2PR02MB512; BCL:0; PCL:0; RULEID:; SRVR:DM2PR02MB512; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB512; 4:TpyGaqf3PIt2i4Zr41YCwu44+0xJujWF4aAYwm0nUwQinLYmA8G1tl7O8Y0Vg7V259zl0E7PWEHdx9ZaZZ2NDIDp1GQDU0QeKZo1aYqfmFxoZZMxxIlT1cwpbyG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Ic2aXo074TlLe8LMW2uyJ5QtXsk99z8EDkiqQ1Z4UeF35gUh5qpcS2liW1uTIc0b7haSUiwQpZcx7/Yc3cRiC+YfDS+4oMzMPp1kTpe4hhm3b4HC1pQoFu9xW7P5LoMCFu4aF1vhoKACfStWhiJzGrgi7tLsm8sBxsre2PEF6X9flBg86Yju4q/uLPWLoGLZ9HjiQyLLkFPU3IDvJVj5mII71h9zvXrxnHv6A== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB512; 20:HvOMcVC5MyHAW/B2ZyG7AonUy2yEu7LDV+5PCNzaQgefWxpuqi8TNdnY1srTFZJHW+wpZ3rj5C5FozfjqmG0Og0P0Ff+yeS9RB/jIcM4aK4VMpLCd+V6ObFf17IwsjAZNfGqiGTBsRpd81uKuwJG+nnWqw8Ge7HUiM9WLGpZka5XSvmfWymYIMtSBc0O4rIJvthRkZoef8rWTJmjRlyDuH+I5nu/7uDZC49W//ueKk6uYEX+VBI/klBIurDGZpIT X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2016 13:49:59.7898 (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: DM2PR02MB512 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 The SGE limit for a queue pair is typically lower than what is defined by the HCA limits. Hence use the QP SGE send limit instead of the HCA send limit. Signed-off-by: Bart Van Assche Cc: #v4.7+ Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Nicholas Bellinger Cc: Parav Pandit Cc: Laurence Oberman Reviewed-by: Sagi Grimberg --- drivers/infiniband/core/rw.c | 9 +-------- drivers/infiniband/core/verbs.c | 2 ++ include/rdma/ib_verbs.h | 1 + 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 1ad2baa..425e711 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,7 @@ 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 = qp->max_send_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..c7f840e 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -814,6 +814,8 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, } } + qp->max_send_sge = qp_init_attr->cap.max_send_sge; + return qp; } EXPORT_SYMBOL(ib_create_qp); diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 7e440d4..c44dbf6 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1449,6 +1449,7 @@ struct ib_qp { void (*event_handler)(struct ib_event *, void *); void *qp_context; u32 qp_num; + u32 max_send_sge; enum ib_qp_type qp_type; };