Lines Matching refs:grp

45 #define	IPMP_GRP_TO_IPST(grp)		PHYINT_TO_IPST((grp)->gr_phyint)  argument
127 ipmp_grp_t *grp; in ipmp_grp_create() local
133 if ((grp = kmem_zalloc(sizeof (ipmp_grp_t), KM_NOSLEEP)) == NULL) in ipmp_grp_create()
136 (void) strlcpy(grp->gr_name, grname, sizeof (grp->gr_name)); in ipmp_grp_create()
137 (void) strlcpy(grp->gr_ifname, grname, sizeof (grp->gr_ifname)); in ipmp_grp_create()
143 grp->gr_phyint = phyi; in ipmp_grp_create()
148 if (ipmp_grp_create_kstats(grp) != 0) { in ipmp_grp_create()
149 kmem_free(grp, sizeof (ipmp_grp_t)); in ipmp_grp_create()
157 ipmp_grp_destroy_kstats(grp); in ipmp_grp_create()
158 kmem_free(grp, sizeof (ipmp_grp_t)); in ipmp_grp_create()
161 ipmp_grp_insert(grp, mh); in ipmp_grp_create()
163 return (grp); in ipmp_grp_create()
170 ipmp_grp_create_kstats(ipmp_grp_t *grp) in ipmp_grp_create_kstats() argument
173 netstackid_t id = IPMP_GRP_TO_IPST(grp)->ips_netstack->netstack_stackid; in ipmp_grp_create_kstats()
175 ksp = kstat_create_netstack("ipmp", 0, grp->gr_ifname, "net", in ipmp_grp_create_kstats()
181 ksp->ks_private = grp; in ipmp_grp_create_kstats()
185 grp->gr_ksp = ksp; in ipmp_grp_create_kstats()
197 ipmp_grp_t *grp = ksp->ks_private; in ipmp_grp_update_kstats() local
198 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_update_kstats()
199 ipsq_t *ipsq, *grp_ipsq = grp->gr_phyint->phyint_ipsq; in ipmp_grp_update_kstats()
211 kn[i].value.ui32 = grp->gr_kstats0[i]; in ipmp_grp_update_kstats()
214 kn[i].value.ui64 = grp->gr_kstats0[i]; in ipmp_grp_update_kstats()
253 (grp->gr_phyint->phyint_flags & PHYI_RUNNING) != 0; in ipmp_grp_update_kstats()
263 ipmp_grp_destroy_kstats(ipmp_grp_t *grp) in ipmp_grp_destroy_kstats() argument
265 netstackid_t id = IPMP_GRP_TO_IPST(grp)->ips_netstack->netstack_stackid; in ipmp_grp_destroy_kstats()
267 kstat_delete_netstack(grp->gr_ksp, id); in ipmp_grp_destroy_kstats()
268 bzero(grp->gr_kstats0, sizeof (grp->gr_kstats0)); in ipmp_grp_destroy_kstats()
269 grp->gr_ksp = NULL; in ipmp_grp_destroy_kstats()
279 ipmp_grp_t *grp; in ipmp_grp_lookup() local
284 (mod_hash_val_t *)&grp) == 0) in ipmp_grp_lookup()
285 return (grp); in ipmp_grp_lookup()
294 ipmp_grp_info(const ipmp_grp_t *grp, lifgroupinfo_t *lifgr) in ipmp_grp_info() argument
297 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_info()
301 lifgr->gi_v4 = (grp->gr_v4 != NULL); in ipmp_grp_info()
302 lifgr->gi_v6 = (grp->gr_v6 != NULL); in ipmp_grp_info()
303 lifgr->gi_nv4 = grp->gr_nv4 + grp->gr_pendv4; in ipmp_grp_info()
304 lifgr->gi_nv6 = grp->gr_nv6 + grp->gr_pendv6; in ipmp_grp_info()
305 lifgr->gi_mactype = grp->gr_nif > 0 ? grp->gr_mactype : SUNW_DL_IPMP; in ipmp_grp_info()
306 (void) strlcpy(lifgr->gi_grifname, grp->gr_ifname, LIFNAMSIZ); in ipmp_grp_info()
311 if (grp->gr_v4 != NULL && (ill = grp->gr_v4->ig_cast_ill) != NULL) { in ipmp_grp_info()
316 if (grp->gr_v6 != NULL && (ill = grp->gr_v6->ig_cast_ill) != NULL) in ipmp_grp_info()
325 ipmp_grp_insert(ipmp_grp_t *grp, mod_hash_hndl_t mh) in ipmp_grp_insert() argument
328 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_insert()
337 (mod_hash_key_t)grp->gr_name, (mod_hash_val_t)grp, mh); in ipmp_grp_insert()
343 grp->gr_name, err); in ipmp_grp_insert()
351 ipmp_grp_remove(ipmp_grp_t *grp) in ipmp_grp_remove() argument
355 mod_hash_key_t key = (mod_hash_key_t)grp->gr_name; in ipmp_grp_remove()
356 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_remove()
361 if (err != 0 || val != grp) { in ipmp_grp_remove()
363 grp->gr_name, err); in ipmp_grp_remove()
372 ipmp_grp_rename(ipmp_grp_t *grp, const char *grname) in ipmp_grp_rename() argument
375 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_rename()
383 (mod_hash_val_t *)&grp) != MH_ERR_NOTFOUND) in ipmp_grp_rename()
393 ipmp_grp_remove(grp); in ipmp_grp_rename()
394 (void) strlcpy(grp->gr_name, grname, sizeof (grp->gr_name)); in ipmp_grp_rename()
395 ipmp_grp_insert(grp, mh); in ipmp_grp_rename()
405 ipmp_grp_destroy(ipmp_grp_t *grp) in ipmp_grp_destroy() argument
407 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_destroy()
415 if (grp->gr_nif != 0) in ipmp_grp_destroy()
416 panic("cannot destroy IPMP group \"%s\": in use", grp->gr_name); in ipmp_grp_destroy()
418 ipmp_grp_remove(grp); in ipmp_grp_destroy()
419 ipmp_grp_destroy_kstats(grp); in ipmp_grp_destroy()
421 ASSERT(grp->gr_v4 == NULL); in ipmp_grp_destroy()
422 ASSERT(grp->gr_v6 == NULL); in ipmp_grp_destroy()
423 ASSERT(grp->gr_nv4 == 0); in ipmp_grp_destroy()
424 ASSERT(grp->gr_nv6 == 0); in ipmp_grp_destroy()
425 ASSERT(grp->gr_nactif == 0); in ipmp_grp_destroy()
426 ASSERT(grp->gr_linkdownmp == NULL); in ipmp_grp_destroy()
427 grp->gr_phyint = NULL; in ipmp_grp_destroy()
429 kmem_free(grp, sizeof (ipmp_grp_t)); in ipmp_grp_destroy()
439 ipmp_grp_vet_ill(ipmp_grp_t *grp, ill_t *ill) in ipmp_grp_vet_ill() argument
441 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_vet_ill()
499 if (grp->gr_nif > 0 && grp->gr_mactype != ill->ill_mactype) in ipmp_grp_vet_ill()
511 ipmp_grp_vet_phyint(ipmp_grp_t *grp, phyint_t *phyi) in ipmp_grp_vet_phyint() argument
514 ip_stack_t *ipst = IPMP_GRP_TO_IPST(grp); in ipmp_grp_vet_phyint()
523 if (phyi->phyint_illv4 != NULL && grp->gr_v4 == NULL || in ipmp_grp_vet_phyint()
524 phyi->phyint_illv6 != NULL && grp->gr_v6 == NULL) in ipmp_grp_vet_phyint()
528 err = ipmp_grp_vet_ill(grp, phyi->phyint_illv4); in ipmp_grp_vet_phyint()
530 err = ipmp_grp_vet_ill(grp, phyi->phyint_illv6); in ipmp_grp_vet_phyint()
1059 ipmp_illgrp_link_grp(ipmp_illgrp_t *illg, ipmp_grp_t *grp) in ipmp_illgrp_link_grp() argument
1066 ASSERT(grp->gr_v6 == NULL || grp->gr_v6 == illg); in ipmp_illgrp_link_grp()
1067 grp->gr_v6 = illg; in ipmp_illgrp_link_grp()
1069 ASSERT(grp->gr_v4 == NULL || grp->gr_v4 == illg); in ipmp_illgrp_link_grp()
1070 grp->gr_v4 = illg; in ipmp_illgrp_link_grp()
1081 ipmp_grp_t *grp = illg->ig_ipmp_ill->ill_phyint->phyint_grp; in ipmp_illgrp_unlink_grp() local
1087 if (grp->gr_nv6 + grp->gr_pendv6 != 0) in ipmp_illgrp_unlink_grp()
1089 grp->gr_v6 = NULL; in ipmp_illgrp_unlink_grp()
1091 if (grp->gr_nv4 + grp->gr_pendv4 != 0) in ipmp_illgrp_unlink_grp()
1093 grp->gr_v4 = NULL; in ipmp_illgrp_unlink_grp()
1427 ipmp_grp_t *grp = ill->ill_phyint->phyint_grp; in ipmp_ill_activate() local
1439 if (grp->gr_nactif == 0) { in ipmp_ill_activate()
1498 if (grp->gr_nactif++ == 0) { in ipmp_ill_activate()
1499 ASSERT(grp->gr_linkdownmp == NULL); in ipmp_ill_activate()
1500 grp->gr_linkdownmp = linkdownmp; in ipmp_ill_activate()
1519 ipmp_grp_t *grp = ill->ill_phyint->phyint_grp; in ipmp_ill_deactivate() local
1594 if (--grp->gr_nactif == 0) { in ipmp_ill_deactivate()
1596 mp = grp->gr_linkdownmp; in ipmp_ill_deactivate()
1597 grp->gr_linkdownmp = NULL; in ipmp_ill_deactivate()
1888 ipmp_grp_t *grp; in ipmp_ill_get_ipmp_ifindex() local
1893 if ((grp = ill->ill_phyint->phyint_grp) != NULL) in ipmp_ill_get_ipmp_ifindex()
1894 ifindex = grp->gr_phyint->phyint_ifindex; in ipmp_ill_get_ipmp_ifindex()
1903 ipmp_phyint_join_grp(phyint_t *phyi, ipmp_grp_t *grp) in ipmp_phyint_join_grp() argument
1907 ipsq_t *grp_ipsq = grp->gr_phyint->phyint_ipsq; in ipmp_phyint_join_grp()
1935 phyi->phyint_grp = grp; in ipmp_phyint_join_grp()
1936 if (++grp->gr_nif == 1) in ipmp_phyint_join_grp()
1937 grp->gr_mactype = ill->ill_mactype; in ipmp_phyint_join_grp()
1939 ASSERT(grp->gr_mactype == ill->ill_mactype); in ipmp_phyint_join_grp()