From patchwork Thu Jan 8 12:49:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 5592401 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E11D8BF6C3 for ; Thu, 8 Jan 2015 12:49:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE9D42038A for ; Thu, 8 Jan 2015 12:49:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DB9F20389 for ; Thu, 8 Jan 2015 12:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753835AbbAHMtw (ORCPT ); Thu, 8 Jan 2015 07:49:52 -0500 Received: from mail-we0-f171.google.com ([74.125.82.171]:62523 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753240AbbAHMtv (ORCPT ); Thu, 8 Jan 2015 07:49:51 -0500 Received: by mail-we0-f171.google.com with SMTP id u56so2285834wes.2 for ; Thu, 08 Jan 2015 04:49:50 -0800 (PST) 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=ob1B4qP8h9bATp9q0SzhjNoQ2DEaxFAr2SSlXb1CziQ=; b=Cpz5CkGXZnroJjwA0F5EhF5lL+1UgTrYAAKDAjLZ0Bb8TquW4SZ1HEtrKY4rmxepJU 42GaQvqeZ777+ydH9HEWRa20UVn64V6N6NL0R0VIjqmCPmOGdfTaCz0fsBf9qACRnPmd sbzwN/GWmHo5hOQ1XI9TNkl94i1A2jmCugi3/7LAQGhjKeN1wQnWc6e95yWDUgVUth0Z 3D+XzsI279GLMYRzIyoi81DK9XSU5Nzo8hs2Pr7z0j0ZRGUKIBzSPrqXGf0PRwlc2Wwd Qpr3EpkezLL6XxsCAm1xEory0/P7HS/9EG+dh+ak28R2B9pktp82U9tF5EFUqjhnYO4g ptvA== X-Gm-Message-State: ALoCoQlRkjG9vQYkvMwccgsXS8hFFhYeTXrlqjJ3v5IL9R5b7syLPPOGIWnmFmdZ50od3slQzr6C X-Received: by 10.194.2.34 with SMTP id 2mr19363979wjr.58.1420721390356; Thu, 08 Jan 2015 04:49:50 -0800 (PST) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id q7sm6470709wiv.8.2015.01.08.04.49.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Jan 2015 04:49:49 -0800 (PST) Message-ID: <54AE7CEB.6060404@dev.mellanox.co.il> Date: Thu, 08 Jan 2015 07:49:47 -0500 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: Daniel Klein Subject: [PATCH opensm 2/5] osm_state_mgr.c: Remove new_lft buffers cleanup Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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: Daniel Klein Removed code that cleans switch->new_lft buffers after routing. Change is required in order to enable OpenSM to use new_lft buffers for SA queries and unicast routing dump files. new_lft buffers are automatically reallocated (if needed) and set to 0xFF when calling ucast_mgr_process. Signed-off-by: Daniel Klein Signed-off-by: Hal Rosenstock --- opensm/osm_state_mgr.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index 1fda3f6..976a691 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -1127,7 +1127,7 @@ Exit: OSM_LOG_EXIT(sm->p_log); } -static void cleanup_switch(cl_map_item_t * item, void *log) +static void check_switch_lft(cl_map_item_t * item, void *log) { osm_switch_t *sw = (osm_switch_t *) item; @@ -1139,10 +1139,6 @@ static void cleanup_switch(cl_map_item_t * item, void *log) "LFT of switch 0x%016" PRIx64 " (%s) is not up to date\n", cl_ntoh64(sw->p_node->node_info.node_guid), sw->p_node->print_desc); - else { - free(sw->new_lft); - sw->new_lft = NULL; - } } int wait_for_pending_transactions(osm_stats_t * stats) @@ -1490,9 +1486,6 @@ repeat_discovery: if (wait_for_pending_transactions(&sm->p_subn->p_osm->stats)) return; - /* cleanup switch lft buffers */ - cl_qmap_apply_func(&sm->p_subn->sw_guid_tbl, cleanup_switch, sm->p_log); - /* We are done setting all LFTs so clear the ignore existing. * From now on, as long as we are still master, we want to * take into account these lfts. */ @@ -1559,6 +1552,10 @@ repeat_discovery: */ state_mgr_report_new_ports(sm); + /* check switch lft buffers assignments */ + cl_qmap_apply_func(&sm->p_subn->sw_guid_tbl, check_switch_lft, + sm->p_log); + /* in any case we zero this flag */ sm->p_subn->coming_out_of_standby = FALSE; sm->p_subn->first_time_master_sweep = FALSE;