From patchwork Thu Feb 4 20:47: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: 77198 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 o14KhdTm031022 for ; Thu, 4 Feb 2010 20:43:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756045Ab0BDUni (ORCPT ); Thu, 4 Feb 2010 15:43:38 -0500 Received: from ey-out-2122.google.com ([74.125.78.27]:33177 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755912Ab0BDUnh (ORCPT ); Thu, 4 Feb 2010 15:43:37 -0500 Received: by ey-out-2122.google.com with SMTP id d26so682133eyd.19 for ; Thu, 04 Feb 2010 12:43:36 -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:mime-version:content-type:content-disposition :user-agent; bh=PHMBAsy7CLPlNk9R6O2KG/MxVeyb9/09+iLW0O2vHzY=; b=hpfnZ3BVc9B8pbmXoCIUmy8bf3mGIJLFZOKUe0OPAt7HcRuG76FbkWNkUZthUdyX9C S8wo1S2tSuC/7LpgdBN48SF6wIW1RF8PvLMAiosekCjXWK4FvwxjeRoGQnjr4IHvyXwO 1wOxhcwCuZrKkKdpOryYOxbn9waU9qMvtH7n0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=eRJnI0DtvwaA9OvnCmTR7NWxWiwsbgljYmidPRjj9UKyE0Z7lKM+RSARldFxMkQKSW zgPQF5plXOv8oql4UZKN4sSPsWcWEHUt/VIFpMQVv3gPPQjtnwsu93kdQ5It45jJbsZE /bVfJYhkJZwXNwJ0W8RTQvOebt3IrmHOuBytg= Received: by 10.213.46.67 with SMTP id i3mr1446583ebf.87.1265316216583; Thu, 04 Feb 2010 12:43: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 24sm3219042eyx.46.2010.02.04.12.43.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 12:43:35 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id DB99212AF9; Thu, 4 Feb 2010 22:47:13 +0200 (IST) Date: Thu, 4 Feb 2010 22:47:13 +0200 From: Sasha Khapyorsky To: linux-rdma , Slava Strebkov Cc: Eli Dorfman , Hal Rosenstock Subject: [PATCH] opensm/osm_mcast_mgr.c: fix bug in MC root switch calculation Message-ID: <20100204204713.GJ26338@me> MIME-Version: 1.0 Content-Disposition: inline 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 20:43:40 +0000 (UTC) diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c index abd54a0..ef288b8 100644 --- a/opensm/opensm/osm_mcast_mgr.c +++ b/opensm/opensm/osm_mcast_mgr.c @@ -190,18 +190,17 @@ static void mcast_mgr_build_switch_map(osm_sm_t * sm, remote_sw = remote_node->sw; port_guid = osm_node_get_node_guid(remote_node); if (cl_qmap_get(p_mcast_member_sw_tbl, port_guid) == - cl_qmap_end(p_mcast_member_sw_tbl)) { + cl_qmap_end(p_mcast_member_sw_tbl)) /* insert switch to table */ cl_qmap_insert(p_mcast_member_sw_tbl, port_guid, &remote_sw->mgrp_item); - /* New element in the table */ - if (p_port->p_node->sw) - /* the switch is MC member */ - remote_sw->is_mc_member = 1; - else - /* for others - update MC count */ - remote_sw->num_of_mcm++; - } + + if (p_port->p_node->sw) + /* the switch is MC member */ + remote_sw->is_mc_member = 1; + else + /* for others - update MC count */ + remote_sw->num_of_mcm++; } OSM_LOG_EXIT(sm->p_log); }