Lines Matching +full:mbox +full:-

2  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
3 * Copyright (c) 2002-2015 Mellanox Technologies LTD. All rights reserved.
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
17 * - Redistributions of source code must retain the above
21 * - Redistributions in binary form must reproduce the above
60 osm_mgrp_box_t *mbox = malloc(sizeof(*mbox)); in mgrp_box_new() local
61 if (!mbox) in mgrp_box_new()
64 memset(mbox, 0, sizeof(*mbox)); in mgrp_box_new()
65 mbox->mlid = mlid; in mgrp_box_new()
66 cl_qlist_init(&mbox->mgrp_list); in mgrp_box_new()
68 return mbox; in mgrp_box_new()
71 void mgrp_box_delete(osm_mgrp_box_t *mbox) in mgrp_box_delete() argument
73 osm_mtree_destroy(mbox->root); in mgrp_box_delete()
74 free(mbox); in mgrp_box_delete()
85 (osm_mcm_alias_guid_t *) cl_qmap_head(&p_mgrp->mcm_alias_port_tbl); in mgrp_delete()
87 (osm_mcm_alias_guid_t *) cl_qmap_end(&p_mgrp->mcm_alias_port_tbl)) { in mgrp_delete()
90 (osm_mcm_alias_guid_t *) cl_qmap_next(&p_mcm_alias_guid->map_item); in mgrp_delete()
95 (osm_mcm_port_t *) cl_qmap_head(&p_mgrp->mcm_port_tbl); in mgrp_delete()
97 (osm_mcm_port_t *) cl_qmap_end(&p_mgrp->mcm_port_tbl)) { in mgrp_delete()
100 (osm_mcm_port_t *) cl_qmap_next(&p_mcm_port->map_item); in mgrp_delete()
107 void osm_mgrp_box_delete(osm_mgrp_box_t *mbox) in osm_mgrp_box_delete() argument
111 while (cl_qlist_count(&mbox->mgrp_list)) { in osm_mgrp_box_delete()
112 mgrp = cl_item_obj(cl_qlist_remove_head(&mbox->mgrp_list), in osm_mgrp_box_delete()
116 mgrp_box_delete(mbox); in osm_mgrp_box_delete()
123 osm_mgrp_box_t *mbox; in osm_mgrp_new() local
130 cl_qmap_init(&p_mgrp->mcm_port_tbl); in osm_mgrp_new()
131 cl_qmap_init(&p_mgrp->mcm_alias_port_tbl); in osm_mgrp_new()
132 p_mgrp->mlid = mlid; in osm_mgrp_new()
133 p_mgrp->mcmember_rec = *mcmr; in osm_mgrp_new()
135 mbox = osm_get_mbox_by_mlid(subn, p_mgrp->mlid); in osm_mgrp_new()
136 if (!mbox && !(mbox = mgrp_box_new(cl_ntoh16(p_mgrp->mlid)))) { in osm_mgrp_new()
141 cl_qlist_insert_tail(&mbox->mgrp_list, &p_mgrp->list_item); in osm_mgrp_new()
142 subn->mboxes[mbox->mlid - IB_LID_MCAST_START_HO] = mbox; in osm_mgrp_new()
144 cl_fmap_insert(&subn->mgrp_mgid_tbl, &p_mgrp->mcmember_rec.mgid, in osm_mgrp_new()
145 &p_mgrp->map_item); in osm_mgrp_new()
147 subn->p_osm->sa.dirty = TRUE; in osm_mgrp_new()
153 osm_mgrp_box_t *mbox; in osm_mgrp_cleanup() local
157 if (mgrp->full_members) in osm_mgrp_cleanup()
160 while (cl_qmap_count(&mgrp->mcm_alias_port_tbl)) { in osm_mgrp_cleanup()
161 mcm_alias_guid = (osm_mcm_alias_guid_t *) cl_qmap_head(&mgrp->mcm_alias_port_tbl); in osm_mgrp_cleanup()
162 cl_qmap_remove_item(&mgrp->mcm_alias_port_tbl, &mcm_alias_guid->map_item); in osm_mgrp_cleanup()
166 while (cl_qmap_count(&mgrp->mcm_port_tbl)) { in osm_mgrp_cleanup()
167 mcm_port = (osm_mcm_port_t *) cl_qmap_head(&mgrp->mcm_port_tbl); in osm_mgrp_cleanup()
168 cl_qmap_remove_item(&mgrp->mcm_port_tbl, &mcm_port->map_item); in osm_mgrp_cleanup()
169 cl_qlist_remove_item(&mcm_port->port->mcm_list, in osm_mgrp_cleanup()
170 &mcm_port->list_item); in osm_mgrp_cleanup()
174 if (mgrp->well_known) in osm_mgrp_cleanup()
177 cl_fmap_remove_item(&subn->mgrp_mgid_tbl, &mgrp->map_item); in osm_mgrp_cleanup()
179 mbox = osm_get_mbox_by_mlid(subn, mgrp->mlid); in osm_mgrp_cleanup()
180 cl_qlist_remove_item(&mbox->mgrp_list, &mgrp->list_item); in osm_mgrp_cleanup()
181 if (cl_is_qlist_empty(&mbox->mgrp_list)) { in osm_mgrp_cleanup()
182 subn->mboxes[cl_ntoh16(mgrp->mlid) - IB_LID_MCAST_START_HO] = NULL; in osm_mgrp_cleanup()
183 mgrp_box_delete(mbox); in osm_mgrp_cleanup()
187 subn->p_osm->sa.dirty = TRUE; in osm_mgrp_cleanup()
200 notice.issuer_lid = subn->sm_base_lid; in mgrp_send_notice()
201 /* following o14-12.1.11 and table 120 p726 */ in mgrp_send_notice()
204 &mgrp->mcmember_rec.mgid, sizeof(ib_gid_t)); in mgrp_send_notice()
206 /* According to page 653 - the issuer gid in this case of trap in mgrp_send_notice()
208 notice.issuer_gid.unicast.prefix = subn->opt.subnet_prefix; in mgrp_send_notice()
209 notice.issuer_gid.unicast.interface_id = subn->sm_port_guid; in mgrp_send_notice()
227 if (mcm_alias_guid->p_base_mcm_port->port == port) { in is_qmap_empty_for_port()
246 if (mcm_alias_guid->p_base_mcm_port == mcm_port) { in is_qmap_empty_for_mcm_port()
261 (osm_mcm_alias_guid_t *) cl_qmap_insert(&mgrp->mcm_alias_port_tbl, in insert_alias_guid()
262 p_mcm_alias_guid->alias_guid, in insert_alias_guid()
263 &p_mcm_alias_guid->map_item); in insert_alias_guid()
264 if (p_mcm_alias_guid_check != (osm_mcm_alias_guid_t *) &p_mcm_alias_guid->map_item) { in insert_alias_guid()
279 uint8_t prev_join_state = 0, join_state = mcmr->scope_state; in osm_mgrp_add_port()
287 cl_ntoh64(mcmr->port_gid.unicast.interface_id), in osm_mgrp_add_port()
288 cl_ntoh64(port->guid), in osm_mgrp_add_port()
289 inet_ntop(AF_INET6, mgrp->mcmember_rec.mgid.raw, in osm_mgrp_add_port()
291 cl_ntoh16(mgrp->mlid)); in osm_mgrp_add_port()
311 prev_item = cl_qmap_insert(&mgrp->mcm_port_tbl, port->guid, in osm_mgrp_add_port()
312 &mcm_port->map_item); in osm_mgrp_add_port()
314 if (prev_item != &mcm_port->map_item) { /* mcm port already exists */ in osm_mgrp_add_port()
318 p_mcm_alias_guid->p_base_mcm_port = (osm_mcm_port_t *) prev_item; in osm_mgrp_add_port()
322 ib_member_get_scope_state(p_mcm_alias_guid->scope_state, in osm_mgrp_add_port()
324 p_mcm_alias_guid->scope_state = in osm_mgrp_add_port()
330 cl_qlist_insert_tail(&port->mcm_list, &mcm_port->list_item); in osm_mgrp_add_port()
331 osm_sm_reroute_mlid(&subn->p_osm->sm, mgrp->mlid); in osm_mgrp_add_port()
335 mcmr->scope_state = p_mcm_alias_guid->scope_state; in osm_mgrp_add_port()
339 ++mgrp->full_members == 1) in osm_mgrp_add_port()
342 subn->p_osm->sa.dirty = TRUE; in osm_mgrp_add_port()
350 uint8_t join_state = mcmr->scope_state & 0xf; in osm_mgrp_remove_port()
355 * according to the same o15-0.1.14 we get the stored in osm_mgrp_remove_port()
357 * opposite to leave - otherwise just update it in osm_mgrp_remove_port()
359 port_join_state = mcm_alias_guid->scope_state & 0x0F; in osm_mgrp_remove_port()
367 cl_ntoh64(mcm_alias_guid->alias_guid), in osm_mgrp_remove_port()
368 cl_ntoh64(mcm_alias_guid->p_base_mcm_port->port->guid), in osm_mgrp_remove_port()
369 inet_ntop(AF_INET6, mgrp->mcmember_rec.mgid.raw, in osm_mgrp_remove_port()
371 cl_ntoh16(mgrp->mlid)); in osm_mgrp_remove_port()
376 (mgrp->full_members > (port_join_state & IB_JOIN_STATE_FULL) ? 1 : 0))) { in osm_mgrp_remove_port()
377 mcm_alias_guid->scope_state = in osm_mgrp_remove_port()
378 new_join_state | (mcm_alias_guid->scope_state & 0xf0); in osm_mgrp_remove_port()
381 " JoinState 0x%x -> 0x%x\n", in osm_mgrp_remove_port()
382 cl_ntoh64(mcm_alias_guid->alias_guid), in osm_mgrp_remove_port()
383 cl_ntoh64(mcm_alias_guid->p_base_mcm_port->port->guid), in osm_mgrp_remove_port()
385 mcmr->scope_state = mcm_alias_guid->scope_state; in osm_mgrp_remove_port()
387 mcmr->scope_state = mcm_alias_guid->scope_state & 0xf0; in osm_mgrp_remove_port()
389 cl_ntoh64(mcm_alias_guid->alias_guid)); in osm_mgrp_remove_port()
390 cl_qmap_remove_item(&mgrp->mcm_alias_port_tbl, in osm_mgrp_remove_port()
391 &mcm_alias_guid->map_item); in osm_mgrp_remove_port()
392 if (is_qmap_empty_for_port(&mgrp->mcm_alias_port_tbl, in osm_mgrp_remove_port()
393 mcm_alias_guid->p_base_mcm_port->port)) { /* last alias in mcast group for this port */ in osm_mgrp_remove_port()
395 cl_ntoh64(mcm_alias_guid->p_base_mcm_port->port->guid)); in osm_mgrp_remove_port()
396 cl_qmap_remove_item(&mgrp->mcm_port_tbl, in osm_mgrp_remove_port()
397 &mcm_alias_guid->p_base_mcm_port->map_item); in osm_mgrp_remove_port()
398 cl_qlist_remove_item(&mcm_alias_guid->p_base_mcm_port->port->mcm_list, in osm_mgrp_remove_port()
399 &mcm_alias_guid->p_base_mcm_port->list_item); in osm_mgrp_remove_port()
400 if (is_qmap_empty_for_mcm_port(&mgrp->mcm_alias_port_tbl, in osm_mgrp_remove_port()
401 mcm_alias_guid->p_base_mcm_port)) /* last alias in mcast group for this mcm port */ in osm_mgrp_remove_port()
402 osm_mcm_port_delete(mcm_alias_guid->p_base_mcm_port); in osm_mgrp_remove_port()
403 osm_sm_reroute_mlid(&subn->p_osm->sm, mgrp->mlid); in osm_mgrp_remove_port()
408 /* no more full members so the group will be deleted after re-route in osm_mgrp_remove_port()
412 --mgrp->full_members == 0) { in osm_mgrp_remove_port()
418 subn->p_osm->sa.dirty = TRUE; in osm_mgrp_remove_port()
430 next_mcm_alias_guid = (osm_mcm_alias_guid_t *) cl_qmap_head(&mgrp->mcm_alias_port_tbl); in osm_mgrp_delete_port()
431 while (next_mcm_alias_guid != (osm_mcm_alias_guid_t *) cl_qmap_end(&mgrp->mcm_alias_port_tbl) && in osm_mgrp_delete_port()
434 next_mcm_alias_guid = (osm_mcm_alias_guid_t *) cl_qmap_next(&next_mcm_alias_guid->map_item); in osm_mgrp_delete_port()
435 if (mcm_alias_guid->p_base_mcm_port->port == port) { in osm_mgrp_delete_port()
446 cl_map_item_t *item = cl_qmap_get(&p_mgrp->mcm_port_tbl, port_guid); in osm_mgrp_get_mcm_port()
447 if (item != cl_qmap_end(&p_mgrp->mcm_port_tbl)) in osm_mgrp_get_mcm_port()
455 cl_map_item_t *item = cl_qmap_get(&p_mgrp->mcm_alias_port_tbl, in osm_mgrp_get_mcm_alias_guid()
457 if (item != cl_qmap_end(&p_mgrp->mcm_alias_port_tbl)) in osm_mgrp_get_mcm_alias_guid()