Lines Matching refs:hc_entry

296 	struct hc_metrics *hc_entry;  in tcp_hc_lookup()  local
323 TAILQ_FOREACH(hc_entry, &hc_head->hch_bucket, rmx_q) { in tcp_hc_lookup()
326 if (memcmp(&inc->inc6_faddr, &hc_entry->ip6, in tcp_hc_lookup()
328 return hc_entry; in tcp_hc_lookup()
330 if (memcmp(&inc->inc_faddr, &hc_entry->ip4, in tcp_hc_lookup()
332 return hc_entry; in tcp_hc_lookup()
355 struct hc_metrics *hc_entry; in tcp_hc_insert() local
384 hc_entry = TAILQ_LAST(&hc_head->hch_bucket, hc_qhead); in tcp_hc_insert()
394 if (hc_entry == NULL) { in tcp_hc_insert()
398 TAILQ_REMOVE(&hc_head->hch_bucket, hc_entry, rmx_q); in tcp_hc_insert()
408 uma_zfree(V_tcp_hostcache.zone, hc_entry); in tcp_hc_insert()
414 hc_entry = uma_zalloc(V_tcp_hostcache.zone, M_NOWAIT); in tcp_hc_insert()
415 if (hc_entry == NULL) { in tcp_hc_insert()
424 bzero(hc_entry, sizeof(*hc_entry)); in tcp_hc_insert()
426 hc_entry->ip6 = inc->inc6_faddr; in tcp_hc_insert()
427 hc_entry->ip6_zoneid = inc->inc6_zoneid; in tcp_hc_insert()
429 hc_entry->ip4 = inc->inc_faddr; in tcp_hc_insert()
430 hc_entry->rmx_head = hc_head; in tcp_hc_insert()
431 hc_entry->rmx_expire = V_tcp_hostcache.expire; in tcp_hc_insert()
436 TAILQ_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, rmx_q); in tcp_hc_insert()
445 return hc_entry; in tcp_hc_insert()
456 struct hc_metrics *hc_entry; in tcp_hc_get() local
466 hc_entry = tcp_hc_lookup(inc); in tcp_hc_get()
471 if (hc_entry == NULL) { in tcp_hc_get()
475 hc_entry->rmx_hits++; in tcp_hc_get()
476 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_get()
478 hc_metrics_lite->rmx_mtu = hc_entry->rmx_mtu; in tcp_hc_get()
479 hc_metrics_lite->rmx_ssthresh = hc_entry->rmx_ssthresh; in tcp_hc_get()
480 hc_metrics_lite->rmx_rtt = hc_entry->rmx_rtt; in tcp_hc_get()
481 hc_metrics_lite->rmx_rttvar = hc_entry->rmx_rttvar; in tcp_hc_get()
482 hc_metrics_lite->rmx_cwnd = hc_entry->rmx_cwnd; in tcp_hc_get()
483 hc_metrics_lite->rmx_sendpipe = hc_entry->rmx_sendpipe; in tcp_hc_get()
484 hc_metrics_lite->rmx_recvpipe = hc_entry->rmx_recvpipe; in tcp_hc_get()
489 THC_UNLOCK(&hc_entry->rmx_head->hch_mtx); in tcp_hc_get()
500 struct hc_metrics *hc_entry; in tcp_hc_getmtu() local
506 hc_entry = tcp_hc_lookup(inc); in tcp_hc_getmtu()
507 if (hc_entry == NULL) { in tcp_hc_getmtu()
510 hc_entry->rmx_hits++; in tcp_hc_getmtu()
511 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_getmtu()
513 mtu = hc_entry->rmx_mtu; in tcp_hc_getmtu()
514 THC_UNLOCK(&hc_entry->rmx_head->hch_mtx); in tcp_hc_getmtu()
525 struct hc_metrics *hc_entry; in tcp_hc_updatemtu() local
533 hc_entry = tcp_hc_lookup(inc); in tcp_hc_updatemtu()
538 if (hc_entry == NULL) { in tcp_hc_updatemtu()
539 hc_entry = tcp_hc_insert(inc); in tcp_hc_updatemtu()
540 if (hc_entry == NULL) in tcp_hc_updatemtu()
543 hc_entry->rmx_updates++; in tcp_hc_updatemtu()
544 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_updatemtu()
546 hc_entry->rmx_mtu = mtu; in tcp_hc_updatemtu()
551 TAILQ_REMOVE(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); in tcp_hc_updatemtu()
552 TAILQ_INSERT_HEAD(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); in tcp_hc_updatemtu()
557 THC_UNLOCK(&hc_entry->rmx_head->hch_mtx); in tcp_hc_updatemtu()
567 struct hc_metrics *hc_entry; in tcp_hc_update() local
572 hc_entry = tcp_hc_lookup(inc); in tcp_hc_update()
573 if (hc_entry == NULL) { in tcp_hc_update()
574 hc_entry = tcp_hc_insert(inc); in tcp_hc_update()
575 if (hc_entry == NULL) in tcp_hc_update()
578 hc_entry->rmx_updates++; in tcp_hc_update()
579 hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ in tcp_hc_update()
582 if (hc_entry->rmx_rtt == 0) in tcp_hc_update()
583 hc_entry->rmx_rtt = hcml->rmx_rtt; in tcp_hc_update()
585 hc_entry->rmx_rtt = ((uint64_t)hc_entry->rmx_rtt + in tcp_hc_update()
590 if (hc_entry->rmx_rttvar == 0) in tcp_hc_update()
591 hc_entry->rmx_rttvar = hcml->rmx_rttvar; in tcp_hc_update()
593 hc_entry->rmx_rttvar = ((uint64_t)hc_entry->rmx_rttvar + in tcp_hc_update()
598 if (hc_entry->rmx_ssthresh == 0) in tcp_hc_update()
599 hc_entry->rmx_ssthresh = hcml->rmx_ssthresh; in tcp_hc_update()
601 hc_entry->rmx_ssthresh = in tcp_hc_update()
602 (hc_entry->rmx_ssthresh + hcml->rmx_ssthresh) / 2; in tcp_hc_update()
606 if (hc_entry->rmx_cwnd == 0) in tcp_hc_update()
607 hc_entry->rmx_cwnd = hcml->rmx_cwnd; in tcp_hc_update()
609 hc_entry->rmx_cwnd = ((uint64_t)hc_entry->rmx_cwnd + in tcp_hc_update()
614 if (hc_entry->rmx_sendpipe == 0) in tcp_hc_update()
615 hc_entry->rmx_sendpipe = hcml->rmx_sendpipe; in tcp_hc_update()
617 hc_entry->rmx_sendpipe = in tcp_hc_update()
618 ((uint64_t)hc_entry->rmx_sendpipe + in tcp_hc_update()
623 if (hc_entry->rmx_recvpipe == 0) in tcp_hc_update()
624 hc_entry->rmx_recvpipe = hcml->rmx_recvpipe; in tcp_hc_update()
626 hc_entry->rmx_recvpipe = in tcp_hc_update()
627 ((uint64_t)hc_entry->rmx_recvpipe + in tcp_hc_update()
632 TAILQ_REMOVE(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); in tcp_hc_update()
633 TAILQ_INSERT_HEAD(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); in tcp_hc_update()
634 THC_UNLOCK(&hc_entry->rmx_head->hch_mtx); in tcp_hc_update()
647 struct hc_metrics *hc_entry; in sysctl_tcp_hc_list() local
680 TAILQ_FOREACH(hc_entry, &V_tcp_hostcache.hashbase[i].hch_bucket, in sysctl_tcp_hc_list()
685 hc_entry->ip4.s_addr ? in sysctl_tcp_hc_list()
686 inet_ntoa_r(hc_entry->ip4, ip4buf) : in sysctl_tcp_hc_list()
688 ip6_sprintf(ip6buf, &hc_entry->ip6), in sysctl_tcp_hc_list()
692 hc_entry->rmx_mtu, in sysctl_tcp_hc_list()
693 hc_entry->rmx_ssthresh, in sysctl_tcp_hc_list()
694 msec((u_long)hc_entry->rmx_rtt * in sysctl_tcp_hc_list()
696 msec((u_long)hc_entry->rmx_rttvar * in sysctl_tcp_hc_list()
698 hc_entry->rmx_cwnd, in sysctl_tcp_hc_list()
699 hc_entry->rmx_sendpipe, in sysctl_tcp_hc_list()
700 hc_entry->rmx_recvpipe, in sysctl_tcp_hc_list()
701 hc_entry->rmx_hits, in sysctl_tcp_hc_list()
702 hc_entry->rmx_updates, in sysctl_tcp_hc_list()
703 hc_entry->rmx_expire); in sysctl_tcp_hc_list()
762 struct hc_metrics *hc_entry, *hc_next; in tcp_hc_purge_internal() local
767 TAILQ_FOREACH_SAFE(hc_entry, in tcp_hc_purge_internal()
774 if (all || hc_entry->rmx_expire <= 0) { in tcp_hc_purge_internal()
776 hc_entry, rmx_q); in tcp_hc_purge_internal()
777 uma_zfree(V_tcp_hostcache.zone, hc_entry); in tcp_hc_purge_internal()
781 hc_entry->rmx_expire -= V_tcp_hostcache.prune; in tcp_hc_purge_internal()