From patchwork Fri Jun 27 11:16:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 4434621 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 23D09BEEAA for ; Fri, 27 Jun 2014 11:17:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C15220384 for ; Fri, 27 Jun 2014 11:17:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 005E920381 for ; Fri, 27 Jun 2014 11:16:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753355AbaF0LQ5 (ORCPT ); Fri, 27 Jun 2014 07:16:57 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:52699 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171AbaF0LQ4 (ORCPT ); Fri, 27 Jun 2014 07:16:56 -0400 Received: by mail-wi0-f174.google.com with SMTP id bs8so2650195wib.13 for ; Fri, 27 Jun 2014 04:16:55 -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=f1Avz/amxd1Kheq6LdJO3VtpeK5CNRTlAcG1XvT1cl0=; b=SIZLS47+0CjUkFmgwzYmW70rLHpb/gv4MrQ3G0o8t2jCdaxpVhIT1rAkC8Fpnn3Oi6 T+lX4M61cKM2wzVTRBiDO/+R/4GVYV6N68KEoAtmbXqUiQp2czT8xRS+7XAQYMswF74F unihOW6t8bcRAV9mcBraTu/hmxYm3iNcyn9Yq7mYJmBWLMXm6YywsJ9ox4wGbNYI7Xnh Ckh7JXfgsR+UiFamX+UdcHQrFAQhqYN+Wd0b+Czcc3WqBmEn5bG5K2XeNvPhD0eVCf/y uSSo08BNxvEWwJ4c5QngZ3Nb7SFOd1hRdfaL5FoU0crB0aPOJDov9hKyLpe0iSaYnigS s7+A== X-Gm-Message-State: ALoCoQl0oSoCPLMGL2Jxn3c69oM2Hni6XvB8sxB4M2x0LYYm0wuJ6CFhSNDeValvmm7pl09kBwhz X-Received: by 10.180.14.196 with SMTP id r4mr10922960wic.2.1403867814949; Fri, 27 Jun 2014 04:16:54 -0700 (PDT) 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 v17sm20737568wjr.33.2014.06.27.04.16.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Jun 2014 04:16:54 -0700 (PDT) Message-ID: <53AD52A2.9030507@dev.mellanox.co.il> Date: Fri, 27 Jun 2014 07:16:50 -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] Skip state_mgr_check_tbl_consistency when no LID changed by lid or link managers 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: Vladimir Koushnir If no LID was changed/allocated during by the lid manager and no PortInfo(Set) was sent, there is no need to run the state_mgr_check_tbl_consistency routine. Signed-off-by: Vladimir Koushnir --- include/opensm/osm_lid_mgr.h | 12 ++++++++---- opensm/osm_lid_mgr.c | 1 + opensm/osm_link_mgr.c | 1 + opensm/osm_state_mgr.c | 7 +++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/opensm/osm_lid_mgr.h b/include/opensm/osm_lid_mgr.h index 40f0d30..f95a2a1 100644 --- a/include/opensm/osm_lid_mgr.h +++ b/include/opensm/osm_lid_mgr.h @@ -98,6 +98,7 @@ typedef struct osm_lid_mgr { cl_plock_t *p_lock; osm_db_domain_t *p_g2l; cl_qlist_t free_ranges; + boolean_t dirty; uint8_t used_lids[IB_LID_UCAST_END_HO + 1]; } osm_lid_mgr_t; /* @@ -120,16 +121,19 @@ typedef struct osm_lid_mgr { * p_g2l * Pointer to the database domain storing guid to lid mapping. * -* used_lids -* An array of used lids. keeps track of -* existing and non existing mapping of guid->lid -* * free_ranges * A list of available free lid ranges. The list is initialized * by the code that initializes the lid assignment and is consumed * by the procedure that finds a free range. It holds elements of * type osm_lid_mgr_range_t * +* dirty +* Indicates that lid table was updated +* +* used_lids +* An array of used lids. keeps track of +* existing and non existing mapping of guid->lid +* * SEE ALSO * LID Manager object *********/ diff --git a/opensm/osm_lid_mgr.c b/opensm/osm_lid_mgr.c index fc6bd37..703f30d 100644 --- a/opensm/osm_lid_mgr.c +++ b/opensm/osm_lid_mgr.c @@ -892,6 +892,7 @@ static int lid_mgr_set_physp_pi(IN osm_lid_mgr_t * p_mgr, */ osm_physp_set_base_lid(p_physp, 0); send_set = TRUE; + p_mgr->dirty = TRUE; } /* we are updating the ports with our local sm_base_lid */ diff --git a/opensm/osm_link_mgr.c b/opensm/osm_link_mgr.c index 0d00984..f09783a 100644 --- a/opensm/osm_link_mgr.c +++ b/opensm/osm_link_mgr.c @@ -129,6 +129,7 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp, p_port = osm_get_port_by_guid(sm->p_subn, osm_physp_get_port_guid(p_physp)); p_pi->base_lid = p_port->lid; + sm->lid_mgr.dirty = TRUE; send_set = TRUE; } diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index 3c76f62..1b55ce4 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -1400,6 +1400,11 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * sm) OSM_LOG_ENTER(sm->p_log); + if (sm->lid_mgr.dirty == FALSE) + goto Exit; + + sm->lid_mgr.dirty = FALSE; + cl_ptr_vector_construct(&ref_port_lid_tbl); cl_ptr_vector_init(&ref_port_lid_tbl, cl_ptr_vector_get_size(&sm->p_subn->port_lid_tbl), @@ -1491,6 +1496,8 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * sm) } cl_ptr_vector_destroy(&ref_port_lid_tbl); + +Exit: OSM_LOG_EXIT(sm->p_log); }