From patchwork Mon Apr 18 13:29:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 715091 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 p3IDU0K2030104 for ; Mon, 18 Apr 2011 13:30:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670Ab1DRNaF (ORCPT ); Mon, 18 Apr 2011 09:30:05 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:49334 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292Ab1DRNaE (ORCPT ); Mon, 18 Apr 2011 09:30:04 -0400 Received: by wya21 with SMTP id 21so3907364wya.19 for ; Mon, 18 Apr 2011 06:30:01 -0700 (PDT) Received: by 10.227.182.129 with SMTP id cc1mr5178076wbb.10.1303133401277; Mon, 18 Apr 2011 06:30:01 -0700 (PDT) Received: from [192.168.1.100] (c-71-192-10-85.hsd1.ma.comcast.net [71.192.10.85]) by mx.google.com with ESMTPS id l24sm3266913wbc.47.2011.04.18.06.29.59 (version=SSLv3 cipher=OTHER); Mon, 18 Apr 2011 06:30:00 -0700 (PDT) Message-ID: <4DAC3CD5.8000700@dev.mellanox.co.il> Date: Mon, 18 Apr 2011 09:29:57 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" Subject: [PATCH 2/2] opensm/osm_perfmgr.c: Don't rely on PortInfo:PortState for base SP0 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 13:30:06 +0000 (UTC) For base SP0, PortState in SM PortInfo attribute is not used and base SP0 is always "active". 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_perfmgr.c b/opensm/osm_perfmgr.c index 6a1fa63..86efde6 100644 --- a/opensm/osm_perfmgr.c +++ b/opensm/osm_perfmgr.c @@ -684,6 +684,10 @@ static unsigned is_sm_port_down(osm_sm_t * sm) } CL_PLOCK_RELEASE(sm->p_lock); + if (p_port->p_node->sw && + !ib_switch_info_is_enhanced_port0(&p_port->p_node->sw->switch_info)) + return 0; /* base SP0 */ + return osm_physp_get_port_state(p_port->p_physp) == IB_LINK_DOWN; }