From patchwork Tue Jul 19 16:21:37 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: 9237805 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 F295260574 for ; Tue, 19 Jul 2016 16:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2B6F26B4A for ; Tue, 19 Jul 2016 16:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6DB826E81; Tue, 19 Jul 2016 16:21:46 +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 35C1426B4A for ; Tue, 19 Jul 2016 16:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbcGSQVp (ORCPT ); Tue, 19 Jul 2016 12:21:45 -0400 Received: from mail-by2nam01on0070.outbound.protection.outlook.com ([104.47.34.70]:16448 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753261AbcGSQVn (ORCPT ); Tue, 19 Jul 2016 12:21:43 -0400 X-Greylist: delayed 90651 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Jul 2016 12:21:43 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=AYAfTUvoXvUCz8lLjo62QY67sHU+MY9/4qHwaTPzUEM=; b=IrXoDhCAT23tQk/g1yOD8CUL6ou/8qwY/K4tiM+vLgxUYZsaJxFFzmiMMPOGzd2SrpbeNjjA6+plj7B0e35Czdr15LxORj7Drk6Pm8nuNLLSl94VRCzZeTwSS0Z93j4TKTAz8xbbD5J1A66aXVZYr99Pejm2al1n5zDhc5Esvf0= Received: from BY2PR02CA0076.namprd02.prod.outlook.com (10.242.32.34) by BY2PR02MB457.namprd02.prod.outlook.com (10.141.144.139) with Microsoft SMTP Server (TLS) id 15.1.539.14; Tue, 19 Jul 2016 16:21:41 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::190) by BY2PR02CA0076.outlook.office365.com (2a01:111:e400:2c2a::34) 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; Tue, 19 Jul 2016 16:21:41 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; 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 BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Tue, 19 Jul 2016 16:21:41 +0000 Received: from MILHUBIP04.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 BF.A9.03019.8F15E875; Tue, 19 Jul 2016 09:14:48 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.301.0; Tue, 19 Jul 2016 09:21:40 -0700 X-AuditID: ac160c69-5f3ff70000000bcb-f2-578e51f82036 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 31.9B.02783.1935E875; Tue, 19 Jul 2016 09:21:40 -0700 (PDT) Subject: [PATCH v3 1/5] IB/core: Make rdma_rw_ctx_init() initialize all used fields 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: <859aaa24-9031-0a8f-26ec-b45ad6ac68d2@sandisk.com> Date: Tue, 19 Jul 2016 09:21:37 -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+NgFuplkeLIzCtJLcpLzFFi42JZI8azSPdHYF+4wYf1RhYvz39gtVi5+iiT xbNDvSwW5z+8YrJoW32G0aLxkoHFutfvWSz+re1mceDw2DnrLrvH+XsbWTzubz/C5LH7ZgOb x6Pn5xg93u+7yubxeZNcAHsUl01Kak5mWWqRvl0CV8aGhTfZC36JVzS8cW1g3CjcxcjJISFg IjG1/TZzFyMXh5DAUiaJ9rsdjBDODkaJlQdOsMFUrZ68gR2qilHicdcjRpCEsECoxLeWySwg toiAmsSmV4uAijiAiuwkrj4tBKlnFljPJPFn2W2wGjYBI4lv72eygNTwAtX82As2n0VAVWLB 7UfsILaoQIRE768lYOW8AoISJ2c+AbM5BewlWvd+ZANpZRbQlFi/Sx8kzCwgL7H97RywByQE 7rJKtM5azwySEBJQlzi5ZD7TBEbhWUhGzUJon4W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ttributedMessage: 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)(53416004)(4001350100001)(54356999)(76176999)(36756003)(6806005)(11100500001)(33646002)(106466001)(189998001)(97736004)(229853001)(31686004)(31696002)(110136002)(50466002)(4326007)(65806001)(65956001)(2270400002)(47776003)(23676002)(64126003)(87936001)(86362001)(586003)(2906002)(92566002)(50986999)(83506001)(77096005)(19580405001)(19580395003)(69596002)(2950100001)(68736007)(8676002)(305945005)(356003)(7846002)(5003600100003)(8936002)(81166006)(230700001)(81156014)(7696003)(65826006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB457; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD014; 1:keUiF5RGcL9ybDt3ULK4gKQL23ZSwk0pu5Hx7l9Lxd3K2nEKVGydIgoduxTdSqypy+8fFQM0kWoCockI9hGB/BU2K3gRkdcVTJK8pCJGfw8VLyrJ/+X8ZmUsD2nkWLVqF1aYlNr/Pt4uQ+b+9xxE3e2YupDS81QYqPyAT42ECXrH+k7CngaS6u5FPUYb+LnceQfTd4tHS9tZ5OW2dBPL9Tz1+lPyLFmBpmCpkAM79Ir5aVKIfZsZ8PoKlxi7ILFLzY+NDlkepXC/FlNZvxzccldd2x9O1HUavTVV/4IWf6jk2ByUhXP18EMKU4qij+ZrMPwFXx5jsbywufFdJ9N41RUsoy1GIfr2I+DeOJ7MLAT5kcFvHNDcmokdmvuVoKaVIHbkdv2/hvuLdnyRNaaJcFAeUXHAp9XetB5atEqb4iHGIH/sS1qfjNvJtIGc5RSL5x5iY4Jad/SqE/FTjnlVpOqQoa7FsQjdGxu595+1jkM= X-MS-Office365-Filtering-Correlation-Id: 5874d69c-0434-4d30-fe26-08d3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YqVxZQgIdzkcyaiTB1KxJKHZuCGDRllbOd+9FxITUopVQb1YMwGVptK2hOzaqRZJ4Vastvt++6V/1pSsYFaPwe9CvxSVwaJzuht/iG4qvNcXwcTEzZkCC3VnDJkfOby8VRdywFtsRG3cGGkAGO1sZDQqKz6410BSyUjKaOFWXuIK1qcRru9ItHbq5hnsj+hMsAMNJYqQ==; 20:h30X683cxiDcUt7l4OtByVyCMZ/PBAcRo0188IclxcRTi5MoKUc0BFZvshUfTYo2ZJmYuUUYVksNro4qBv7PWPkdq3fA8AgnEdlqbhcIFcwZo2htP5DaJB8Hkisvq8UD1edz5yxfocV/6yJIaW2qgc/ju5k/o8BHB4y/u1RKIom2qZngyXx7pD/4tpEXB60TK8UsQbFey+yhjzx/7B5EQICgqegcLzmIcPOG3WPT/Ruq+/udp5RuuRbVI+yVZ58Ebvv8629xUOtFoqvpoPLb3YiWtd2Vy9OkVKGq5ljfiPrMK1noBP3D1aZUG7kS4m9QiU1f9j03yaBQK9GhdOY+wfTdyAXG4dyff6ATC9r5b4XwSFWP29cmL77s84o9fisFaLbksbI+YQFafMA6XAdvAHv3Ijvy5dk6HFSyLh5n2HLYjM14/kzS75Tx3kVhL3ADmiFlveNVXQthdVzwEwfG7Oelhr0nm+Q5esj7+lM9ACWaMcOx8Is8TzAmBpbcZ+Ct 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)(8121501046)(5005006)(13016025)(10201501046)(3002001)(6055026); SRVR:BY2PR02MB457; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB457; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB457; 4:yADjd0i4DwLqT1SI1PnARLWx9pr/Yn+K8/+IREwb9VZ3EqEKA7qohZwFrlwP/4ihRDi6CPSC3IqaM2twxkksXK21JKLqv4oyBHycys4+sD2ZPx4jkB8AgMGLBjsvZ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Xoo5kj238YeUU6xsXyt4+QoXN94H46mUWV0pcbkwbo3ThVvoTY4N8dVh9gqLjjMTmC0iTFiGADaINntinciTnEkXteCwQAPICbQA7FBch4McX8ST++pP6nVpM1T7S8RSeouLwZewnUCpj0OLcC/35YSN+suzZKKPK82hogBo64fnhnMFLV+D9C18fQPOjCXFF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB457; 20:hqP5RIT3k+5614awh9gqUdbPQDc7tGvsBNvbowFTrFQRpei+xDakWcBS42XsrVNTvrWm8/Pz+jJmPz57/PeWCwF8v/HMzAHeV0LZS8pI5UlMrN1EXmIlCnwNEMhMOs/E8hWV53Wory17OU3yetd0HCX/0ZVQD7k+wxdxuWjwtz9ojsO7b5cSRfP7sONrQlYrCVzMv1BNardMP5yr46OCKbFQ1m/jg5yKFVlV+S6+MAak4Zdo2HStqNEU1rKxeMEf X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2016 16:21:41.2784 (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: BY2PR02MB457 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: Steve Wise Cc: Parav Pandit Cc: Nicholas Bellinger Cc: Laurence Oberman Reviewed-by: Christoph Hellwig --- 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;