From patchwork Wed Oct 1 11:49:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 5011391 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D65B29F375 for ; Wed, 1 Oct 2014 11:56:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5176020108 for ; Wed, 1 Oct 2014 11:56:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D434200F0 for ; Wed, 1 Oct 2014 11:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338AbaJAL4P (ORCPT ); Wed, 1 Oct 2014 07:56:15 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:49519 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbaJAL4P (ORCPT ); Wed, 1 Oct 2014 07:56:15 -0400 Received: from localhost.localdomain (unknown [37.163.159.60]) by smtp3-g21.free.fr (Postfix) with ESMTP id 90143A6312; Wed, 1 Oct 2014 13:55:39 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.8/8.14.8) with ESMTP id s91Bshah013350; Wed, 1 Oct 2014 13:55:38 +0200 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.8/8.14.8/Submit) id s91Bomno013035; Wed, 1 Oct 2014 13:50:48 +0200 From: Yann Droneaud To: Roland Dreier Cc: linux-rdma@vger.kernel.org, Dotan Barak , Yann Droneaud Subject: [PATCH libibverbs 3/9] ibv_cmd_post_send(): initialize reserved field in struct ibv_kern_send_wr Date: Wed, 1 Oct 2014 13:49:33 +0200 Message-Id: <8034db9803f8383339322394a7e52404aed83f96.1412163687.git.ydroneaud@opteya.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Properly initialize data structure exchanged with kernel uverbs layer: - may remove valgrind spurious warnings; - may allow to use the field later for future expansion. Link: http://marc.info/?i=cover.1412163687.git.ydroneaud@opteya.com Fixes: eb0663777c24 ('Add support for new datapath kernel commands') Signed-off-by: Yann Droneaud --- src/cmd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cmd.c b/src/cmd.c index d057494260ee..8d8f7e8294e5 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -999,6 +999,9 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, tmp->wr.ud.ah = i->wr.ud.ah->handle; tmp->wr.ud.remote_qpn = i->wr.ud.remote_qpn; tmp->wr.ud.remote_qkey = i->wr.ud.remote_qkey; + memset(&tmp->wr.ud.reserved, 0, + sizeof(tmp->wr.ud.reserved) + + (sizeof(tmp->wr) - sizeof(tmp->wr.ud))); } else { switch (i->opcode) { case IBV_WR_RDMA_WRITE: @@ -1007,6 +1010,9 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, tmp->wr.rdma.remote_addr = i->wr.rdma.remote_addr; tmp->wr.rdma.rkey = i->wr.rdma.rkey; + memset(&tmp->wr.rdma.reserved, 0, + sizeof(tmp->wr.rdma.reserved) + + (sizeof(tmp->wr) - sizeof(tmp->wr.rdma))); break; case IBV_WR_ATOMIC_CMP_AND_SWP: case IBV_WR_ATOMIC_FETCH_AND_ADD: @@ -1016,8 +1022,12 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, i->wr.atomic.compare_add; tmp->wr.atomic.swap = i->wr.atomic.swap; tmp->wr.atomic.rkey = i->wr.atomic.rkey; + memset(&tmp->wr.atomic.reserved, 0, + sizeof(tmp->wr.atomic.reserved) + + (sizeof(tmp->wr) - sizeof(tmp->wr.atomic))); break; default: + memset(&tmp->wr, 0, sizeof(tmp->wr)); break; } }