@@ -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.
*
@@ -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;
}
@@ -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;