From patchwork Thu Nov 12 00:02:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 59461 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 nAC00D7h031606 for ; Thu, 12 Nov 2009 00:00:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759435AbZKLAAG (ORCPT ); Wed, 11 Nov 2009 19:00:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759486AbZKLAAG (ORCPT ); Wed, 11 Nov 2009 19:00:06 -0500 Received: from ey-out-2122.google.com ([74.125.78.26]:1043 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759435AbZKLAAE (ORCPT ); Wed, 11 Nov 2009 19:00:04 -0500 Received: by ey-out-2122.google.com with SMTP id 9so405440eyd.19 for ; Wed, 11 Nov 2009 16:00:09 -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=jf/iAilVxjDG2hLTcVvbH3tsGVv9MsuG/EgVBzjsby4=; b=lmEkYJr0jNqXYqoALK/iprDCu0GBmmDrxRfrb4U+xPRtmYPFXCSrOISAjPtmQO6cli O9+AAzA61IibtZAnVsR8Pf6sm7S4pDAVOudwMltH+BOjXsevUBZYriUW+KiZyv1aFK9i l5tYW+MM+sQRx+u+GERt6McVKbNPdNlVo/2Uc= 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=nBpG0Mtgfta/ws2bsy+IvlWSRDA03vs46a2oRdzBE9g9dHN41Tfm59AMVr0tjInqRj Dx3QnXu32wbhtQYujN9AGHuqKzWNuo3ReNDL8+tvdQHrtsHRGKizcNOUDls4uUaVExWJ rhk2MttQCC6Xvg28LP+DdElMxgIfzRw6+DeJA= Received: by 10.213.107.131 with SMTP id b3mr127444ebp.91.1257984009352; Wed, 11 Nov 2009 16:00:09 -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 7sm1705930eyb.40.2009.11.11.16.00.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Nov 2009 16:00:08 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id C2DD61209B; Thu, 12 Nov 2009 02:02:24 +0200 (IST) Date: Thu, 12 Nov 2009 02:02:24 +0200 From: Sasha Khapyorsky To: linux-rdma@vger.kernel.org Cc: Slava Strebkov Subject: [PATCH] opensm/osm_mgrp_new(): add subnet db insertion Message-ID: <20091112000224.GZ7192@me> References: <4AC2114E.3010303@Voltaire.COM> <20091111235959.GY7192@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091111235959.GY7192@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/include/opensm/osm_multicast.h b/opensm/include/opensm/osm_multicast.h index f0897f4..59e4d0d 100644 --- a/opensm/include/opensm/osm_multicast.h +++ b/opensm/include/opensm/osm_multicast.h @@ -142,9 +142,12 @@ typedef struct osm_mgrp { * * SYNOPSIS */ -osm_mgrp_t *osm_mgrp_new(IN ib_net16_t mlid, IN ib_member_rec_t * mcmr); +osm_mgrp_t *osm_mgrp_new(IN osm_subn_t * subn, IN ib_net16_t mlid, + IN ib_member_rec_t * mcmr); /* * PARAMETERS +* subn +* [in] Pointer to osm_subn_t object. * mlid * [in] Multicast LID for this multicast group. * diff --git a/opensm/opensm/osm_multicast.c b/opensm/opensm/osm_multicast.c index 8ccab8e..ff607e1 100644 --- a/opensm/opensm/osm_multicast.c +++ b/opensm/opensm/osm_multicast.c @@ -73,7 +73,8 @@ void osm_mgrp_delete(IN osm_mgrp_t * p_mgrp) free(p_mgrp); } -osm_mgrp_t *osm_mgrp_new(IN ib_net16_t mlid, IN ib_member_rec_t * mcmr) +osm_mgrp_t *osm_mgrp_new(IN osm_subn_t * subn, IN ib_net16_t mlid, + IN ib_member_rec_t * mcmr) { osm_mgrp_t *p_mgrp; @@ -86,6 +87,10 @@ osm_mgrp_t *osm_mgrp_new(IN ib_net16_t mlid, IN ib_member_rec_t * mcmr) p_mgrp->mlid = mlid; p_mgrp->mcmember_rec = *mcmr; + cl_fmap_insert(&subn->mgrp_mgid_tbl, &p_mgrp->mcmember_rec.mgid, + &p_mgrp->map_item); + subn->mgroups[cl_ntoh16(p_mgrp->mlid) - IB_LID_MCAST_START_HO] = p_mgrp; + return p_mgrp; } diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c index 95c41e4..357e6ab 100644 --- a/opensm/opensm/osm_sa_mcmember_record.c +++ b/opensm/opensm/osm_sa_mcmember_record.c @@ -796,7 +796,7 @@ static ib_api_status_t mcmr_rcv_create_new_mgrp(IN osm_sa_t * sa, /* create a new MC Group */ mcm_rec.mlid = mlid; - *pp_mgrp = osm_mgrp_new(mlid, &mcm_rec); + *pp_mgrp = osm_mgrp_new(sa->p_subn, mlid, &mcm_rec); if (*pp_mgrp == NULL) { OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B08: " "osm_mgrp_new failed\n"); @@ -813,11 +813,6 @@ static ib_api_status_t mcmr_rcv_create_new_mgrp(IN osm_sa_t * sa, (*pp_mgrp)->mcmember_rec.pkt_life &= 0x3f; (*pp_mgrp)->mcmember_rec.pkt_life |= 2 << 6; /* exactly */ - /* Insert the new group in the data base */ - cl_fmap_insert(&sa->p_subn->mgrp_mgid_tbl, - &(*pp_mgrp)->mcmember_rec.mgid, &(*pp_mgrp)->map_item); - sa->p_subn->mgroups[cl_ntoh16(mlid) - IB_LID_MCAST_START_HO] = *pp_mgrp; - Exit: OSM_LOG_EXIT(sa->p_log); return status;