From patchwork Wed Oct 1 11:49:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 5011371 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4EB06BEEA6 for ; Wed, 1 Oct 2014 11:56:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82BFD20108 for ; Wed, 1 Oct 2014 11:56:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FC28200F0 for ; Wed, 1 Oct 2014 11:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751047AbaJAL4G (ORCPT ); Wed, 1 Oct 2014 07:56:06 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:48995 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbaJAL4G (ORCPT ); Wed, 1 Oct 2014 07:56:06 -0400 Received: from localhost.localdomain (unknown [37.163.159.60]) by smtp3-g21.free.fr (Postfix) with ESMTP id 21F80A6303; Wed, 1 Oct 2014 13:55:29 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.8/8.14.8) with ESMTP id s91Bshaf013350; Wed, 1 Oct 2014 13:55:38 +0200 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.8/8.14.8/Submit) id s91BohSL013033; Wed, 1 Oct 2014 13:50:43 +0200 From: Yann Droneaud To: Roland Dreier Cc: linux-rdma@vger.kernel.org, Dotan Barak , Yann Droneaud Subject: [PATCH libibverbs 1/9] ibv_cmd_create_ah(): initialize reserved fields in various structures Date: Wed, 1 Oct 2014 13:49:31 +0200 Message-Id: <7989836f5db0c7e8199c80ce7f6851daf7a0a6dc.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 Reserved fields in struct ibv_kern_global_route, struct ibv_kern_ah_attr and struct ibv_create_ah must be properly initialized when exchanged with kernel uverbs layer, as: - it may remove valgrind spurious warnings; - it 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd.c b/src/cmd.c index 45ea06ff4705..b281082f2f4d 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1179,16 +1179,19 @@ int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah, IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_AH, &resp, sizeof resp); cmd.user_handle = (uintptr_t) ah; cmd.pd_handle = pd->handle; + cmd.reserved = 0; cmd.attr.dlid = attr->dlid; cmd.attr.sl = attr->sl; cmd.attr.src_path_bits = attr->src_path_bits; cmd.attr.static_rate = attr->static_rate; cmd.attr.is_global = attr->is_global; cmd.attr.port_num = attr->port_num; + cmd.attr.reserved = 0; cmd.attr.grh.flow_label = attr->grh.flow_label; cmd.attr.grh.sgid_index = attr->grh.sgid_index; cmd.attr.grh.hop_limit = attr->grh.hop_limit; cmd.attr.grh.traffic_class = attr->grh.traffic_class; + cmd.attr.grh.reserved = 0; memcpy(cmd.attr.grh.dgid, attr->grh.dgid.raw, 16); if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)