From patchwork Tue Jul 19 16:22:03 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: 9237843 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 B1B74600CB for ; Tue, 19 Jul 2016 16:38:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F66726A4D for ; Tue, 19 Jul 2016 16:38:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9059926E64; Tue, 19 Jul 2016 16:38:10 +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 E8B7526A4D for ; Tue, 19 Jul 2016 16:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbcGSQiI (ORCPT ); Tue, 19 Jul 2016 12:38:08 -0400 Received: from mail-by2nam03on0062.outbound.protection.outlook.com ([104.47.42.62]:15155 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753263AbcGSQiG (ORCPT ); Tue, 19 Jul 2016 12:38:06 -0400 X-Greylist: delayed 1030 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Jul 2016 12:38:06 EDT 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=BvLqXNI/Nvym+8JMrk/cPa/qJuoweU3B3L0UtkUDWKc=; b=m0DibI+/GUCnGkuWlnZcFZ0mJNz9/Qcbi/omvEy6At05+eDYtHnhgSOhu6XJrj26fIsFHP9g+3GDd590mBV6a8iEfnS+SLf4LK7A9MhdgQ8amDamyGdwm+UOw+PamLfdoC+AbOQccBvcneZVh5WY6srGKzJn9BLuMOmMPlxOLEs= Received: from CY1PR0201CA0003.namprd02.prod.outlook.com (10.163.30.141) by BLUPR02MB1714.namprd02.prod.outlook.com (10.162.213.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Tue, 19 Jul 2016 16:22:05 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::155) by CY1PR0201CA0003.outlook.office365.com (2a01:111:e400:58b9::13) with Microsoft SMTP Server (TLS) id 15.1.534.14 via Frontend Transport; Tue, 19 Jul 2016 16:22:05 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; linux-iscsi.org; dkim=none (message not signed) header.d=none;linux-iscsi.org; 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 BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 19 Jul 2016 16:22:04 +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 28.B9.03019.F025E875; Tue, 19 Jul 2016 09:15:12 -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; Tue, 19 Jul 2016 09:22:03 -0700 X-AuditID: ac160c69-5dfff70000000bcb-0c-578e520ffc36 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 35.9B.02783.BA35E875; Tue, 19 Jul 2016 09:22:03 -0700 (PDT) Subject: [PATCH v3 2/5] IB/core, RDMA RW API: Do not exceed QP SGE send limit To: Doug Ledford References: <8fb358c3-3504-02ca-fcb8-1624f28be1b0@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: <03e7f98e-d810-2299-9f3e-2c697d2699fb@sandisk.com> Date: Tue, 19 Jul 2016 09:22:03 -0700 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: <8fb358c3-3504-02ca-fcb8-1624f28be1b0@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI8azSFcgqC/cYO9rTouX5z+wWqxcfZTJ 4tmhXhaL8x9eMVm0rT7DaNF4ycBi3ev3LBb/1nazOHB47Jx1l93j/L2NLB73tx9h8th9s4HN 49Hzc4we7/ddZfP4vEkugD2KyyYlNSezLLVI3y6BK+PqthUsBWtEKq5tecXUwPhKoIuRk0NC wETi+akdTF2MXBxCAkuZJDZc+cQI4exglHj+oYkJpmritpdsUFWMEn8nXmMGSQgL+Ep8OXuZ BcQWEVCT2PRqEXsXIwdQkZ3E1aeFIPXMAuuZJP4suw1WwyZgJPHt/Uwwmxeo5ufOp2A2i4Cq xNSZbWDLRAUiJHp/LYGqEZQ4OfMJmM0pYC/RuvcjG8h8ZgFNifW79EHCzALyEtvfzmEG2SUh cJdVYmfDQlaQhJC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lGQIAAA== 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)(199003)(189002)(31686004)(2906002)(92566002)(53416004)(8676002)(4001350100001)(97736004)(586003)(230700001)(110136002)(68736007)(86362001)(189998001)(77096005)(11100500001)(7846002)(69596002)(33646002)(81166006)(81156014)(106466001)(229853001)(31696002)(76176999)(5003600100003)(54356999)(7696003)(83506001)(2950100001)(87936001)(2270400002)(47776003)(64126003)(4326007)(50466002)(6806005)(305945005)(65956001)(23676002)(8936002)(65806001)(356003)(19580395003)(36756003)(19580405001)(50986999)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB1714; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:eCLn4CFc5dI3ZRVYYWWzvQNnBJbULjWTKWdepoca6zHmNdhD71VXtLULyegl/JQ2WbDy3M9OgNMYQpTK55+ERRXu6zTw7YUxFrzTwaoBgACu9ZKoAu8Pz8XVRSEiYlW7A+riu8PqK6CQmrtb3etAYPj/kAsOTcwEblae6ekAGhQ4gn1zvvMSvSCI19MqGCGGDpvx9WxWiX2m0RfvkHtmBzyrvOknK/SqD8pVl3gLkdux/bD7+JtLTX8xsb3zH0j07ewwjlmV0JHRokZR/lFJvzXRa3tQ5ApaBPppQCS48dMeijQ/ud5jbo5kKIM981cKT8KzNPP2bXjnp8mc7I3pnNxjqNQedIWCTYe9vTRLefK7/CHax7IfSK67KLfkNvV+q3y2nqntO/SXL4rGhl+rMT4TD92fxqxQUwr74TzVnz0qx01Wnxp4+CU1fVPlyztT0gcoQFFUlYQg/Erj3aUT4R3jVKQva0tvvZdn+fAJUE6u/afHmCURMTtlH9MVS6ru2iiA+qa0AAimAsMKbzZ5wA== X-MS-Office365-Filtering-Correlation-Id: 41003047-524c-4489-cfba-08d3aff0d2e9 X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1714; 2:nM5KM3ZBBZrpshc5LBuDjtU8BMWk2C7YwAl2n9mb6mIaoKcOiTxFmu4raAk13IKWWlKUjUtgWPeQUKZPGcEfaqZozzfoQpqfkTL+hwA9DzbojHS3v8CO+l7m/AbG5KFwAejim79X4eUodrhsaeO5VEw2QD7+ZRJgVjoE844CqaoZIFna2VBfjiAWp+XNezEr; 3:mt/x4kpvP6Dupfp8hsAyYe7VaHUFLs4tWk2BSqDC2YTcTZSjvQmVaN7YXabTjdMxhXCHrLy+JmE01U33BpBCa6Ys4pxmrkeF8nk8Hb8oRxFF3OOZx1e0vczjkw9jS9JAMXcuU8F1fMogHZXMJG6oRozAyKNbpGF2dGwObegT94BlifON4Sy9ItUCiRZhMPCB4y05OaWFZXDYasws7Hg5A++xYphnb5MiWXbAoD5lsgd2IRsI8QHzAGEm65ol/uAWApUc9Xk2WIrfd9G4KdcVbg==; 25:XoJu2n+OKntqe1QjsmSUMZ6F/uBgnt8S38FKRCdZ8aqhtVlqtqzh508X6xbG0fD3F9z3osWWhxQARVQTz5svBcX9l2EVzzRl7SRlvTOt6CauxFhThaGhQCdi1ewUHdaqdCfKwxqkjPyJJaqiWctexcfsn4AQHhYfn5b2a5zE6+2uXzwwc16waj+vemJHIb+l4UXQkXjnSiFEFq/L9Pd9saclXb3RZcTQc671m6RcXAxRCbh+XeMEMJ+Ci1Af0Hg8QzIbL21lEEbaqoGCkObdFDEdsXnq+d2BtMD3aCjdlNRABkZx7J+ZY/kaR7fbFCKSOsP+Jr9IBYPmlrRqXezqeNqGWp/v7nbIINcvTSWL7YfWZ1AHt/cZcR8n+o2C1z1Z74uu3R5kHX8p6klsn3IteTxqreJcEutGqr4WyTDEj60= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BLUPR02MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1714; 31:b6vwAxp4hFJ6cGB2M5jU/VhYqGi4iPsBlJYTGFGnVaaFZG3oL2oZEewqV1ikJYXaDLUEK5mCjPfqyLuC/Xhb+PSEqGUwnwrt0g5nlSVs46KbYpNv4PHnkEGe5KiDmSG2M6FH4M81R7WO955mTIxT1GJn0oEQv1mTDQGTHzXhqeOy6XlUAzm7ftiRBcS/NxfMS/4rznUE81ovrTDiQBBgYw==; 20:xzxfWXmd6jDaby4JNP0L/v1CiJYE6eGq1d5ezUkRarn06SW0mJkfz9dP2ZTqJE3B/0E+QmlSopkE2jlVFoJsWiBVD/cqDbnhPHGfPdkkurTf/dwqLC6LksZb3pBCEOCKROnt36wzdNYp9PkFG5trG/uxcrSFzENM8WSj9ZDUnurBjfx83MdRfm1YwT8U9yjC67vBe64GQxpxQvphERxsHoX6kUkYkyUWw3xtgF9rDJuNkSdu0p1Wjw1sxaZS9L8sDQftOWFSr/StnWdJ2ZAb2zHzCwZGd3CL9dfITgQ4OyfCr4F8Ja/SNMmX/cDTXwkrI8EJgwK1I+2ogiU0G+Kg7gYSML7BCLPNMg9zlywrETSAQkvmgKNC0ZUUUvRd4rADYsy6iTjqQwIVp6FBDQivqK1UwrIeZ7DgRtJSiFd1hTrWgn4lMfJIbq06FBwWIuD5SUCoEqry4F806+xqS/hq6BNIJ8UH4dGolzvQTZ8+YAH2L1IeDBIY3y8ofNa3+r4P 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)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BLUPR02MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1714; 4:2n8t9wqXovFLVVbhon7giadtaiY40GpH294No/pKvZh9xrj3X0jg56YBwU3Jcyj4Bvh8BQ7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WolctnKxmGTUh8gGPoBKph5oZ7gaYKL4L15C+pKXiqQ+uNFC0pAhjkTIVjP/zOP/yWq+c8KxTg8g0DZxTMXFIv2uskF5L3wwo72XNDTsEzDZGSrRUfrjw+vtjBOnk8SA8LGdpe8XxXV8d5654DhCTQ3xIrBVnvevudZWu/fpGZvSppqorKfFENlcpvjMuoXHsR0HdouW8zda0ET5PwOK2aU3PKQIFspLPeLiU80Y1/Z9E2BdjhdvypvvOZlG8LD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1714; 20:QdCWp+60j5fB45ijFLd9gYNGMPSn2i7uMkLBrhsV6IiPnrQDX7qD0DKD18C34pCmdvOVTM3JKDZavKoNkp96E9UiwmQBsz8gVZLyZSohuJ1T9Mx0B/VN4Nn6jyZVQVbXd0FK+8LiLWCW/uvf7WnX5qrk+YpNwgCVWefVC/ki4cZrPW13vb+Xt1fKZMH5fmGaSXrUq1QEv9gxk1ly2TYJQdIn9UnWib82qOoil7bRqrJ/gseAlZQnblF/ByWcguv9 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2016 16:22:04.7122 (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: BLUPR02MB1714 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 For IB and RoCE, the SGE limit for a queue pair is typically lower than what is defined by the HCA limits. For iWARP, the RDMA READ SGE limit is defined by dev->attrs.max_sge_rd. Modify rdma_rw_max_sge() accordingly. Signed-off-by: Bart Van Assche Cc: #v4.7+ Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Steve Wise Cc: Parav Pandit Cc: Nicholas Bellinger Cc: Laurence Oberman --- drivers/infiniband/core/rw.c | 8 ++++---- drivers/infiniband/core/verbs.c | 2 ++ include/rdma/ib_verbs.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 1ad2baa..6ecdad6 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -58,11 +58,11 @@ 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, +static inline u32 rdma_rw_max_sge(struct ib_device *dev, struct ib_qp *qp, enum dma_data_direction dir) { - return dir == DMA_TO_DEVICE ? - dev->attrs.max_sge : dev->attrs.max_sge_rd; + return dir == DMA_TO_DEVICE ? qp->max_send_sge : + min_t(u32, qp->max_send_sge, dev->attrs.max_sge_rd); } static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev) @@ -186,7 +186,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 = rdma_rw_max_sge(dev, qp, dir); 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; };