@@ -1048,17 +1048,12 @@ static int alloc_mfts(osm_sm_t * sm)
int i;
cl_map_item_t *item;
osm_switch_t *p_sw;
- int max_mlid = 0;
for (i = sm->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO; i >= 0;
- i--) {
- if (sm->p_subn->mgroups[i]) {
- max_mlid = i + IB_LID_MCAST_START_HO;
+ i--)
+ if (sm->p_subn->mgroups[i])
break;
- }
- }
-
- if (max_mlid == 0)
+ if (i < 0)
return 0;
/* Now, walk switches and (re)allocate multicast tables */
@@ -1066,8 +1061,7 @@ static int alloc_mfts(osm_sm_t * sm)
item != cl_qmap_end(&sm->p_subn->sw_guid_tbl);
item = cl_qmap_next(item)) {
p_sw = (osm_switch_t *)item;
- if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl,
- max_mlid - IB_LID_MCAST_START_HO))
+ if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl, i))
return -1;
}
return 0;