From patchwork Thu Jun 30 13:49:04 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: 9208309 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 65EAB60752 for ; Thu, 30 Jun 2016 14:39:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5607728596 for ; Thu, 30 Jun 2016 14:39:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A9272867C; Thu, 30 Jun 2016 14:39:23 +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 92D9D28596 for ; Thu, 30 Jun 2016 14:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbcF3OjV (ORCPT ); Thu, 30 Jun 2016 10:39:21 -0400 Received: from mail-by2on0094.outbound.protection.outlook.com ([207.46.100.94]:54016 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751845AbcF3OjU (ORCPT ); Thu, 30 Jun 2016 10:39:20 -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=w0tyrWNRwBpXySyfDzeNzk4Arnye1l7IOHfHvtF+1CI=; b=sD2+elbPGi5bdtk5Z0ORR7yzgxhi6X52AeSrnFwuHYw+BnwS+Yg6zLWTBHqWq7Bt6TUv2T9boqkaDnFhREVOrk0zGoCESm9mjjkhS473s8fbFPNRxJ35+G6xuonPuPDLcvheKfqJlJXoXiLJwn9+a+iXl583JooRcX5kIaic3v8= Received: from BN1PR02CA0023.namprd02.prod.outlook.com (10.141.56.23) by BY2PR0201MB0808.namprd02.prod.outlook.com (10.160.125.149) with Microsoft SMTP Server (TLS) id 15.1.523.12; Thu, 30 Jun 2016 14:35:10 +0000 Received: from BN1BFFO11OLC001.protection.gbl (2a01:111:f400:7c10::1:104) by BN1PR02CA0023.outlook.office365.com (2a01:111:e400:2a::23) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Thu, 30 Jun 2016 14:35:10 +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 BN1BFFO11OLC001.mail.protection.outlook.com (10.58.145.12) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Thu, 30 Jun 2016 14:35:06 +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 20.EA.03023.CF125775; Thu, 30 Jun 2016 06:43:25 -0700 (PDT) Received: from milsmgip12.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; Thu, 30 Jun 2016 06:49:08 -0700 X-AuditID: ac160c69-33fff70000000bcf-38-577521fc7646 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 20.5B.03875.15325775; Thu, 30 Jun 2016 06:49:07 -0700 (PDT) Subject: [PATCH v2 1/5] IB/core: Make rdma_rw_ctx_init() initialize all used fields 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: <5917eaad-10e5-31c3-2b97-78cfcd8065de@sandisk.com> Date: Thu, 30 Jun 2016 15:49:04 +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+NgFprAIsWRmVeSWpSXmKPExsWyRoxnke5fxdJwg4kXOC1env/AarFy9VEm i2eHelkszn94xWTRtvoMo0XjJQOLda/fs1j8W9vN4sDhsXPWXXaP8/c2snjc336EyWP3zQY2 j0fPzzF6vN93lc3j8ya5APYoLpuU1JzMstQifbsErowNV76yF5wRr1i97ytjA2OHcBcjJ4eE gInEmpd/WbsYuTiEBOYySUw9cAzK2cEo8XjnFBaYqs27GpkgEksZJba3fWMCSQgLhEpc6OsH s0UE1CQ2vVrEDmILCdhJzNkwF6yBWWA9k0T3lOVsIAk2ASOJb+9ngk3lBSra2rwErIFFQFXi 0Z3DjCC2qECERO+vJVA1ghInZz4BszkF7CV27FwGdB4H0FBNifW79EHCzALyEtvfzmEG2SUh cJVVYsLLDhaII9QlTi6ZzzSBUXgWklGzENpnIWlfwMi8ilEsNzOnODc9tcDQVK84MS8lszhb Lzk/dxMjJJ4ydzDefeJ9iFGAg1GJh9eBuSRciDWxrLgy9xCjBAezkgjvK/nScCHelMTKqtSi /Pii0pzU4kOM0hwsSuK8bve+hAkJpCeWpGanphakFsFkmTg4pRoY5yfPWfGYzWAC3/XjPztF b187vV6jJOLc3d2pX3gebzRsWdz4fWL4ygvN+/MvLXey9gr/+LpcUCa66Vtuy79X+fvWPzJ6 FJ5VaHpOS6yI2WzFm74HgrtfTg9TK7VlU+LVerr/jKLDWT8GG2uziZYGlWfK3Z9Yi72qjc/5 onzmi1NE/ZSzU/J/KLEUZyQaajEXFScCALr8PFOjAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjluLIzCtJLcpLzFFi42Lh2siRohusXBpu8GKRqsXL8x9YLVauPspk 8exQL4vF+Q+vmCzaVp9htGi8ZGCx7vV7Fot/a7tZHDg8ds66y+5x/t5GFo/7248weey+2cDm 8ej5OUaP9/uusnl83iQXwB7FZZOSmpNZllqkb5fAlbHhylf2gjPiFav3fWVsYOwQ7mLk5JAQ MJHYvKuRCcQWEljMKHH4SgqILSwQKnGhrx8sLiKgJrHp1SJ2iBo7iTkb5gLFuTiYBdYzSfR9 fgBWxCZgJPHt/UwWEJsXqGhr8xKwBhYBVYlHdw4zgtiiAhESvb+WQNUISpyc+QTM5hSwl9ix cxkriM0soC7xZ94lZghbXmL72znMExj5ZiFpmYWkbBaSsgWMzKsYxXIzc4pz0zMLDI30ihPz UjKLs/WS83M3MYJDmjNqB+P1ieaHGJk4OKUaGLd8WaPr3ht4nj/I4mOydqLe+ZnNO0uSTzCt 71gxz9Xu0X+hhL87dkv31pm5nQu4niT50afneNqaVqOpxxgjT16+dkCrKPaE/P2WpoSp7b9O lOh8fzX1F5+lv0RLw/lz78WKvkq75wpen/Z2nnT744zN+cHLlDpVxIzEjD8Yz512KYijsHNP mxJLcUaioRZzUXEiAPJK3wsZAgAA 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)(189002)(199003)(47776003)(50986999)(92566002)(81166006)(81156014)(19580405001)(23676002)(8676002)(65806001)(19580395003)(76176999)(4001350100001)(50466002)(586003)(11100500001)(54356999)(77096005)(83506001)(69596002)(31696002)(6806005)(65956001)(53416004)(110136002)(229853001)(97736004)(33646002)(2950100001)(8936002)(189998001)(68736007)(7696003)(2270400002)(230700001)(2906002)(4326007)(36756003)(31686004)(7846002)(86362001)(106466001)(356003)(64126003)(305945005)(87936001)(5003600100003)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB0808; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC001; 1:NwlqWn2htnpY6RDyUl6k38MHhNYQMOev8KM7vBZNbDhmd/zyrO9GASiHUjxbX+HL2CTEcRaqOrcg+hcqxx+f6kZ5Kb8sXyh/I0tW60LqigpTMOyVPM1PEhZC1HfN0gh3+xYmaEv8eqAcYDghTdvVgzUTJg7MvYIhp9w1wrqvOLc+g6rZYBkP17L1RXGpNJheCvXGkTlOo24HOypyNB1zIJ2qGn3SnMsNQnOAX2hLnYmKVU/HnvTai0dO9KccRzvlveldloPY1Tsk8dvi9QJVcg08FrJFU1JbMM/OT+Cps+oXxi5iCE/TJGjIZhEMFd69OlFvAw+Fc6bGrI5FDsG6vQowBklUp/l7I3neCTtRid8FMniCcBRz998gy/SSMnyvwkMgilXVSbeeG62vXMBprZpMYahOyuraR09T45yKjSIExsYGfBSohapH/ZMWe7QIfwE+vuPSMWUiTbFSXjvSllvsHlHM0z9cCJygh7MKC3gnwCFPWfNu2sP6ulsgtJoxu9v3yEegpjTH/b6cKiWUtg== X-MS-Office365-Filtering-Correlation-Id: c687acd1-c040-4d3a-2c76-08d3a0f3bce6 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0808; 2:nWsRtF8t4X5g7o0cilVXSzRTWem/cpVvgZlkTZ/YcAWRAPKqfoHJfchB0awbHC7pSiRGxOIG81X6/2LNPMQau1BK189/w5yTH+cNzdWlChj2iOm0xoxFEeOQWAuhA9P8x7oWayCw5erQ9aGQk/DNusbYXxK7Dc592WLNvN1UJQYFxRBiGVih8M3go2rlcgUP; 3:28Fup+hP05t5HvFUD7tYaFAtSn/jOHYRSNk+vyojoVTixEiOokcZeDQ3/NoHZIrdjXuJzdSyjBhTq3ZjkMF9Vghmmnif45aTI4BJopItB6PdPBtd9Y4Qd8CQt4tAlG8CTMSof+tt82P+rrpOfEulsq/99R9GdzAlNUgnP+udMVRNJCr/WKgqFtp2GIsYKv1j5VzYqPZN3YUNdUvrJXsd6mbSkqUM8Btq1hPXasPgabvbe3zNCMKLv9cv+cTw3zqYJ2LKc6Arw7xpH/7YWswEkQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BY2PR0201MB0808; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0808; 25:CmxsDt5X/PW9UYMldOPURk1BsK/mOadzgcRAzmFNmWEzvTEonUnXSIxw0yQUrVXe51Xzv1k9CSJVDVMScn2RWyWhFCUcgQF56vGhe3RABcxqgRO9qPxXz/Z8JCovXNaMS6M1icfrazydtM0glEPKWNi0ENnjAd4KNegeOjjynt16fSQY1fzdRJv6nSWiSPdUDxfKsMBUrln5/6LmREKOXtvp/i6NO4Hufecd1tnIMCOSbzlb5FoESpRU2ehWTkneWc+wCrcQWvSmN2GcFlvi/H/RWfJNYt3fGacOyk7anmSOwfVt2GKy1DTneM0no1GGuFB/bTrBf3J9GJLI8coxalArPNJSRWMu8+6TbkZRDFemcCz3RK5suY0cklTVTp4V6V0vRkknr8HqAMhjBzagPwxMpidT80uzK65tFI6Vp1qnMQEkSKTtsf5n7J8+9muEpVXbEvreVgMs8CQIMZLzN/tJGX5lPdoeGGaWULI4mgH5jaA9rB6ZwC2Y6r4Y1aM27ojV3n6/PPItF/868jG68bl70qJooFOUFhr91dzHs4C+8A+KfDQe5Sz4mxGBh1xfCGpJOUizQ9geyE14E6NSulW4MWFAdKNmq9iFh2bK9VMrpFYHYcUp/qoXWtOPQwHALVF4gPrW5UDTFWhe2bx/0glEEAaqwjnEUEI5oZbQqNoRqaxBxWk2h5jcF8K6KudMdSHwH9e/Rsx7+L5bQCg+sv6x9Gj2j7DSx3/xwqDDXRnbVnAW8t6ybVFUG9xj3EYvE7gwn04tOTRVm4Y/E0DHRw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0808; 20:xxyZrjUb6H32M61ZE00HDhjR1N6E8TmuXt2YwMKdgyuNVrVG+8HxL9e6JtJLLONXfv1/B6oOYQscdfP6nbVRkIOrF8XExIfiK0QQm3BhoYq2UWO9JD2L5pEvWNk1+bq9qtPWhGYpMH2IMwqqBUdVR647Cd95Cm0T89wraEKBg6+ISGjOJj4YqpSJJj2rWwg1p+VklSlewL6T8QCxW0GFmyKpgY6Ab8eL37nIw6sPALjMRgD+I6J10ROq2BalTaNxUYLhBg6fAsbpj9ElaXJ15JuytmSQYYDj9MYaYXjl0TzKjU3fXTVLxc9UM2aPPOHP+nXl76KVsDNAhxeWVPHusj5TcCqvwnFq07kPLVZvi0MCk0IKRtpwqyw0smMaaaZi8U3t0hIBdLBtK80LOFbN9e9y75zwR/AlMiZC7fHDNrvYoNP0KJQPDl0o5uhFj/9t03Jxgvg34//4ji0Ds7BZDDoe5SCThjTj2Un87YF5cyfHrqP1Eyiu68JPOYIW9BLq 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)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(6055026); SRVR:BY2PR0201MB0808; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB0808; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0808; 4:ldcc1lMbf1m0Lso94sSy9PbxQSUfQOomk+yxRFBTNqiy5JG2+PWdCbe6+uTt781TtFc4na4++9iNx8w3gikWVPQQh5Gw+HnIDny8wTmROmv7lZ06rMI95XuRaVAG8SJQp22wGnBQJogx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MiN8N5R2I3ygwVg2RJxsSDVqhPQg5ww/5cy55XQ+16MiwHRK1Q2SURvP42gAarK1+2DNv97DjbFqsK9/OSZp8a/riJU7fDWpR74TIOg2WWbWKX0mOvuspg1X/2gafkx6aFoYbj/3IXNYiiuCJf1cuqk/XT0oQj8JcGAJgLvc3szmUyQJge1GoLEnpNa50JOAQD8onAoVnXuSN7KM/J9tXrDxxg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0808; 20:T5CTFXllVP2LNNhLmg/FDNu5yyOuFTbjgLuqBdwORQQcdW0fn1xQFe0UlOjS5VVrddbb7vQXM2q3GJhAci5U4vGa7sXxrY/r76AHczq+6JHAyZ4UpsCpvXN6MphGXToKsasA+poS3cox42SWCMIH71S6zaLYM6JbE2VbRuNeYbbyEFSP3w0w0HOgPZ9BtBNTqjP+ZG+1AmBDax7ZQciM5eoS2mjbNSlcKR0fLjcsp2EEB8VDUdpoXW93lpPbxjoS X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2016 14:35:06.1438 (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: BY2PR0201MB0808 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 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 | 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;