From patchwork Wed Apr 30 14:34:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 4094451 X-Patchwork-Delegate: hal@mellanox.com 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 AE0509F271 for ; Wed, 30 Apr 2014 14:35:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE5DE202EA for ; Wed, 30 Apr 2014 14:35:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A56F20265 for ; Wed, 30 Apr 2014 14:35:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422817AbaD3OfH (ORCPT ); Wed, 30 Apr 2014 10:35:07 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:62804 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422816AbaD3OfC (ORCPT ); Wed, 30 Apr 2014 10:35:02 -0400 Received: by mail-we0-f182.google.com with SMTP id u57so1789955wes.13 for ; Wed, 30 Apr 2014 07:35:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=EJhXgEj08luYQIOIC7C3EWqORoTOInIsBjnzmvSzVjg=; b=aEoz3/RlWLyxu6HnLxJbw3tYW8BUKgOfGFAipynK+JbSUPILiOG8vupdtTZlXt4BrN BDtaS1Qou8zdKAVVr3gC43Lu6KXeKpZFEW1g8L7hFGyDsyRkEMQKNlemEAn6XENagG07 j1BjOhxHSRstYH+YO7QSRF0NTnSavtVb2fsAAsi83Jn0zwWSuOGyJaOsitMmFnlUZx8b Lca/Y4ZbsaedzJmT6ShsSvDYLhMSSE+Hg40+oK9Ir4uBEAtmzY6PaygaI2U7HuIcRWW9 0draLmf2gGsg59s/hiar6yOxNpwmQB9mpVtTAUABiWuk8GnG+X2uDQfT4RCofJM/PZlU 7frA== X-Gm-Message-State: ALoCoQk47x4MwMjPIjjF7CzQvBS9RF9aXf0zv5HctY0LmpDlcjASYkXR7rIh9ymjARoolm2TVT8E X-Received: by 10.194.171.167 with SMTP id av7mr4305410wjc.32.1398868501501; Wed, 30 Apr 2014 07:35:01 -0700 (PDT) Received: from [10.223.0.94] (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id cj9sm4030592wid.1.2014.04.30.07.35.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 07:35:00 -0700 (PDT) Message-ID: <53610A13.6010705@dev.mellanox.co.il> Date: Wed, 30 Apr 2014 10:34:59 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Tomer Cohen Subject: [PATCH opensm] osm_sa_[mcmember path]_record.c: Optimize clearing of SA record items 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 From: Tomer Cohen Signed-off-by: Tomer Cohen Signed-off-by: Hal Rosenstock --- opensm/osm_sa_mcmember_record.c | 2 +- opensm/osm_sa_path_record.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c index 85e7681..403387c 100644 --- a/opensm/osm_sa_mcmember_record.c +++ b/opensm/osm_sa_mcmember_record.c @@ -1326,7 +1326,7 @@ static ib_api_status_t mcmr_rcv_new_mcmr(IN osm_sa_t * sa, goto Exit; } - memset(p_rec_item, 0, SA_MCM_RESP_SIZE); + memset(p_rec_item, 0, sizeof(cl_list_item_t)); /* HACK: Untrusted requesters should result with 0 Join State, Port Guid, and Proxy */ diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c index 75b8c02..2aa4248 100644 --- a/opensm/osm_sa_path_record.c +++ b/opensm/osm_sa_path_record.c @@ -1686,7 +1686,7 @@ static void pr_process_multicast(osm_sa_t * sa, const ib_sa_mad_t *sa_mad, "Unable to allocate path record for MC group\n"); return; } - memset(pr_item, 0, SA_PR_RESP_SIZE); + memset(pr_item, 0, sizeof(cl_list_item_t)); /* Copy PathRecord request into response */ pr_item->resp.path_rec = *pr;