Lines Matching defs:ipst

130 dcb_reclaim(dcb_t *dcb, ip_stack_t *ipst, uint_t fraction)
137 uint_t max = ipst->ips_ip_dce_reclaim_threshold;
148 ipst->ips_ip_pathmtu_interval) {
172 IP_STAT(ipst, ip_dce_reclaim_deleted);
184 ip_dce_reclaim_stack(ip_stack_t *ipst)
188 IP_STAT(ipst, ip_dce_reclaim_calls);
189 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
190 dcb_reclaim(&ipst->ips_dce_hash_v4[i], ipst,
191 ipst->ips_ip_dce_reclaim_fraction);
193 dcb_reclaim(&ipst->ips_dce_hash_v6[i], ipst,
194 ipst->ips_ip_dce_reclaim_fraction);
202 ipcl_walk(conn_ixa_cleanup, (void *)B_FALSE, ipst);
215 ip_stack_t *ipst;
225 if ((ipst = ns->netstack_ip) == NULL) {
229 if (atomic_swap_uint(&ipst->ips_dce_reclaim_needed, 0) != 0)
230 ip_dce_reclaim_stack(ipst);
302 dce_stack_init(ip_stack_t *ipst)
306 ipst->ips_dce_default = kmem_cache_alloc(dce_cache, KM_SLEEP);
307 bzero(ipst->ips_dce_default, sizeof (dce_t));
308 ipst->ips_dce_default->dce_flags = DCEF_DEFAULT;
309 ipst->ips_dce_default->dce_generation = DCE_GENERATION_INITIAL;
310 ipst->ips_dce_default->dce_last_change_time =
312 ipst->ips_dce_default->dce_refcnt = 1; /* Should never go away */
313 ipst->ips_dce_default->dce_ipst = ipst;
316 ipst->ips_dce_hashsize = ip_dce_hash_size;
317 ipst->ips_dce_hash_v4 = kmem_zalloc(ipst->ips_dce_hashsize *
319 ipst->ips_dce_hash_v6 = kmem_zalloc(ipst->ips_dce_hashsize *
321 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
322 rw_init(&ipst->ips_dce_hash_v4[i].dcb_lock, NULL, RW_DEFAULT,
324 rw_init(&ipst->ips_dce_hash_v6[i].dcb_lock, NULL, RW_DEFAULT,
330 dce_stack_destroy(ip_stack_t *ipst)
333 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
334 rw_destroy(&ipst->ips_dce_hash_v4[i].dcb_lock);
335 rw_destroy(&ipst->ips_dce_hash_v6[i].dcb_lock);
337 kmem_free(ipst->ips_dce_hash_v4,
338 ipst->ips_dce_hashsize * sizeof (dcb_t));
339 ipst->ips_dce_hash_v4 = NULL;
340 kmem_free(ipst->ips_dce_hash_v6,
341 ipst->ips_dce_hashsize * sizeof (dcb_t));
342 ipst->ips_dce_hash_v6 = NULL;
343 ipst->ips_dce_hashsize = 0;
345 ASSERT(ipst->ips_dce_default->dce_refcnt == 1);
346 kmem_cache_free(dce_cache, ipst->ips_dce_default);
347 ipst->ips_dce_default = NULL;
352 dce_get_default(ip_stack_t *ipst)
356 dce = ipst->ips_dce_default;
405 dce_lookup_v4(ipaddr_t dst, ip_stack_t *ipst, uint_t *generationp)
413 *generationp = ipst->ips_dce_default->dce_generation;
415 hash = IRE_ADDR_HASH(dst, ipst->ips_dce_hashsize);
416 dcb = &ipst->ips_dce_hash_v4[hash];
434 dce = ipst->ips_dce_default;
445 dce_lookup_v6(const in6_addr_t *dst, uint_t ifindex, ip_stack_t *ipst,
454 *generationp = ipst->ips_dce_default->dce_generation;
456 hash = IRE_ADDR_HASH_V6(*dst, ipst->ips_dce_hashsize);
457 dcb = &ipst->ips_dce_hash_v6[hash];
476 dce = ipst->ips_dce_default;
488 dce_lookup_and_add_v4(ipaddr_t dst, ip_stack_t *ipst)
494 hash = IRE_ADDR_HASH(dst, ipst->ips_dce_hashsize);
495 dcb = &ipst->ips_dce_hash_v4[hash];
500 if (dcb->dcb_cnt > ipst->ips_ip_dce_reclaim_threshold)
501 atomic_or_uint(&ipst->ips_dce_reclaim_needed, 1);
521 dce->dce_ipst = ipst; /* No netstack_hold */
540 dce->dce_ident = ipst->ips_dce_default->dce_ident + 1;
542 dce_increment_generation(ipst->ips_dce_default);
554 dce_lookup_and_add_v6(const in6_addr_t *dst, uint_t ifindex, ip_stack_t *ipst)
563 hash = IRE_ADDR_HASH_V6(*dst, ipst->ips_dce_hashsize);
564 dcb = &ipst->ips_dce_hash_v6[hash];
569 if (dcb->dcb_cnt > ipst->ips_ip_dce_reclaim_threshold)
570 atomic_or_uint(&ipst->ips_dce_reclaim_needed, 1);
592 dce->dce_ipst = ipst; /* No netstack_hold */
612 dce->dce_ident = ipst->ips_dce_default->dce_ident + 1;
613 dce_increment_generation(ipst->ips_dce_default);
681 dce_update_uinfo_v4(ipaddr_t dst, iulp_t *uinfo, ip_stack_t *ipst)
685 dce = dce_lookup_and_add_v4(dst, ipst);
696 ip_stack_t *ipst)
700 dce = dce_lookup_and_add_v6(dst, ifindex, ipst);
712 ip_stack_t *ipst)
718 return (dce_update_uinfo_v4(dst4, uinfo, ipst));
720 return (dce_update_uinfo_v6(dst, ifindex, uinfo, ipst));
727 ip_stack_t *ipst = dce->dce_ipst;
734 atomic_inc_32(&ipst->ips_num_dce_condemned);
761 dce_increment_all_generations(boolean_t isv6, ip_stack_t *ipst)
767 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
769 dcb = &ipst->ips_dce_hash_v6[i];
771 dcb = &ipst->ips_dce_hash_v4[i];
780 dce_increment_generation(ipst->ips_dce_default);
803 ip_stack_t *ipst = dce->dce_ipst;
811 atomic_dec_32(&ipst->ips_num_dce_condemned);
849 ip_snmp_get_mib2_ip_dce(queue_t *q, mblk_t *mpctl, ip_stack_t *ipst)
873 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
874 dcb = &ipst->ips_dce_hash_v4[i];
915 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
916 dcb = &ipst->ips_dce_hash_v6[i];
955 dce_cleanup(uint_t ifindex, ip_stack_t *ipst)
961 for (i = 0; i < ipst->ips_dce_hashsize; i++) {
962 dcb = &ipst->ips_dce_hash_v6[i];