Lines Matching refs:grp

109 mac_bcast_grp_mip(void *grp)  in mac_bcast_grp_mip()  argument
111 mac_bcast_grp_t *bcast_grp = grp; in mac_bcast_grp_mip()
123 mac_bcast_grp_t *grp = bcast_grp; in mac_bcast_grp_free() local
124 mac_impl_t *mip = grp->mbg_mac_impl; in mac_bcast_grp_free()
128 ASSERT(grp->mbg_addr != NULL); in mac_bcast_grp_free()
129 kmem_free(grp->mbg_addr, mip->mi_type->mt_addr_length); in mac_bcast_grp_free()
130 kmem_free(grp->mbg_clients, in mac_bcast_grp_free()
131 grp->mbg_nclients_alloc * sizeof (mac_bcast_grp_mcip_t)); in mac_bcast_grp_free()
133 kmem_cache_free(mac_bcast_grp_cache, grp); in mac_bcast_grp_free()
144 mac_bcast_grp_t *grp = arg1; in mac_bcast_send() local
146 mac_impl_t *mip = grp->mbg_mac_impl; in mac_bcast_send()
167 for (i = 0; i < grp->mbg_nclients_alloc; i++) { in mac_bcast_send()
168 dst_mcip = grp->mbg_clients[i].mgb_client; in mac_bcast_send()
193 gen = grp->mbg_clients_gen; in mac_bcast_send()
209 if (grp->mbg_addrtype == MAC_ADDRTYPE_MULTICAST) { in mac_bcast_send()
219 if (grp->mbg_clients_gen != gen) { in mac_bcast_send()
262 mac_bcast_grp_t *grp = NULL, **last_grp; in mac_bcast_add() local
331 for (grp = *last_grp; grp != NULL; in mac_bcast_add()
332 last_grp = &grp->mbg_next, grp = grp->mbg_next) { in mac_bcast_add()
333 if (bcmp(grp->mbg_addr, addr, addr_len) == 0 && in mac_bcast_add()
334 grp->mbg_vid == vid) in mac_bcast_add()
338 if (grp == NULL) { in mac_bcast_add()
345 grp = kmem_cache_alloc(mac_bcast_grp_cache, KM_SLEEP); in mac_bcast_add()
346 bzero(grp, sizeof (mac_bcast_grp_t)); in mac_bcast_add()
347 grp->mbg_next = NULL; in mac_bcast_add()
348 grp->mbg_mac_impl = mip; in mac_bcast_add()
351 grp); in mac_bcast_add()
353 grp->mbg_addr = kmem_zalloc(addr_len, KM_SLEEP); in mac_bcast_add()
354 bcopy(addr, grp->mbg_addr, addr_len); in mac_bcast_add()
355 grp->mbg_addrtype = addrtype; in mac_bcast_add()
356 grp->mbg_vid = vid; in mac_bcast_add()
371 grp->mbg_id = atomic_inc_32_nv(&mac_bcast_id); in mac_bcast_add()
373 "mac/%s/mcast%d", mip->mi_name, grp->mbg_id); in mac_bcast_add()
376 grp, FLOW_MCAST, &grp->mbg_flow_ent); in mac_bcast_add()
378 kmem_free(grp->mbg_addr, addr_len); in mac_bcast_add()
379 kmem_cache_free(mac_bcast_grp_cache, grp); in mac_bcast_add()
382 grp->mbg_flow_ent->fe_mbg = grp; in mac_bcast_add()
389 FLOW_REFHOLD(grp->mbg_flow_ent); in mac_bcast_add()
408 grp->mbg_flow_ent->fe_cb_fn = mac_bcast_send; in mac_bcast_add()
409 grp->mbg_flow_ent->fe_cb_arg1 = grp; in mac_bcast_add()
410 grp->mbg_flow_ent->fe_cb_arg2 = NULL; in mac_bcast_add()
412 rc = mac_flow_add(mip->mi_flow_tab, grp->mbg_flow_ent); in mac_bcast_add()
414 FLOW_FINAL_REFRELE(grp->mbg_flow_ent); in mac_bcast_add()
418 *last_grp = grp; in mac_bcast_add()
421 ASSERT(grp->mbg_addrtype == addrtype); in mac_bcast_add()
428 for (i = 0; i < grp->mbg_nclients_alloc; i++) { in mac_bcast_add()
434 if (grp->mbg_clients[i].mgb_client == mcip) { in mac_bcast_add()
435 grp->mbg_clients[i].mgb_client_ref++; in mac_bcast_add()
438 } else if (grp->mbg_clients[i].mgb_client == NULL && in mac_bcast_add()
443 if (grp->mbg_nclients_alloc == grp->mbg_nclients) { in mac_bcast_add()
445 uint_t new_size = grp->mbg_nclients+1; in mac_bcast_add()
450 if (grp->mbg_nclients > 0) { in mac_bcast_add()
451 ASSERT(grp->mbg_clients != NULL); in mac_bcast_add()
452 bcopy(grp->mbg_clients, new_clients, grp->mbg_nclients * in mac_bcast_add()
454 kmem_free(grp->mbg_clients, grp->mbg_nclients * in mac_bcast_add()
458 grp->mbg_clients = new_clients; in mac_bcast_add()
459 grp->mbg_nclients_alloc = new_size; in mac_bcast_add()
464 grp->mbg_clients[index].mgb_client = mcip; in mac_bcast_add()
465 grp->mbg_clients[index].mgb_client_ref = 1; in mac_bcast_add()
466 grp->mbg_nclients++; in mac_bcast_add()
472 grp->mbg_clients_gen++; in mac_bcast_add()
501 mac_bcast_grp_t *grp = NULL, **prev; in mac_bcast_delete() local
512 for (grp = mip->mi_bcast_grp; grp != NULL; prev = &grp->mbg_next, in mac_bcast_delete()
513 grp = grp->mbg_next) { in mac_bcast_delete()
514 if (bcmp(grp->mbg_addr, addr, addr_len) == 0 && in mac_bcast_delete()
515 grp->mbg_vid == vid) in mac_bcast_delete()
518 ASSERT(grp != NULL); in mac_bcast_delete()
530 for (i = 0; i < grp->mbg_nclients_alloc; i++) { in mac_bcast_delete()
531 if (grp->mbg_clients[i].mgb_client == mcip) in mac_bcast_delete()
535 ASSERT(i < grp->mbg_nclients_alloc); in mac_bcast_delete()
540 if (--grp->mbg_clients[i].mgb_client_ref > 0) in mac_bcast_delete()
543 grp->mbg_clients[i].mgb_client = NULL; in mac_bcast_delete()
544 grp->mbg_clients[i].mgb_client_ref = 0; in mac_bcast_delete()
551 grp->mbg_clients_gen++; in mac_bcast_delete()
553 if (--grp->mbg_nclients == 0) { in mac_bcast_delete()
561 *prev = grp->mbg_next; in mac_bcast_delete()
566 if (grp->mbg_addrtype == MAC_ADDRTYPE_MULTICAST) { in mac_bcast_delete()
570 if (bcmp(grp->mbg_addr, maddr->mma_addr, in mac_bcast_delete()
584 if (bcmp(grp->mbg_addr, maddr->mma_addr, in mac_bcast_delete()
601 flent = grp->mbg_flow_ent; in mac_bcast_delete()
602 if (grp->mbg_nclients == 0) { in mac_bcast_delete()
617 mac_mcast_addrs_t *grp, *next; in mac_bcast_refresh() local
628 for (grp = mip->mi_mcast_addrs; grp != NULL; grp = next) { in mac_bcast_refresh()
636 next = grp->mma_next; in mac_bcast_refresh()
637 refresh_fn(arg, add, grp->mma_addr); in mac_bcast_refresh()
649 mac_mcast_addrs_t *grp, *next; in mac_client_bcast_refresh() local
661 for (grp = mcip->mci_mcast_addrs; grp != NULL; grp = next) { in mac_client_bcast_refresh()
669 next = grp->mma_next; in mac_client_bcast_refresh()
670 refresh_fn(arg, add, grp->mma_addr); in mac_client_bcast_refresh()