From patchwork Sat Oct 31 12:13:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 56768 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9VCADdm018296 for ; Sat, 31 Oct 2009 12:11:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757621AbZJaMLF (ORCPT ); Sat, 31 Oct 2009 08:11:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757678AbZJaMLF (ORCPT ); Sat, 31 Oct 2009 08:11:05 -0400 Received: from mail-ew0-f228.google.com ([209.85.219.228]:59063 "EHLO mail-ew0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757621AbZJaMLE (ORCPT ); Sat, 31 Oct 2009 08:11:04 -0400 Received: by ewy28 with SMTP id 28so3695231ewy.18 for ; Sat, 31 Oct 2009 05:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=O8/cTsnKX7DFouRac5e/tlOT/geiBddc18qIvkDYxoI=; b=trGHbRrsBRCBcZd+xakPj722Bqeai2Tn80ChF7IX+07wW8PAJRuiD4cldG4wSORn1d /41w+WOIU5OvpdRuQW0otkFjf8b9RoMlS0RmTfskCqQFs6PJbXDQ9KSOSsVGpG0ayePb IAWVDTfBLbT4dBlV8wtI/8WgRex+dDNHU4WGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=EzlWWO90ZNUU260XowShVAO+Y7UbGrtMApM2hkquraCv36scoxG2dhRw4N8tFsNbR8 TX/JSaUfAw5SS3wWih/uOpLaWhQE5+ahUFdEE+WYFcX2LUQy4SZGE7++4x17bL7j6tOR WGaQSsmqUEHODf/u0eyiylzTIKMGo6Vo1vka0= Received: by 10.216.90.65 with SMTP id d43mr1549085wef.41.1256991067770; Sat, 31 Oct 2009 05:11:07 -0700 (PDT) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 23sm10926543eya.4.2009.10.31.05.11.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 31 Oct 2009 05:11:06 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id BD31F11F87; Sat, 31 Oct 2009 14:13:12 +0200 (IST) Date: Sat, 31 Oct 2009 14:13:12 +0200 From: Sasha Khapyorsky To: Hal Rosenstock Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/link_mgr: verify port's lid Message-ID: <20091031121312.GB9479@me> References: <20091030004732.GP20136@me> <1830724148.4221541256937456735.JavaMail.root@sz0074a.westchester.pa.mail.comcast.net> <20091031121212.GA9479@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091031121212.GA9479@me> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/osm_link_mgr.c b/opensm/opensm/osm_link_mgr.c index c9bdfee..76325ea 100644 --- a/opensm/opensm/osm_link_mgr.c +++ b/opensm/opensm/osm_link_mgr.c @@ -68,7 +68,8 @@ static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp) OSM_LOG_ENTER(sm->p_log); - if (p_osm->routing_engine_used != OSM_ROUTING_ENGINE_TYPE_LASH) { + if (p_osm->routing_engine_used != OSM_ROUTING_ENGINE_TYPE_LASH + || !(slid = osm_physp_get_base_lid(p_physp))) { /* Use default SL if lash routing is not used */ OSM_LOG_EXIT(sm->p_log); return (sm->p_subn->opt.sm_sl); @@ -80,7 +81,6 @@ static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp) cl_ptr_vector_get(&sm->p_subn->port_lid_tbl, cl_ntoh16(smlid)); /* Find osm_port of the source = p_physp */ - slid = osm_physp_get_base_lid(p_physp); p_src_port = cl_ptr_vector_get(&sm->p_subn->port_lid_tbl, cl_ntoh16(slid));