From patchwork Mon Apr 18 05:32:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 714251 X-Patchwork-Delegate: alexne@voltaire.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3I5WcbW011155 for ; Mon, 18 Apr 2011 05:32:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611Ab1DRFcL (ORCPT ); Mon, 18 Apr 2011 01:32:11 -0400 Received: from nspiron-2.llnl.gov ([128.115.41.82]:33100 "EHLO nspiron-2.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471Ab1DRFcK convert rfc822-to-8bit (ORCPT ); Mon, 18 Apr 2011 01:32:10 -0400 X-Attachments: None Received: from vpna-user-128-15-244-54.llnl.gov ([128.15.244.54]) by nspiron-2.llnl.gov with ESMTP; 17 Apr 2011 22:32:09 -0700 Subject: Re: [PATCH] opensm: perfmgr, only set orig_lid when we have a valid port. Otherwise leave it as 0 Mime-Version: 1.0 (Apple Message framework v1081) From: "Weiny, Ira K." In-Reply-To: <20110417150614.GA31503@calypso.voltaire.com> Date: Sun, 17 Apr 2011 22:32:08 -0700 Cc: "linux-rdma@vger.kernel.org" Message-Id: References: <20110415151736.809c550b.weiny2@llnl.gov> <20110417150614.GA31503@calypso.voltaire.com> To: Alex Netes X-Mailer: Apple Mail (2.1081) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 18 Apr 2011 05:32:38 +0000 (UTC) On Apr 17, 2011, at 8:06 AM, Alex Netes wrote: > Hi Ira, > > On 15:17 Fri 15 Apr , Ira Weiny wrote: >> >> Subject: [PATCH] opensm: perfmgr, only set orig_lid when we have a valid port. Otherwise leave it as 0 >> >> >> Signed-off-by: Ira Weiny >> --- >> opensm/osm_perfmgr.c | 4 +++- >> 1 files changed, 3 insertions(+), 1 deletions(-) >> >> diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c >> index 6a1fa63..3e1575a 100644 >> --- a/opensm/osm_perfmgr.c >> +++ b/opensm/osm_perfmgr.c >> @@ -454,7 +454,9 @@ static void collect_guids(cl_map_item_t * p_map_item, void *context) >> ib_switch_info_is_enhanced_port0(&node->sw-> >> switch_info)); >> for (port = mon_node->esp0 ? 0 : 1; port < num_ports; port++) { >> - mon_node->port[port].orig_lid = get_base_lid(node, port); >> + mon_node->port[port].orig_lid = 0; >> + if (osm_physp_is_valid(&node->physp_table[port])) >> + mon_node->port[port].orig_lid = get_base_lid(node, port); >> mon_node->port[port].valid = TRUE; > > Shouldn't this port marked with mon_node->port[port].valid = FALSE ? New patch below. Subject: [PATCH 1/5] opensm/perfmgr: set redirect orig_lid and valid flag only when we have a valid port. Signed-off-by: Ira Weiny --- opensm/osm_perfmgr.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c index 5758587..3578e13 100644 --- a/opensm/osm_perfmgr.c +++ b/opensm/osm_perfmgr.c @@ -454,8 +454,12 @@ static void collect_guids(cl_map_item_t * p_map_item, void *context) ib_switch_info_is_enhanced_port0(&node->sw-> switch_info)); for (port = mon_node->esp0 ? 0 : 1; port < num_ports; port++) { - mon_node->port[port].orig_lid = get_base_lid(node, port); - mon_node->port[port].valid = TRUE; + mon_node->port[port].orig_lid = 0; + mon_node->port[port].valid = FALSE; + if (osm_physp_is_valid(&node->physp_table[port])) { + mon_node->port[port].orig_lid = get_base_lid(node, port); + mon_node->port[port].valid = TRUE; + } } cl_qmap_insert(&pm->monitored_map, node_guid,