From patchwork Wed Nov 11 12:38:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 59327 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 nABCb02T024022 for ; Wed, 11 Nov 2009 12:37:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755345AbZKKMga (ORCPT ); Wed, 11 Nov 2009 07:36:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756003AbZKKMga (ORCPT ); Wed, 11 Nov 2009 07:36:30 -0500 Received: from mail-fx0-f221.google.com ([209.85.220.221]:60522 "EHLO mail-fx0-f221.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408AbZKKMgT (ORCPT ); Wed, 11 Nov 2009 07:36:19 -0500 Received: by fxm21 with SMTP id 21so950572fxm.21 for ; Wed, 11 Nov 2009 04:36:24 -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=5wtrHrYes8Yq4wdkEw0vG471Dx+FhZMicikLTgDSH4A=; b=rPPQlzHx54yYVF5DN9+k3XQWj+Q8QyBZVSPeDBGu4nMSOcErTjKciDKMrSkNtGJd87 GrT96TS/n4A6lN7YM69y42mUhZuwlCUmLvQ8ce/hm33iS8PzLuaokDeeZGRxWGYvfmJl ycTP9IVjEsrsSv5WMxq+sMBmxwZKt2wtIP8lU= 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=wacdhXUlMy6xoxaOYw/66SJbf4+qvnebF1xjhz9GHXZ2VlHmUXyqFnWQr7+EpTMYNP VE1AbBUhhh9NBikEBdCbTDgsgAciky35EAlMkOEEaTHP+G7iCQrzBjGu7Y+hnOpsE28H vD5qyuk79v7XduQWcLicG1T6riCzVvpy5yohY= Received: by 10.103.78.31 with SMTP id f31mr328201mul.24.1257942983784; Wed, 11 Nov 2009 04:36:23 -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 j2sm2606487mue.16.2009.11.11.04.36.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Nov 2009 04:36:22 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id 5B8B11209B; Wed, 11 Nov 2009 14:38:37 +0200 (IST) Date: Wed, 11 Nov 2009 14:38:37 +0200 From: Sasha Khapyorsky To: linux-rdma@vger.kernel.org Cc: Slava Strebkov Subject: [PATCH] opensm/partition: keep multicast group pointer Message-ID: <20091111123837.GV7192@me> References: <4AC2114E.3010303@Voltaire.COM> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4AC2114E.3010303@Voltaire.COM> 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/include/opensm/osm_partition.h b/opensm/include/opensm/osm_partition.h index 3c8a5aa..fdb34b9 100644 --- a/opensm/include/opensm/osm_partition.h +++ b/opensm/include/opensm/osm_partition.h @@ -48,6 +48,7 @@ #include #include #include +#include #ifdef __cplusplus # define BEGIN_C_DECLS extern "C" { @@ -92,8 +93,8 @@ BEGIN_C_DECLS typedef struct osm_prtn { cl_map_item_t map_item; ib_net16_t pkey; - ib_net16_t mlid; uint8_t sl; + osm_mgrp_t *mgrp; cl_map_t full_guid_tbl; cl_map_t part_guid_tbl; char name[32]; @@ -106,13 +107,13 @@ typedef struct osm_prtn { * pkey * The IBA defined P_KEY of this Partition. * -* mlid -* The network ordered LID of the well known Multicast Group -* that was created for this partition. -* * sl * The Service Level (SL) associated with this Partiton. * +* mgrp +* The pointer to the well known Multicast Group +* that was created for this partition (when configured). +* * full_guid_tbl * Container of pointers to all Port objects in the Partition * with full membership, indexed by port GUID. diff --git a/opensm/opensm/osm_prtn.c b/opensm/opensm/osm_prtn.c index 4f84a80..f1094e3 100644 --- a/opensm/opensm/osm_prtn.c +++ b/opensm/opensm/osm_prtn.c @@ -225,7 +225,7 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, cl_ntoh16(pkey)); if (p_mgrp) { p_mgrp->well_known = TRUE; - p->mlid = p_mgrp->mlid; + p->mgrp = p_mgrp; } /* workaround for TS */ @@ -240,8 +240,8 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, &p_mgrp); if (p_mgrp) { p_mgrp->well_known = TRUE; - if (!p->mlid) - p->mlid = p_mgrp->mlid; + if (!p->mgrp) + p->mgrp = p_mgrp; } return status; diff --git a/opensm/opensm/osm_qos_policy.c b/opensm/opensm/osm_qos_policy.c index fcb9935..ed631c9 100644 --- a/opensm/opensm/osm_qos_policy.c +++ b/opensm/opensm/osm_qos_policy.c @@ -772,7 +772,6 @@ static void __qos_policy_validate_pkey( uint8_t sl; uint32_t flow; uint8_t hop; - osm_mgrp_t * p_mgrp; if (!p_qos_policy || !p_qos_match_rule || !p_prtn) return; @@ -792,31 +791,21 @@ static void __qos_policy_validate_pkey( /* If this partition is an IPoIB partition, there should be a matching MCast group. Fix this group's SL too */ - - if (!p_prtn->mlid) - return; - - p_mgrp = osm_get_mgrp_by_mlid(p_qos_policy->p_subn, p_prtn->mlid); - if (!p_mgrp) { - OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_ERROR, - "ERR AC16: MCast group for partition with " - "pkey 0x%04X not found\n", - cl_ntoh16(p_prtn->pkey)); + if (!p_prtn->mgrp) return; - } - CL_ASSERT((cl_ntoh16(p_mgrp->mcmember_rec.pkey) & 0x7fff) == + CL_ASSERT((cl_ntoh16(p_prtn->mgrp->mcmember_rec.pkey) & 0x7fff) == (cl_ntoh16(p_prtn->pkey) & 0x7fff)); - ib_member_get_sl_flow_hop(p_mgrp->mcmember_rec.sl_flow_hop, + ib_member_get_sl_flow_hop(p_prtn->mgrp->mcmember_rec.sl_flow_hop, &sl, &flow, &hop); if (sl != p_prtn->sl) { OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG, "Updating MCGroup (MLID 0x%04x) SL to " "match partition SL (%u)\n", - cl_hton16(p_mgrp->mcmember_rec.mlid), + cl_hton16(p_prtn->mgrp->mcmember_rec.mlid), p_prtn->sl); - p_mgrp->mcmember_rec.sl_flow_hop = + p_prtn->mgrp->mcmember_rec.sl_flow_hop = ib_member_set_sl_flow_hop(p_prtn->sl, flow, hop); } }