From patchwork Thu Feb 4 22:22:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 77224 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o14MJ131014711 for ; Thu, 4 Feb 2010 22:19:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758118Ab0BDWSk (ORCPT ); Thu, 4 Feb 2010 17:18:40 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:45873 "EHLO mail-ew0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758056Ab0BDWSi (ORCPT ); Thu, 4 Feb 2010 17:18:38 -0500 Received: by ewy28 with SMTP id 28so3521964ewy.28 for ; Thu, 04 Feb 2010 14:18:37 -0800 (PST) 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=SXx7mGUv3aj5gNLI1UMAndcty01HU8JQw5hmcN6s/+U=; b=pW0d9D1XhJu4aBrvT/nA0B5PMRC3a2Sl28a13tnop/v5cZg3IgcQ36ie7GBl2HNBYP wSk0Or6Fq0VKa4z4rNarb/c2BS99MGOoiRmNQc5HT6ugOrtG/DmfEy+SVeOYmZUvJUdy 31HkaFdF37RMgjffnjRerwKEyoQKR6FkVn8z8= 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=OteEZIHuFy8NBbbC6eUJBlHc2JdnH3etc9WfmfD3rAaCVMgFcPJ0KOPwcst+E4oElY 3IOwFr7cLvuskYvRDZEF6i+oftsDIARDvTqxzg3lRqZrvqptFPobmHH4pb6UWUkUYI3y vMP4EQMpqFjWRmmUwei4etw8ML18mCWDVcDpc= Received: by 10.213.109.208 with SMTP id k16mr1623685ebp.15.1265321916453; Thu, 04 Feb 2010 14:18:36 -0800 (PST) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 13sm458080ewy.1.2010.02.04.14.18.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 14:18:35 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id 4734412AF9; Fri, 5 Feb 2010 00:22:13 +0200 (IST) Date: Fri, 5 Feb 2010 00:22:13 +0200 From: Sasha Khapyorsky To: linux-rdma , Slava Strebkov Cc: Eli Dorfman , Hal Rosenstock Subject: [PATCH] opensm/osm_mcast_mgr.c: preserve root switch calculation functionality Message-ID: <20100204222213.GL26338@me> References: <20100204204713.GJ26338@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100204204713.GJ26338@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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Feb 2010 22:19:02 +0000 (UTC) diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c index f33d6a6..322635d 100644 --- a/opensm/opensm/osm_mcast_mgr.c +++ b/opensm/opensm/osm_mcast_mgr.c @@ -253,7 +253,8 @@ static float mcast_mgr_compute_max_hops(osm_sm_t * sm, cl_qmap_t * m, sw = cl_item_obj(i, sw, mgrp_item); lid = cl_ntoh16(osm_node_get_base_lid(sw->p_node, 0)); hops = osm_switch_get_least_hops(this_sw, lid); - hops = (hops + 1) * sw->num_of_mcm + hops * sw->is_mc_member; + if (!sw->is_mc_member) + hops += 1; if (hops > max_hops) max_hops = hops; }