From patchwork Tue Jun 28 11:28:54 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: 9202991 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 842476075F for ; Tue, 28 Jun 2016 11:31:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75243285BD for ; Tue, 28 Jun 2016 11:31:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68BDF285F7; Tue, 28 Jun 2016 11:31:17 +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 92864285BD for ; Tue, 28 Jun 2016 11:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbcF1LaP (ORCPT ); Tue, 28 Jun 2016 07:30:15 -0400 Received: from mail-by2on0094.outbound.protection.outlook.com ([207.46.100.94]:54991 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752138AbcF1L31 (ORCPT ); Tue, 28 Jun 2016 07:29:27 -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=yWMqhHvB6xPVff/WM0DhZp8Trk5yJR9wRHL1rzu/Wtk=; b=Z6YdG15gIjJIpyPmYr0toQLofZy628PbX/HlBI7pwV7j+i9JCENJQNFc+Zl5Gdgp7UILYW7hmfXfasGyVC3M7DkJriWwdX/sAx75zr4oqVvp7+Lth8c8ZZ5doZe4LuJMSUGmVBy7cptsms+fMaSCSBeha0Xk5Vf8n3OFz8daeOY= Received: from BLUPR0201CA0013.namprd02.prod.outlook.com (10.163.116.23) by BL2PR02MB499.namprd02.prod.outlook.com (10.141.95.143) with Microsoft SMTP Server (TLS) id 15.1.528.16; Tue, 28 Jun 2016 11:29:03 +0000 Received: from BL2FFO11FD009.protection.gbl (2a01:111:f400:7c09::126) by BLUPR0201CA0013.outlook.office365.com (2a01:111:e400:52e7::23) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Tue, 28 Jun 2016 11:29:03 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) 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.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 BL2FFO11FD009.mail.protection.outlook.com (10.173.161.15) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 28 Jun 2016 11:29:02 +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 86.70.03023.E2E52775; Tue, 28 Jun 2016 04:23:26 -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, 28 Jun 2016 04:29:00 -0700 X-AuditID: ac160c69-6db3098000000bcf-79-57725e2e0709 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 76.A4.02607.77F52775; Tue, 28 Jun 2016 04:29:00 -0700 (PDT) Subject: [PATCH 4/5] IB/srpt: Limit the number of SG elements per work request To: Doug Ledford References: <419391ba-0c39-11ce-f249-84b428dc73d5@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Nicholas A. Bellinger" , Parav Pandit , Laurence Oberman , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: Date: Tue, 28 Jun 2016 13:28:54 +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: <419391ba-0c39-11ce-f249-84b428dc73d5@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42JZI8azSFcvrijcoGmhtMXL8x9YLVauPspk 8exQL4vF+Q+vmCzaVp9htGi8ZGCx7vV7Fgd2j52z7rJ7nL+3kcXj/vYjTB67bzawebzfd5XN 4/MmuQC2KC6blNSczLLUIn27BK6MG1f3sBZ8ka/Yuf4+YwPjZKkuRk4OCQETiX8/tjJ2MXJx CAnMZZL4sGg7G4Szg1HixuZDjDBVXy/eZYVILGWUeLruHTtIQljAT6Jp3n1WEFtEQE1i06tF YHEhATuJN23fmUEamAWamSR2/T7HBJJgEzCS+PZ+JguIzQtU9HPDDWYQm0VAVeLV1T1g20QF IiR6fy2BqhGUODnzCZjNKWAvcfj0S6DzOICGakqs36UPEmYWkJfY/nYO2C4JgbOsEkva57JB HKEucXLJfKYJjMKzkIyahdA+C0n7AkbmVYxiuZk5xbnpqQWGpnrFiXkpmcXZesn5uZsYIbGT uYPx7hPvQ4wCHIxKPLw76grDhVgTy4orcw8xSnAwK4nwNgMjT4g3JbGyKrUoP76oNCe1+BCj NAeLkjiv270vYUIC6YklqdmpqQWpRTBZJg5OqQZGW5+9l3yPpGS8PrGUw0X9tsfJs6evzEnt 8ZFc8PVDo00do8bUE0nbTsWo8a0uk/FfwXbXb0kab+7ChYtdLNaZzGxm3TdByPLW5m8TTk/d w7RG2KpQNWZvikKavFfsRp2dIWmzVlrkXI+bWnrefsJs5nN2573Mrn685eXoYsXZ+WW5WXVL /vlFSizFGYmGWsxFxYkAe8EThJkCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsXCtZEjRbcmvijcYM5ydouX5z+wWqxcfZTJ 4tmhXhaL8x9eMVm0rT7DaNF4ycBi3ev3LA7sHjtn3WX3OH9vI4vH/e1HmDx232xg83i/7yqb x+dNcgFsUVw2Kak5mWWpRfp2CVwZN67uYS34Il+xc/19xgbGyVJdjJwcEgImEl8v3mXtYuTi EBJYzCjxaHIXI0hCWMBPomnefVYQW0RATWLTq0XsILaQgJ3Em7bvzCA2s0Ark0T7VxkQm03A SOLb+5ksIDYvUM3PDTfAalgEVCVeXd0DNlNUIEKi99cSqBpBiZMzn4DZnAL2EodPv2SDmKku 8WfeJaj58hLb385hnsDINwtJyywkZbOQlC1gZF7FKJabmVOcm55ZYGioV5yYl5JZnK2XnJ+7 iREcvpyROxifTjQ/xMjEwSnVwFhhdiU8w+FD/+7PjJ8Ly1/8Odf7X0A6mWWToH1wmY6epO3s L2taBB3FdI4vuMPzW9pvQ8zBPpvoxiVGJ6Zbv/2tsbW1YcKKysY3Vxi2vfh+NPrUpW2f/3Uo baqaMuHSDjZDxUjeTYVpD2693+bQ9izIJ/2I0eoCAz4n+QDbDUJd08KftMfHvlViKc5INNRi LipOBACMeFGfDwIAAA== 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)(52084003)(199003)(189002)(64126003)(65956001)(2906002)(4326007)(65806001)(5003600100003)(86362001)(305945005)(586003)(47776003)(230700001)(7846002)(7696003)(81166006)(356003)(81156014)(8676002)(2270400002)(19580395003)(19580405001)(69596002)(6806005)(83506001)(68736007)(31696002)(50986999)(76176999)(54356999)(97736004)(87936001)(77096005)(8936002)(11100500001)(36756003)(106466001)(110136002)(53416004)(229853001)(31686004)(4001350100001)(189998001)(23676002)(33646002)(50466002)(2950100001)(92566002)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB499; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD009; 1:2ZXT7XKhl2paCLcP0qvD85lHjNjQ+op0gHKJ7STe/KebB7hN+oKFMWc0H7T+gUGhshq7h1250aX29Z2dwZXnpodpqHA7HEI5O8oGL+oVoxlhW9K53zrIlT5C/175cPjdtLhs/Xt1P2+lV+HbUIOExrht7Ez6+MKdIk0rgmANNLH+pePHHSoxbnTyBFPXScR47cruv1eOpvtyL/5T8zcj0+NrvOnok05j2SAQKzG0Rp9iMFDzBDyqU9JhEXJP/uhRBlVq9PVH8jVomKiW0JSQ8o0auTG698cvS8uZY/i8I1BKmRR1w9v3BAme0TYCVwnMs0uTFCo36GSUG3Z+C8XswmiIL1iBbUyGGWe2RYk00hsj3hh366rofx7pb+NvLRmBbbeYo/UpNvR/p01ZKJYXyBoJaeLuHqG4N+hzHTKvR/ULgodS2wASK8729b/dnj/ffFO08jT7RAjjxbKgQruaUsODCyf302b1VtIkdlw8TF5rfM7lbxQMnq0/YEiiCAFH1S7Yl7i/BGYQLMhbUSs6bQ== X-MS-Office365-Filtering-Correlation-Id: 002abaa9-2606-483c-80ed-08d39f476859 X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB499; 2:IYSve0JxMzbR+npIaKwTNQuq/pRiBvkmOH+UU8UwxJ4VvgwIJOLtEfcVxX5PbUbIuJqElvE1bjAT/gFjanks3Kzwb9wovy2oZ88TZXrq0uruBlJRLbq6QQ+nKw4k4eDBJUSYYNeyvC3l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Aw==; 20:yGl59me5u7uGOGKEExK7K1qsyRwxnteleU0Y3yTIBQbF7VGq+99de9vdlzkleuB7QbvjxNiY5ylGep9yoRnRdKoRiH8vfkJdmWx8SSRRgiHxRXj0UvaGCjdRTUiMH7UsZWeCjkJ/90dcM94iNRBNArrNnt1oH28Z1pnyh2jqgRC+WbFza718N8aBh1zU+Vsk21IhKaaO60YL5t+vGNeK03DFBxsJrGaiLeTUmdSWpEVVnQhdkjJd/2q6Q0tyJ/Dh/706Xk7tYnIBc/vsQEWnz1g62yXsDS+Sb3ZRduH5Wgl1AIhhtPGOPgxHiXLgSXrAJ0IfZ1ZyhjdSOzvwRIjjKplyL5fIA89d4McpJQXozuTrDC3bCFNDUbJgrglBPhvIpXYVUOTU3N9MxpXUqCY+H2XuDIpsmeiyFz9Oc4YP9tzcF2QUY9kJRuYHITT9ZbcPwmDs/J9QA+YDzgoeqAQdAVpJsRNGW/ni5L2mryQ8F3ktvsDpTR5O3AmWmilBWwhP 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)(10201501046)(3002001)(6055026); SRVR:BL2PR02MB499; BCL:0; PCL:0; RULEID:; SRVR:BL2PR02MB499; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB499; 4:ohVwm8n3x+0v2VEXjlSF0JqqPKXqC2YSUhRprrK7Ju8AP0NoMsGFJDyyjMk4AJB9uMDt+Sx2fYjnKED2KeZZcILwqu3Iz8WZU4lBwD3AtA42YI17euveGxPRSpj87155rO2eW1day8dYcHFBFP2lZP8gEuXc44mvfRoLt+vsCTrJwX1Ox+oG35MCXjo/gBE3WYpg3TGcQz3n3zc/Pk4jd6rYQ4YI2IPlNPJmFjVJAy817dx3SabKgR3xo99PGvx38NsjHV2ufVDPyBl+kBVNwIlsBeceEw6gLRCb9OFgins/ymwG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xIiBOUbaOlThlEoMImoeBeE7iPpJQggbp9pwoHZdfFB1r3cAcq3WGnpLQ0iUEbyzbmT3cwEuBPHZx9vrSHwtt5+KwrDacxnJf8Rml9bE31S84wD3u3pnhO2Sm1FtWNh73R1/0khbRvKVbe3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB499; 20:w1LfM6O5J79i7tliBrzOpTosp7al1XICH86wBbG9SqlaMVLmityG540xBJ+vbciZbn2HhVPLinybOiciLlfk+nsNbGmN8wa8EQoKNz8IcnmtKvokW2vUOLsSRTqaxnZzQW+SzBiAY1ZhGrlXh1UwbVGm0NjmacykcpRQSm7+t3wQHywsOPXJGKZz9xYJye+djd8ljHqHPlBv+xPChhbSLnsWMbHLRUqt1t8thJRLU7DlnSu65lCCDr6wGClZIGPT X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 11:29:02.5010 (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: BL2PR02MB499 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") 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 | 17 +++++++++++------ drivers/infiniband/ulp/srpt/ib_srpt.h | 6 +++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 2ed65f5..6314d10 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -803,7 +803,6 @@ static int srpt_alloc_rw_ctxs(struct srpt_send_ioctx *ioctx, { enum dma_data_direction dir = target_reverse_dma_direction(&ioctx->cmd); struct srpt_rdma_ch *ch = ioctx->ch; - struct ib_device *dev = ch->qp->pd->device; struct scatterlist *prev = NULL; u32 max_sge; unsigned prev_nents; @@ -818,8 +817,7 @@ static int srpt_alloc_rw_ctxs(struct srpt_send_ioctx *ioctx, return -ENOMEM; } - max_sge = dir == DMA_TO_DEVICE ? dev->attrs.max_sge : - dev->attrs.max_sge_rd; + max_sge = dir == DMA_TO_DEVICE ? ch->max_send_sge : ch->max_recv_sge; for (i = ioctx->n_rw_ctx; i < nbufs; i++, db++) { struct srpt_rw_ctx *ctx = &ioctx->rw_ctxs[i]; @@ -1607,6 +1605,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; @@ -1644,7 +1643,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); @@ -1663,8 +1662,14 @@ retry: atomic_set(&ch->sq_wr_avail, qp_init->cap.max_send_wr); - pr_debug("%s: max_cqe= %d max_sge= %d sq_size = %d cm_id= %p\n", - __func__, ch->cq->cqe, qp_init->cap.max_send_sge, + /* + * qp_init->cap.max_recv_sge is not relevant for SRQ so use + * max_send_sge instead for SRQ. + */ + ch->max_send_sge = qp_init->cap.max_send_sge; + ch->max_recv_sge = qp_init->cap.max_send_sge; + pr_debug("%s: max_cqe= %d max_sge= %d w %d r sq_size = %d cm_id= %p\n", + __func__, ch->cq->cqe, ch->max_send_sge, ch->max_recv_sge, qp_init->cap.max_send_wr, ch->cm_id); ret = srpt_init_ch_qp(ch, ch->qp); diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 3890304..b0876d9 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, @@ -235,6 +235,8 @@ enum rdma_ch_state { * @cq: IB completion queue for this channel. * @rq_size: IB receive queue size. * @rsp_size IB response message size in bytes. + * @max_send_sge: Maximum SG elements per WR for send requests posted on @qp. + * @max_recv_sge: Maximum SG elements per WR for recv requests posted on @qp. * @sq_wr_avail: number of work requests available in the send queue. * @sport: pointer to the information of the HCA port used by this * channel. @@ -265,6 +267,8 @@ struct srpt_rdma_ch { struct kref kref; int rq_size; u32 rsp_size; + int max_send_sge; + int max_recv_sge; atomic_t sq_wr_avail; struct srpt_port *sport; u8 i_port_id[16];