From patchwork Mon Jun 24 16:47:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2772331 X-Patchwork-Delegate: hal@mellanox.com 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 22FDBC0AB1 for ; Mon, 24 Jun 2013 16:47:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CA65201FE for ; Mon, 24 Jun 2013 16:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF8AF201FB for ; Mon, 24 Jun 2013 16:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752992Ab3FXQrp (ORCPT ); Mon, 24 Jun 2013 12:47:45 -0400 Received: from mail-ee0-f52.google.com ([74.125.83.52]:36373 "EHLO mail-ee0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899Ab3FXQrp (ORCPT ); Mon, 24 Jun 2013 12:47:45 -0400 Received: by mail-ee0-f52.google.com with SMTP id c50so6156990eek.25 for ; Mon, 24 Jun 2013 09:47:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=TkeKB9RMCtuR5wLDlQ5RCJ1gs+t51DZkdyTCzj1uahM=; b=C2VDV0ukrR2BoWBZ7gflR51bXvW7qMe0KFIyPHwduRACbeb/8ehSbyHdpkr62qnBbS +GHqw/qjlHKEagU0oNbFHie6VpEHXF/kmcwhqAStYNCM5ZpivMJ2q2U8bcc/f7RQZRT2 BXhXQyHIuhm9UaaGB6PpHfW+ZqiRnaBXvdvFciOvIzal93COrzPBG4GoB3ruC3iZL5V0 tZ4sgr54j8DwoYSOEc6+n++IAiNUaUWoFoo0/vWWRmmA8/ou/w7tOGaOODcD+AXiPWjS jRaiJ7KO0jG9M7p0tCFaXtGDa+sn6QJLPxnkNT45oOyH0fB11F7eDxtlF7IkImvKbLjq X2dg== X-Received: by 10.14.1.70 with SMTP id 46mr25714273eec.82.1372092463843; Mon, 24 Jun 2013 09:47:43 -0700 (PDT) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPSA id p49sm29692075eeu.2.2013.06.24.09.47.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 09:47:42 -0700 (PDT) Message-ID: <51C8782B.6080308@dev.mellanox.co.il> Date: Mon, 24 Jun 2013 12:47:39 -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: Vladimir Koushnir Subject: [PATCH opensm] osm_ucast_mgr.c: Fix extra copy in set_lft_block routine X-Gm-Message-State: ALoCoQl+3huHJGur+yx9RlSo1PoI56Si+Ikkda2FyEmcNC7JyrPtJq8NeftsPJY0TU9onSMR/Edv Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: Vladimir Koushnir Signed-off-by: Vladimir Koushnir Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c index 12db434..f116a51 100644 --- a/opensm/osm_ucast_mgr.c +++ b/opensm/osm_ucast_mgr.c @@ -967,7 +967,6 @@ static void ucast_mgr_set_fwd_top(IN cl_map_item_t * p_map_item, static int set_lft_block(IN osm_switch_t *p_sw, IN osm_ucast_mgr_t *p_mgr, IN uint16_t block_id_ho) { - uint8_t block[IB_SMP_DATA_SIZE]; osm_madw_context_t context; osm_dr_path_t *p_path; ib_api_status_t status; @@ -989,10 +988,10 @@ static int set_lft_block(IN osm_switch_t *p_sw, IN osm_ucast_mgr_t *p_mgr, context.lft_context.node_guid = osm_node_get_node_guid(p_sw->p_node); context.lft_context.set_method = TRUE; - if (!osm_switch_get_lft_block(p_sw, block_id_ho, block) || - (!p_sw->need_update && !p_mgr->p_subn->need_update && - !memcmp(block, p_sw->new_lft + block_id_ho * IB_SMP_DATA_SIZE, - IB_SMP_DATA_SIZE))) + if (!p_sw->need_update && !p_mgr->p_subn->need_update && + !memcmp(p_sw->new_lft + block_id_ho * IB_SMP_DATA_SIZE, + p_sw->lft + block_id_ho * IB_SMP_DATA_SIZE, + IB_SMP_DATA_SIZE)) return 0; OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,