Lines Matching refs:V_tcp_hostcache

116 #define	V_tcp_hostcache		VNET(tcp_hostcache)  macro
177 V_tcp_hostcache.hashmask)
185 V_tcp_hostcache.hashmask)
199 V_tcp_hostcache.cache_count = 0; in tcp_hc_init()
200 V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE; in tcp_hc_init()
201 V_tcp_hostcache.bucket_limit = TCP_HOSTCACHE_BUCKETLIMIT; in tcp_hc_init()
202 V_tcp_hostcache.expire = TCP_HOSTCACHE_EXPIRE; in tcp_hc_init()
203 V_tcp_hostcache.prune = TCP_HOSTCACHE_PRUNE; in tcp_hc_init()
206 &V_tcp_hostcache.hashsize); in tcp_hc_init()
207 if (!powerof2(V_tcp_hostcache.hashsize)) { in tcp_hc_init()
209 V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE; /* default */ in tcp_hc_init()
211 V_tcp_hostcache.hashmask = V_tcp_hostcache.hashsize - 1; in tcp_hc_init()
214 &V_tcp_hostcache.bucket_limit); in tcp_hc_init()
216 cache_limit = V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit; in tcp_hc_init()
217 V_tcp_hostcache.cache_limit = cache_limit; in tcp_hc_init()
219 &V_tcp_hostcache.cache_limit); in tcp_hc_init()
220 if (V_tcp_hostcache.cache_limit > cache_limit) in tcp_hc_init()
221 V_tcp_hostcache.cache_limit = cache_limit; in tcp_hc_init()
226 V_tcp_hostcache.hashbase = (struct hc_head *) in tcp_hc_init()
227 malloc(V_tcp_hostcache.hashsize * sizeof(struct hc_head), in tcp_hc_init()
233 for (i = 0; i < V_tcp_hostcache.hashsize; i++) { in tcp_hc_init()
234 TAILQ_INIT(&V_tcp_hostcache.hashbase[i].hch_bucket); in tcp_hc_init()
235 V_tcp_hostcache.hashbase[i].hch_length = 0; in tcp_hc_init()
236 mtx_init(&V_tcp_hostcache.hashbase[i].hch_mtx, "tcp_hc_entry", in tcp_hc_init()
243 V_tcp_hostcache.zone = in tcp_hc_init()
246 uma_zone_set_max(V_tcp_hostcache.zone, V_tcp_hostcache.cache_limit); in tcp_hc_init()
252 callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, in tcp_hc_init()
268 uma_zdestroy(V_tcp_hostcache.zone); in tcp_hc_destroy()
270 for (i = 0; i < V_tcp_hostcache.hashsize; i++) in tcp_hc_destroy()
271 mtx_destroy(&V_tcp_hostcache.hashbase[i].hch_mtx); in tcp_hc_destroy()
272 free(V_tcp_hostcache.hashbase, M_HOSTCACHE); in tcp_hc_destroy()
302 hc_head = &V_tcp_hostcache.hashbase[hash]; in tcp_hc_lookup()
361 hc_head = &V_tcp_hostcache.hashbase[hash]; in tcp_hc_insert()
373 if (hc_head->hch_length >= V_tcp_hostcache.bucket_limit || in tcp_hc_insert()
374 V_tcp_hostcache.cache_count >= V_tcp_hostcache.cache_limit) { in tcp_hc_insert()
390 V_tcp_hostcache.hashbase[hash].hch_length--; in tcp_hc_insert()
391 V_tcp_hostcache.cache_count--; in tcp_hc_insert()
394 uma_zfree(V_tcp_hostcache.zone, hc_entry); in tcp_hc_insert()
400 hc_entry = uma_zalloc(V_tcp_hostcache.zone, M_NOWAIT); in tcp_hc_insert()
417 hc_entry->rmx_expire = V_tcp_hostcache.expire; in tcp_hc_insert()
423 V_tcp_hostcache.hashbase[hash].hch_length++; in tcp_hc_insert()
424 V_tcp_hostcache.cache_count++; in tcp_hc_insert()
456 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_get()
491 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_getmtu()
524 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_updatemtu()
559 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_update()
636 sbuf_new(&sb, NULL, linesize * (V_tcp_hostcache.cache_count + 1), in sysctl_tcp_hc_list()
644 for (i = 0; i < V_tcp_hostcache.hashsize; i++) { in sysctl_tcp_hc_list()
645 THC_LOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); in sysctl_tcp_hc_list()
646 TAILQ_FOREACH(hc_entry, &V_tcp_hostcache.hashbase[i].hch_bucket, in sysctl_tcp_hc_list()
671 THC_UNLOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); in sysctl_tcp_hc_list()
690 for (i = 0; i < V_tcp_hostcache.hashsize; i++) { in tcp_hc_purge_internal()
691 THC_LOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); in tcp_hc_purge_internal()
693 &V_tcp_hostcache.hashbase[i].hch_bucket, rmx_q, hc_next) { in tcp_hc_purge_internal()
695 TAILQ_REMOVE(&V_tcp_hostcache.hashbase[i].hch_bucket, in tcp_hc_purge_internal()
697 uma_zfree(V_tcp_hostcache.zone, hc_entry); in tcp_hc_purge_internal()
698 V_tcp_hostcache.hashbase[i].hch_length--; in tcp_hc_purge_internal()
699 V_tcp_hostcache.cache_count--; in tcp_hc_purge_internal()
701 hc_entry->rmx_expire -= V_tcp_hostcache.prune; in tcp_hc_purge_internal()
703 THC_UNLOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); in tcp_hc_purge_internal()
717 if (V_tcp_hostcache.purgeall) { in tcp_hc_purge()
719 V_tcp_hostcache.purgeall = 0; in tcp_hc_purge()
724 callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, in tcp_hc_purge()
744 callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, in sysctl_tcp_hc_purgenow()