From patchwork Thu Jul 21 20:03:09 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: 9242437 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 C71CA60574 for ; Thu, 21 Jul 2016 20:03:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B953227A98 for ; Thu, 21 Jul 2016 20:03:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADDA427D85; Thu, 21 Jul 2016 20:03:35 +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 76C9B27C0B for ; Thu, 21 Jul 2016 20:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752077AbcGUUD2 (ORCPT ); Thu, 21 Jul 2016 16:03:28 -0400 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80]:2992 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753877AbcGUUD0 (ORCPT ); Thu, 21 Jul 2016 16:03:26 -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=2g0V6WRmyQjkk7OsdwZZyL4WdEj5Ea0IkfFuNefsDOA=; b=n2TNkSM0Q+LyJZr/j+6n1abf3AS/OHIRXTTXu/JADNvVZt9hgBUELiey1RxCfqiWRDVFrza3ta/adhRhHg8CrJofZlRk8GlN0ro+xZSOVl9YWu5MQ9HMBtM3nCA6moPrSCBlGSycTWZDgVcK9Ni2LYnEqggcX9iY0l+Rm6Sav6w= Received: from BLUPR02CA056.namprd02.prod.outlook.com (10.160.23.174) by BY2PR02MB1702.namprd02.prod.outlook.com (10.163.27.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:18 +0000 Received: from BN1BFFO11FD026.protection.gbl (2a01:111:f400:7c10::1:116) by BLUPR02CA056.outlook.office365.com (2a01:111:e400:8ad::46) 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:19 +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 BN1BFFO11FD026.mail.protection.outlook.com (10.58.144.89) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Thu, 21 Jul 2016 20:03:17 +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 57.4B.03019.9D821975; Thu, 21 Jul 2016 12:56: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; Thu, 21 Jul 2016 13:03:09 -0700 X-AuditID: ac160c69-5f3ff70000000bcb-97-579128d9d56a Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 55.C4.02783.D7A21975; Thu, 21 Jul 2016 13:03:09 -0700 (PDT) Subject: [PATCH v4 1/5] IB/core: Make rdma_rw_ctx_init() initialize all used fields 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: <608bb795-a4be-105c-ef73-21f5410e98d2@sandisk.com> Date: Thu, 21 Jul 2016 13:03:09 -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+NgFprAIsWRmVeSWpSXmKPExsWyRoxnke4djYnhBud+qVm8PP+B1WLl6qNM Fs8O9bJYnP/wismibfUZRovGSwYW616/Z7H4t7abxYHDY+esu+we5+9tZPG4v/0Ik8fumw1s Ho+en2P0eL/vKpvH501yAexRXDYpqTmZZalF+nYJXBlXJj1gKZglUXF6zgyWBsaLwl2MnBwS AiYSH64tY+1i5OIQEljKJPGmcTsbhLODUeLZt89MMFWvHu6DqWKUaD67gwUkISwQKvHj52dW EFtEQE1i06tF7CC2kICdxKkNW1hAGpgF1jNJ/Fl2G6yBTcBI4tv7mWA2L1DR4qX/mUFsFgFV iYnLf4LZogJhEtPuvmWHqBGUODnzCVg9p4C9xPb2ViCbA2iopsT6XfogYWYBeYntb+cwg+yS EHjIKrHn7h9WiCPUJU4umc80gVF4FpJRsxDaZyFpX8DIvIpRLDczpzg3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S-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)(199003)(64126003)(86362001)(92566002)(7696003)(5003600100003)(110136002)(189998001)(305945005)(76176999)(54356999)(50986999)(33646002)(2906002)(97736004)(4001350100001)(4326007)(23676002)(356003)(36756003)(50466002)(81166006)(81156014)(11100500001)(53416004)(7846002)(87936001)(230700001)(2950100001)(8676002)(31696002)(19580405001)(68736007)(65806001)(229853001)(69596002)(6806005)(19580395003)(47776003)(31686004)(65956001)(8936002)(106466001)(2270400002)(77096005)(586003)(83506001)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1702; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD026; 1:VTd5voN4K+/CQhJj+mZjAppcc9DRN8sWwmGaFjs5bWUU4XdsJCddjHSYJ0fc7xJcbyihaqg6sofBmeQTRIZuivNVeqvCg+lQlFfTMvQQkg9H0agJdQ+C3rWS2uCEB7R26Dm6LF6F+6TQAI+68imzHituODStDr27mE1SzqeER/d8y4+rsI0DpNnF3+DYy744sSj0uZIF0uyf+lJ8Nd6ItX9wADzZS7ug/FcBxilsjRAgFgotmSqfA3Zk9AxX6yxc5zvyk9ZM/Msf4+tz9ywGn1lLcAIJ38UT3xypA3zIr9YNUOhN5Rr9hemlPWcw0dVmE0bC0ODhsnT/2/MArZUpGz8M9AzTk1UPnnJh2a9HDcIktx1NqOlYd6zhM9T1WwnVS7T6cThR6BZq/VbTO8+Sgd3hHgR5XZ7SbBuwg53M+hf276ZCj7GXc+3HRc8aEnZ1NF8JKmZfs0hUCXOoV8o12FR0X0qFMCK7ezgPLp+Rbq9kTdWco3SVR6aF03JXCvwlmu5QmS37C2dRQ4zdg4sACQ== X-MS-Office365-Filtering-Correlation-Id: efcb3104-f30b-4124-2e97-08d3b1a20f7a X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1702; 2:NflAVsIb5uP5HKk9UFQEywoKp4dU0BmwMhBGe1InISuIQKWFqjkCSLxCHz1f4zAgpvE40OsMjZwn02qVUiQcu1Zi6RyU960b/n0qB1lfo7wBg98nSJIEJ4fPPJiNsvPlKbB3/PgLdWQQwdSFWK/sqg2HGqfEk7gHWkbRvk8bwmBLTmUKgCk4z7pnikNaAhzi; 3:0B/rZZR1JCiAPPIvY2STQLflnuHY6AEhvkLzTZ9r+iTOQhXBQYleypUbhT7wtFeuQBq19cMqvqXwUxLzcdrWhheYZqO7o6SZeq34DznmfDb65y0CIdbSHa+mdg9GmhT0HNNzXSPfXbIv39kXF/GYUSENzMa7WaHSRblxZ/n//nFLu9n1c22DlXroSJ2ZICuBOIxeSkYhUoLlyVkhXtLiruapoERNvPkeha+QIHE0psc0fuSS5PCuwzygeQQQ7ZrOCtCPY+AGyoKCz3f8+GKTAg==; 25:9zEzZBuyunrePY5wA4jyb6KjGamIGW9rXe5cpkD0YBCHxLRDJLJzmFKvha1glIBHZvsrfHhw6km6neA/qj2lAtpEqzfz/D6/UeHeaPX9tsaVZQxzSvCaY7AVA76w8pFfBgHJK6M7xSLpEQZSDHWnIi1kV5OL7QjG8QBJZk5WKhby+RR2TY1wtPmM8X+cBB7hIYweUgjbQscCOQwfWACEuCVAn8XLiYqrJRAA3O46hxwMk5OX2jiUjGmo0yYEmtIjEVRDCbv3JEO6LlJJWJkvjHcw5RejaWNZOEu3srNVgYaQ6mr9r5PNnmcwdrJ73RCjhu4AIDv5LKQ/d0xqOhcsoUqb7FWGcIrBNA/udGQrFjlTp6n6duZt8ts35NPJdzBBv7V4hMSAcM4nAXJ2QFUkNGbk3YgW7spYumVCHVZr/OI= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BY2PR02MB1702; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1702; 31:SZYMT2EibGKlGlIfBLII/8iKci4KOrmJa0yazmzt/I0EdHcQf7dEwArHD4k3dylrZlhCU3b3IjmwtzhswpJt6gazQ6vmde/xTvYVnfEQ3wkNtKHuGDCJ4vFbI7y5DOOReGPp3AB5v5wI2qx7FKESp2zh8FFK/zGwbHVWDQgkoZX3YHnoNi9cNaUR17P7qCSFiKPhE8ksLre52kgNWurrmg==; 20:CtuNO/aIFgeceeucaMAjdKr+RndIBgdea68nxsVafI9Qhszm25N2cDV0nV1LQp9U9VinH0wLbbh3N+J7VZ6ncRODeSTbdPJcsrhYetNzfbDUQ2EU/rIyV3+WSVoou0hNLadn4tABteBWCjbattWf42nfbHEZ1c63JnX66PcLuCNSWMrBRQK7cxPKWn2rrCBKMSMOzVapKRdyb1dor0tmhdxmDtKtIlO+nE9jKEB3tZ9CUWIOXrWfOQNMeOL5IquqbBeIWFX2/btjDqWNo7NXsi2F5/cIJaMUuAGkVB/LjuzT7RESGkIrt66uAx+KVVUzLuRzIli8BNscdLwdFMSpt+A7l7LPxFEdaxB32wliSKOrWdrrRqXiWET1fRX1w2nD3vVHT2frW1KjzymFfp5gQ3IQMLIIIinuX/f07yHfyt18/k2qqWc7eDVbkkoVAe77WQ16SDgqhqZCWl3RTGo1JLgNeSzx2cvkO9KyIErb+9CdFAzkvUvv34/GCaN9RJqb 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)(13016025)(5005006)(13018025)(8121501046)(3002001)(10201501046)(6055026); SRVR:BY2PR02MB1702; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB1702; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1702; 4:cwDXiSgvAEEQSQA7vDj0avuaDMkZQ5ynRMS1ydinj9+MYCLekIOcWxKx6WLZKEcfo0sGTbxMAr6es70Q890/rjSRy92/NYxoKeEwAU9nkyaMqQn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v9Bry95dLnKKcel61pf4GvuPaYtKl/Mx2TehZ9s6k4HY6PawAnhSjWhTSU48hLZuOva2ZUF5Ya4Sleit4idF/2y1wESPyti77IdsbUn9JNACzFGpLeDzrabHIlJMpAcKr9T04Sv+/xn3w/HO7b5d/oYkyRnA8KicHoYYZ5TNDGbfCBW6uf/nqyoeOMJCwQGhQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1702; 20:dOuax9pcoa56NFfXm/H2ccb4x+szqowaYzAyZU8dPrGv2pCDWkDM0xHtviOqAzqs1aFBuuf2RZms35X8JdOsssT8CUcPHFwwsaORidc0Xx2sHIpIoW9wrzVkMGHeL+Hj0djmYn0sE7Fp7iUj5noILQ1slEjzRjxt5nwwKvHNUtGGliOm2AkwwvqI0cU1WcWV8okguQKw7+Jwzml8p9psuaXjU+jSGRMsvOCCgwbErBq0XrBPCeviz0mlgxEU6DK1 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2016 20:03:17.9531 (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: BY2PR02MB1702 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 Some but not all callers of rdma_rw_ctx_init() zero-initialize struct rdma_rw_ctx. Hence make rdma_rw_ctx_init() initialize all work request fields that will be read by ib_post_send(). Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API") Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Tested-by: Steve Wise Tested-by: Laurence Oberman Cc: Parav Pandit Cc: Nicholas Bellinger Cc: #v4.7+ --- drivers/infiniband/core/rw.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index 1eb9b12..1ad2baa 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c @@ -71,6 +71,7 @@ static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev) return min_t(u32, dev->attrs.max_fast_reg_page_list_len, 256); } +/* Caller must have zero-initialized *reg. */ static int rdma_rw_init_one_mr(struct ib_qp *qp, u8 port_num, struct rdma_rw_reg_ctx *reg, struct scatterlist *sg, u32 sg_cnt, u32 offset) @@ -114,6 +115,7 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num, struct scatterlist *sg, u32 sg_cnt, u32 offset, u64 remote_addr, u32 rkey, enum dma_data_direction dir) { + struct rdma_rw_reg_ctx *prev = NULL; u32 pages_per_mr = rdma_rw_fr_page_list_len(qp->pd->device); int i, j, ret = 0, count = 0; @@ -125,7 +127,6 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, } for (i = 0; i < ctx->nr_ops; i++) { - struct rdma_rw_reg_ctx *prev = i ? &ctx->reg[i - 1] : NULL; struct rdma_rw_reg_ctx *reg = &ctx->reg[i]; u32 nents = min(sg_cnt, pages_per_mr); @@ -162,9 +163,13 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, sg_cnt -= nents; for (j = 0; j < nents; j++) sg = sg_next(sg); + prev = reg; offset = 0; } + if (prev) + prev->wr.wr.next = NULL; + ctx->type = RDMA_RW_MR; return count; @@ -205,11 +210,10 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, rdma_wr->wr.opcode = IB_WR_RDMA_READ; rdma_wr->remote_addr = remote_addr + total_len; rdma_wr->rkey = rkey; + rdma_wr->wr.num_sge = nr_sge; rdma_wr->wr.sg_list = sge; for (j = 0; j < nr_sge; j++, sg = sg_next(sg)) { - rdma_wr->wr.num_sge++; - sge->addr = ib_sg_dma_address(dev, sg) + offset; sge->length = ib_sg_dma_len(dev, sg) - offset; sge->lkey = qp->pd->local_dma_lkey; @@ -220,8 +224,8 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp, offset = 0; } - if (i + 1 < ctx->nr_ops) - rdma_wr->wr.next = &ctx->map.wrs[i + 1].wr; + rdma_wr->wr.next = i + 1 < ctx->nr_ops ? + &ctx->map.wrs[i + 1].wr : NULL; } ctx->type = RDMA_RW_MULTI_WR;