diff options
Diffstat (limited to 'usr/src/uts/common/inet')
34 files changed, 160 insertions, 129 deletions
diff --git a/usr/src/uts/common/inet/ilb/ilb.c b/usr/src/uts/common/inet/ilb/ilb.c index 7e6a7829d8..747c3768ad 100644 --- a/usr/src/uts/common/inet/ilb/ilb.c +++ b/usr/src/uts/common/inet/ilb/ilb.c @@ -778,7 +778,8 @@ ilb_rule_del_common(ilb_stack_t *ilbs, ilb_rule_t *tmp_rule) * by gc thread is intact. */ (void) atomic_swap_64( - (uint64_t *)&server->iser_die_time, lbolt64 + + (uint64_t *)&server->iser_die_time, + ddi_get_lbolt64() + SEC_TO_TICK(tmp_rule->ir_conn_drain_timeout)); } while (server->iser_refcnt > 1) @@ -1176,7 +1177,7 @@ ilb_server_toggle(ilb_stack_t *ilbs, zoneid_t zoneid, const char *rule_name, if (rule->ir_conn_drain_timeout != 0) { (void) atomic_swap_64( (uint64_t *)&tmp_server->iser_die_time, - lbolt64 + SEC_TO_TICK( + ddi_get_lbolt64() + SEC_TO_TICK( rule->ir_conn_drain_timeout)); } } @@ -1499,7 +1500,8 @@ ilb_server_del(ilb_stack_t *ilbs, zoneid_t zoneid, const char *rule_name, /* If there is a hard limit on when a server should die, set it. */ if (rule->ir_conn_drain_timeout != 0) { (void) atomic_swap_64((uint64_t *)&server->iser_die_time, - lbolt64 + SEC_TO_TICK(rule->ir_conn_drain_timeout)); + ddi_get_lbolt64() + + SEC_TO_TICK(rule->ir_conn_drain_timeout)); } if (server->iser_refcnt > 1) { diff --git a/usr/src/uts/common/inet/ilb/ilb_conn.c b/usr/src/uts/common/inet/ilb/ilb_conn.c index 6a7a75a150..450adab5f4 100644 --- a/usr/src/uts/common/inet/ilb/ilb_conn.c +++ b/usr/src/uts/common/inet/ilb/ilb_conn.c @@ -101,7 +101,7 @@ static int ilb_sticky_timeout = 15; { \ mutex_enter(&(s)->hash->sticky_lock); \ (s)->refcnt--; \ - (s)->atime = lbolt64; \ + (s)->atime = ddi_get_lbolt64(); \ mutex_exit(&s->hash->sticky_lock); \ } @@ -211,7 +211,7 @@ ilb_conn_cleanup(void *arg) c2s_hash = ilbs->ilbs_c2s_conn_hash; ASSERT(c2s_hash != NULL); - now = lbolt64; + now = ddi_get_lbolt64(); for (i = timer->start; i < timer->end; i++) { mutex_enter(&c2s_hash[i].ilb_conn_hash_lock); if ((connp = c2s_hash[i].ilb_connp) == NULL) { @@ -531,7 +531,7 @@ ilb_conn_add(ilb_stack_t *ilbs, ilb_rule_t *rule, ilb_server_t *server, connp->conn_gc = B_FALSE; connp->conn_expiry = rule->ir_nat_expiry; - connp->conn_cr_time = lbolt64; + connp->conn_cr_time = ddi_get_lbolt64(); /* Client to server info. */ connp->conn_c2s_saddr = *src; @@ -539,7 +539,7 @@ ilb_conn_add(ilb_stack_t *ilbs, ilb_rule_t *rule, ilb_server_t *server, connp->conn_c2s_daddr = *dst; connp->conn_c2s_dport = dport; - connp->conn_c2s_atime = lbolt64; + connp->conn_c2s_atime = ddi_get_lbolt64(); /* The packet ths triggers this creation should be counted */ connp->conn_c2s_pkt_cnt = 1; connp->conn_c2s_tcp_fin_sent = B_FALSE; @@ -641,7 +641,7 @@ ilb_conn_add(ilb_stack_t *ilbs, ilb_rule_t *rule, ilb_server_t *server, break; } - connp->conn_s2c_atime = lbolt64; + connp->conn_s2c_atime = ddi_get_lbolt64(); connp->conn_s2c_pkt_cnt = 1; connp->conn_s2c_tcp_fin_sent = B_FALSE; connp->conn_s2c_tcp_fin_acked = B_FALSE; @@ -766,7 +766,7 @@ ilb_find_conn(ilb_stack_t *ilbs, void *iph, void *tph, int l4, in6_addr_t *src, connp->conn_c2s_sport == sport && IN6_ARE_ADDR_EQUAL(src, &connp->conn_c2s_saddr) && IN6_ARE_ADDR_EQUAL(dst, &connp->conn_c2s_daddr)) { - connp->conn_c2s_atime = lbolt64; + connp->conn_c2s_atime = ddi_get_lbolt64(); connp->conn_c2s_pkt_cnt++; *rule_cache = connp->conn_rule_cache; *ip_sum = connp->conn_c2s_ip_sum; @@ -785,7 +785,7 @@ ilb_find_conn(ilb_stack_t *ilbs, void *iph, void *tph, int l4, in6_addr_t *src, connp->conn_s2c_sport == sport && IN6_ARE_ADDR_EQUAL(src, &connp->conn_s2c_saddr) && IN6_ARE_ADDR_EQUAL(dst, &connp->conn_s2c_daddr)) { - connp->conn_s2c_atime = lbolt64; + connp->conn_s2c_atime = ddi_get_lbolt64(); connp->conn_s2c_pkt_cnt++; *rule_cache = connp->conn_rule_cache; *ip_sum = connp->conn_s2c_ip_sum; @@ -966,7 +966,7 @@ ilb_check_icmp_conn(ilb_stack_t *ilbs, mblk_t *mp, int l3, void *out_iph, connp->conn_c2s_sport == *dport && IN6_ARE_ADDR_EQUAL(in_dst_p, &connp->conn_c2s_saddr) && IN6_ARE_ADDR_EQUAL(in_src_p, &connp->conn_c2s_daddr)) { - connp->conn_c2s_atime = lbolt64; + connp->conn_c2s_atime = ddi_get_lbolt64(); connp->conn_c2s_pkt_cnt++; rule_cache = connp->conn_rule_cache; adj_ip_sum = connp->conn_c2s_ip_sum; @@ -1208,7 +1208,7 @@ ilb_sticky_add(ilb_sticky_hash_t *hash, ilb_rule_t *rule, ilb_server_t *server, * zero. But just set it here for debugging purpose. The * atime is set when a refrele is done on a sticky entry. */ - s->atime = lbolt64; + s->atime = ddi_get_lbolt64(); list_insert_head(&hash->sticky_head, s); hash->sticky_cnt++; @@ -1314,7 +1314,7 @@ ilb_sticky_cleanup(void *arg) hash = ilbs->ilbs_sticky_hash; ASSERT(hash != NULL); - now = lbolt64; + now = ddi_get_lbolt64(); for (i = timer->start; i < timer->end; i++) { mutex_enter(&hash[i].sticky_lock); for (s = list_head(&hash[i].sticky_head); s != NULL; diff --git a/usr/src/uts/common/inet/ip/conn_opt.c b/usr/src/uts/common/inet/ip/conn_opt.c index a46d7c4cd0..8820f6d2ab 100644 --- a/usr/src/uts/common/inet/ip/conn_opt.c +++ b/usr/src/uts/common/inet/ip/conn_opt.c @@ -2881,7 +2881,7 @@ conn_inherit_parent(conn_t *lconnp, conn_t *econnp) econnp->conn_cred = credp = lconnp->conn_cred; crhold(credp); econnp->conn_cpid = lconnp->conn_cpid; - econnp->conn_open_time = lbolt64; + econnp->conn_open_time = ddi_get_lbolt64(); /* * Cache things in the ixa without any refhold. diff --git a/usr/src/uts/common/inet/ip/icmp.c b/usr/src/uts/common/inet/ip/icmp.c index 8222c866d0..a070f1de35 100644 --- a/usr/src/uts/common/inet/ip/icmp.c +++ b/usr/src/uts/common/inet/ip/icmp.c @@ -1714,7 +1714,7 @@ rawip_do_open(int family, cred_t *credp, int *err, int flags) crhold(credp); connp->conn_cred = credp; connp->conn_cpid = curproc->p_pid; - connp->conn_open_time = lbolt64; + connp->conn_open_time = ddi_get_lbolt64(); /* Cache things in ixa without an extra refhold */ connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c index b59087e9b1..240d054d73 100644 --- a/usr/src/uts/common/inet/ip/ip.c +++ b/usr/src/uts/common/inet/ip/ip.c @@ -2130,7 +2130,7 @@ icmp_inbound_too_big_v4(icmph_t *icmph, ip_recv_attr_t *ira) /* We now have a PMTU for sure */ dce->dce_flags |= DCEF_PMTU; - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); mutex_exit(&dce->dce_lock); /* * After dropping the lock the new value is visible to everyone. @@ -3083,7 +3083,7 @@ icmp_pkt(mblk_t *mp, void *stuff, size_t len, ip_recv_attr_t *ira) boolean_t icmp_err_rate_limit(ip_stack_t *ipst) { - clock_t now = TICK_TO_MSEC(lbolt); + clock_t now = TICK_TO_MSEC(ddi_get_lbolt()); uint_t refilled; /* Number of packets refilled in tbf since last */ /* Guard against changes by loading into local variable */ uint_t err_interval = ipst->ips_ip_icmp_err_interval; @@ -3893,14 +3893,14 @@ ip_get_pmtu(ip_xmit_attr_t *ixa) /* Check if the PMTU is to old before we use it */ if ((dce->dce_flags & DCEF_PMTU) && - TICK_TO_SEC(lbolt64) - dce->dce_last_change_time > + TICK_TO_SEC(ddi_get_lbolt64()) - dce->dce_last_change_time > ipst->ips_ip_pathmtu_interval) { /* * Older than 20 minutes. Drop the path MTU information. */ mutex_enter(&dce->dce_lock); dce->dce_flags &= ~(DCEF_PMTU|DCEF_TOO_SMALL_PMTU); - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); mutex_exit(&dce->dce_lock); dce_increment_generation(dce); } @@ -14773,7 +14773,7 @@ sendit: * It should be o.k. to check the state without * a lock here, at most we lose an advice. */ - ncec->ncec_last = TICK_TO_MSEC(lbolt64); + ncec->ncec_last = TICK_TO_MSEC(ddi_get_lbolt64()); if (ncec->ncec_state != ND_REACHABLE) { mutex_enter(&ncec->ncec_lock); ncec->ncec_state = ND_REACHABLE; @@ -14792,7 +14792,7 @@ sendit: return (0); } - delta = TICK_TO_MSEC(lbolt64) - ncec->ncec_last; + delta = TICK_TO_MSEC(ddi_get_lbolt64()) - ncec->ncec_last; ip1dbg(("ip_xmit: delta = %" PRId64 " ill_reachable_time = %d \n", delta, ill->ill_reachable_time)); diff --git a/usr/src/uts/common/inet/ip/ip2mac.c b/usr/src/uts/common/inet/ip/ip2mac.c index 55a17f762a..7ee7504d28 100644 --- a/usr/src/uts/common/inet/ip/ip2mac.c +++ b/usr/src/uts/common/inet/ip/ip2mac.c @@ -238,7 +238,7 @@ ip2mac(uint_t op, ip2mac_t *ip2m, ip2mac_callback_t *cb, void *cbarg, goto done; } ncec = nce->nce_common; - delta = TICK_TO_MSEC(lbolt64) - ncec->ncec_last; + delta = TICK_TO_MSEC(ddi_get_lbolt64()) - ncec->ncec_last; mutex_enter(&ncec->ncec_lock); if (NCE_ISREACHABLE(ncec) && delta < (uint64_t)ill->ill_reachable_time) { @@ -256,7 +256,7 @@ ip2mac(uint_t op, ip2mac_t *ip2m, ip2mac_callback_t *cb, void *cbarg, } } ncec = nce->nce_common; - delta = TICK_TO_MSEC(lbolt64) - ncec->ncec_last; + delta = TICK_TO_MSEC(ddi_get_lbolt64()) - ncec->ncec_last; mutex_enter(&ncec->ncec_lock); if (NCE_ISCONDEMNED(ncec)) { ip2m->ip2mac_err = ESRCH; diff --git a/usr/src/uts/common/inet/ip/ip6.c b/usr/src/uts/common/inet/ip/ip6.c index ed54c08884..2794716bcd 100644 --- a/usr/src/uts/common/inet/ip/ip6.c +++ b/usr/src/uts/common/inet/ip/ip6.c @@ -739,7 +739,7 @@ icmp_inbound_too_big_v6(icmp6_t *icmp6, ip_recv_attr_t *ira) } /* We now have a PMTU for sure */ dce->dce_flags |= DCEF_PMTU; - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); mutex_exit(&dce->dce_lock); /* * After dropping the lock the new value is visible to everyone. diff --git a/usr/src/uts/common/inet/ip/ip6_input.c b/usr/src/uts/common/inet/ip/ip6_input.c index cee5344bf6..bda97c602b 100644 --- a/usr/src/uts/common/inet/ip/ip6_input.c +++ b/usr/src/uts/common/inet/ip/ip6_input.c @@ -1437,7 +1437,7 @@ ire_recv_local_v6(ire_t *ire, mblk_t *mp, void *iph_arg, ip_recv_attr_t *ira) ill_t *ire_ill = ire->ire_ill; /* Make a note for DAD that this address is in use */ - ire->ire_last_used_time = lbolt; + ire->ire_last_used_time = ddi_get_lbolt(); /* Only target the IRE_LOCAL with the right zoneid. */ ira->ira_zoneid = ire->ire_zoneid; diff --git a/usr/src/uts/common/inet/ip/ip6_output.c b/usr/src/uts/common/inet/ip/ip6_output.c index 3e06050781..31b7a54868 100644 --- a/usr/src/uts/common/inet/ip/ip6_output.c +++ b/usr/src/uts/common/inet/ip/ip6_output.c @@ -118,6 +118,7 @@ ip_output_simple_v6(mblk_t *mp, ip_xmit_attr_t *ixa) boolean_t repeat = B_FALSE; boolean_t multirt = B_FALSE; uint_t ifindex; + int64_t now; ip6h = (ip6_t *)mp->b_rptr; ASSERT(IPH_HDR_VERSION(ip6h) == IPV6_VERSION); @@ -237,14 +238,15 @@ repeat_ire: * To avoid a periodic timer to increase the path MTU we * look at dce_last_change_time each time we send a packet. */ - if (TICK_TO_SEC(lbolt64) - dce->dce_last_change_time > + now = ddi_get_lbolt64(); + if (TICK_TO_SEC(now) - dce->dce_last_change_time > ipst->ips_ip_pathmtu_interval) { /* * Older than 20 minutes. Drop the path MTU information. */ mutex_enter(&dce->dce_lock); dce->dce_flags &= ~(DCEF_PMTU|DCEF_TOO_SMALL_PMTU); - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(now); mutex_exit(&dce->dce_lock); dce_increment_generation(dce); ixa->ixa_fragsize = ip_get_base_mtu(nce->nce_ill, ire); diff --git a/usr/src/uts/common/inet/ip/ip_dce.c b/usr/src/uts/common/inet/ip/ip_dce.c index 839c5ae0d0..b7d7e38022 100644 --- a/usr/src/uts/common/inet/ip/ip_dce.c +++ b/usr/src/uts/common/inet/ip/ip_dce.c @@ -125,7 +125,7 @@ dcb_reclaim(dcb_t *dcb, ip_stack_t *ipst, uint_t fraction) /* Clear DCEF_PMTU if the pmtu is too old */ mutex_enter(&dce->dce_lock); if ((dce->dce_flags & DCEF_PMTU) && - TICK_TO_SEC(lbolt64) - dce->dce_last_change_time > + TICK_TO_SEC(ddi_get_lbolt64()) - dce->dce_last_change_time > ipst->ips_ip_pathmtu_interval) { dce->dce_flags &= ~DCEF_PMTU; mutex_exit(&dce->dce_lock); @@ -220,7 +220,8 @@ dce_stack_init(ip_stack_t *ipst) bzero(ipst->ips_dce_default, sizeof (dce_t)); ipst->ips_dce_default->dce_flags = DCEF_DEFAULT; ipst->ips_dce_default->dce_generation = DCE_GENERATION_INITIAL; - ipst->ips_dce_default->dce_last_change_time = TICK_TO_SEC(lbolt64); + ipst->ips_dce_default->dce_last_change_time = + TICK_TO_SEC(ddi_get_lbolt64()); ipst->ips_dce_default->dce_refcnt = 1; /* Should never go away */ ipst->ips_dce_default->dce_ipst = ipst; @@ -428,7 +429,7 @@ dce_lookup_and_add_v4(ipaddr_t dst, ip_stack_t *ipst) dce->dce_v4addr = dst; dce->dce_generation = DCE_GENERATION_INITIAL; dce->dce_ipversion = IPV4_VERSION; - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); dce_refhold(dce); /* For the hash list */ /* Link into list */ @@ -493,7 +494,7 @@ dce_lookup_and_add_v6(const in6_addr_t *dst, uint_t ifindex, ip_stack_t *ipst) dce->dce_ifindex = ifindex; dce->dce_generation = DCE_GENERATION_INITIAL; dce->dce_ipversion = IPV6_VERSION; - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); dce_refhold(dce); /* For the hash list */ /* Link into list */ @@ -560,7 +561,7 @@ dce_setuinfo(dce_t *dce, iulp_t *uinfo) dce->dce_pmtu = MIN(uinfo->iulp_mtu, IP_MAXPACKET); dce->dce_flags |= DCEF_PMTU; } - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(ddi_get_lbolt64()); } if (uinfo->iulp_ssthresh != 0) { if (dce->dce_uinfo.iulp_ssthresh != 0) @@ -756,7 +757,7 @@ ip_snmp_get_mib2_ip_dce(queue_t *q, mblk_t *mpctl, ip_stack_t *ipst) int i; uint64_t current_time; - current_time = TICK_TO_SEC(lbolt64); + current_time = TICK_TO_SEC(ddi_get_lbolt64()); /* * make a copy of the original message diff --git a/usr/src/uts/common/inet/ip/ip_ftable.c b/usr/src/uts/common/inet/ip/ip_ftable.c index 771dd9f62f..7dd350a42a 100644 --- a/usr/src/uts/common/inet/ip/ip_ftable.c +++ b/usr/src/uts/common/inet/ip/ip_ftable.c @@ -892,7 +892,7 @@ ire_round_robin(irb_t *irb_ptr, ire_ftable_args_t *margs, uint_t hash, mutex_enter(&ire->ire_lock); /* Look for stale ire_badcnt and clear */ if (ire->ire_badcnt != 0 && - (TICK_TO_SEC(lbolt64) - ire->ire_last_badcnt > + (TICK_TO_SEC(ddi_get_lbolt64()) - ire->ire_last_badcnt > ipst->ips_ip_ire_badcnt_lifetime)) ire->ire_badcnt = 0; mutex_exit(&ire->ire_lock); diff --git a/usr/src/uts/common/inet/ip/ip_if.c b/usr/src/uts/common/inet/ip/ip_if.c index 6066da35b4..cd5a98b7b5 100644 --- a/usr/src/uts/common/inet/ip/ip_if.c +++ b/usr/src/uts/common/inet/ip/ip_if.c @@ -2426,6 +2426,7 @@ ill_frag_prune(ill_t *ill, uint_t max_count) ipfb_t *ipfb; ipf_t *ipf; size_t count; + clock_t now; /* * If we are here within ip_min_frag_prune_time msecs remove @@ -2433,7 +2434,8 @@ ill_frag_prune(ill_t *ill, uint_t max_count) * ill_frag_free_num_pkts. */ mutex_enter(&ill->ill_lock); - if (TICK_TO_MSEC(lbolt - ill->ill_last_frag_clean_time) <= + now = ddi_get_lbolt(); + if (TICK_TO_MSEC(now - ill->ill_last_frag_clean_time) <= (ip_min_frag_prune_time != 0 ? ip_min_frag_prune_time : msec_per_tick)) { @@ -2442,7 +2444,7 @@ ill_frag_prune(ill_t *ill, uint_t max_count) } else { ill->ill_frag_free_num_pkts = 0; } - ill->ill_last_frag_clean_time = lbolt; + ill->ill_last_frag_clean_time = now; mutex_exit(&ill->ill_lock); /* @@ -4994,7 +4996,7 @@ th_trace_rrecord(th_trace_t *th_trace) lastref = 0; th_trace->th_trace_lastref = lastref; tr_buf = &th_trace->th_trbuf[lastref]; - tr_buf->tr_time = lbolt; + tr_buf->tr_time = ddi_get_lbolt(); tr_buf->tr_depth = getpcstack(tr_buf->tr_stack, TR_STACK_DEPTH); } @@ -6528,8 +6530,8 @@ ipsq_enter(ill_t *ill, boolean_t force, int type) } else { mutex_exit(&ipx->ipx_lock); mutex_exit(&ipsq->ipsq_lock); - (void) cv_timedwait(&ill->ill_cv, - &ill->ill_lock, lbolt + ENTER_SQ_WAIT_TICKS); + (void) cv_reltimedwait(&ill->ill_cv, + &ill->ill_lock, ENTER_SQ_WAIT_TICKS, TR_CLOCK_TICK); waited_enough = B_TRUE; } mutex_exit(&ill->ill_lock); diff --git a/usr/src/uts/common/inet/ip/ip_input.c b/usr/src/uts/common/inet/ip/ip_input.c index d47670f85d..e9850f220c 100644 --- a/usr/src/uts/common/inet/ip/ip_input.c +++ b/usr/src/uts/common/inet/ip/ip_input.c @@ -1679,7 +1679,7 @@ ire_recv_local_v4(ire_t *ire, mblk_t *mp, void *iph_arg, ip_recv_attr_t *ira) ill_t *ire_ill = ire->ire_ill; /* Make a note for DAD that this address is in use */ - ire->ire_last_used_time = lbolt; + ire->ire_last_used_time = ddi_get_lbolt(); /* Only target the IRE_LOCAL with the right zoneid. */ ira->ira_zoneid = ire->ire_zoneid; diff --git a/usr/src/uts/common/inet/ip/ip_ire.c b/usr/src/uts/common/inet/ip/ip_ire.c index be0017cb62..c204870e60 100644 --- a/usr/src/uts/common/inet/ip/ip_ire.c +++ b/usr/src/uts/common/inet/ip/ip_ire.c @@ -2140,7 +2140,7 @@ ire_delete_reclaim(ire_t *ire, char *arg) (ire->ire_type & IRE_IF_CLONE)) { /* Pick a random number */ - rand = (uint_t)lbolt + + rand = (uint_t)ddi_get_lbolt() + IRE_ADDR_HASH_V6(ire->ire_addr_v6, 256); /* Use truncation */ @@ -3092,7 +3092,7 @@ ire_no_good(ire_t *ire) */ mutex_enter(&ire->ire_lock); ire->ire_badcnt++; - ire->ire_last_badcnt = TICK_TO_SEC(lbolt64); + ire->ire_last_badcnt = TICK_TO_SEC(ddi_get_lbolt64()); nce = ire->ire_nce_cache; if (nce != NULL && nce->nce_is_condemned && nce->nce_common->ncec_state == ND_UNREACHABLE) diff --git a/usr/src/uts/common/inet/ip/ip_ndp.c b/usr/src/uts/common/inet/ip/ip_ndp.c index 97096bea99..76d84761f2 100644 --- a/usr/src/uts/common/inet/ip/ip_ndp.c +++ b/usr/src/uts/common/inet/ip/ip_ndp.c @@ -2677,7 +2677,7 @@ nce_update(ncec_t *ncec, uint16_t new_state, uchar_t *new_ll_addr) ASSERT((int16_t)new_state <= ND_STATE_VALID_MAX); need_stop_timer = B_TRUE; if (new_state == ND_REACHABLE) - ncec->ncec_last = TICK_TO_MSEC(lbolt64); + ncec->ncec_last = TICK_TO_MSEC(ddi_get_lbolt64()); else { /* We force NUD in this case */ ncec->ncec_last = 0; @@ -3392,7 +3392,7 @@ ncec_cache_reclaim(ncec_t *ncec, char *arg) return; } - rand = (uint_t)lbolt + + rand = (uint_t)ddi_get_lbolt() + NCE_ADDR_HASH_V6(ncec->ncec_addr, NCE_TABLE_SIZE); if ((rand/fraction)*fraction == rand) { IP_STAT(ipst, ip_nce_reclaim_deleted); @@ -4557,12 +4557,12 @@ nce_add_common(ill_t *ill, uchar_t *hw_addr, uint_t hw_addr_len, ncec->ncec_state = state; if (state == ND_REACHABLE) { - ncec->ncec_last = TICK_TO_MSEC(lbolt64); - ncec->ncec_init_time = TICK_TO_MSEC(lbolt64); + ncec->ncec_last = ncec->ncec_init_time = + TICK_TO_MSEC(ddi_get_lbolt64()); } else { ncec->ncec_last = 0; if (state == ND_INITIAL) - ncec->ncec_init_time = TICK_TO_MSEC(lbolt64); + ncec->ncec_init_time = TICK_TO_MSEC(ddi_get_lbolt64()); } list_create(&ncec->ncec_cb, sizeof (ncec_cb_t), offsetof(ncec_cb_t, ncec_cb_node)); diff --git a/usr/src/uts/common/inet/ip/ip_output.c b/usr/src/uts/common/inet/ip/ip_output.c index a4940fd3e8..5196fdfe3a 100644 --- a/usr/src/uts/common/inet/ip/ip_output.c +++ b/usr/src/uts/common/inet/ip/ip_output.c @@ -140,6 +140,7 @@ conn_ip_output(mblk_t *mp, ip_xmit_attr_t *ixa) ill_t *ill; ip_stack_t *ipst = ixa->ixa_ipst; int error; + int64_t now; /* We defer ipIfStatsHCOutRequests until an error or we have an ill */ @@ -285,8 +286,9 @@ conn_ip_output(mblk_t *mp, ip_xmit_attr_t *ixa) * To avoid a periodic timer to increase the path MTU we * look at dce_last_change_time each time we send a packet. */ + now = ddi_get_lbolt64(); if ((dce->dce_flags & DCEF_PMTU) && - (TICK_TO_SEC(lbolt64) - dce->dce_last_change_time > + (TICK_TO_SEC(now) - dce->dce_last_change_time > ipst->ips_ip_pathmtu_interval)) { /* * Older than 20 minutes. Drop the path MTU information. @@ -296,7 +298,7 @@ conn_ip_output(mblk_t *mp, ip_xmit_attr_t *ixa) */ mutex_enter(&dce->dce_lock); dce->dce_flags &= ~(DCEF_PMTU|DCEF_TOO_SMALL_PMTU); - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(now); mutex_exit(&dce->dce_lock); dce_increment_generation(dce); } @@ -810,6 +812,7 @@ ip_output_simple_v4(mblk_t *mp, ip_xmit_attr_t *ixa) ip_stack_t *ipst = ixa->ixa_ipst; boolean_t repeat = B_FALSE; boolean_t multirt = B_FALSE; + int64_t now; ipha = (ipha_t *)mp->b_rptr; ASSERT(IPH_HDR_VERSION(ipha) == IPV4_VERSION); @@ -928,14 +931,15 @@ repeat_ire: * To avoid a periodic timer to increase the path MTU we * look at dce_last_change_time each time we send a packet. */ - if (TICK_TO_SEC(lbolt64) - dce->dce_last_change_time > + now = ddi_get_lbolt64(); + if (TICK_TO_SEC(now) - dce->dce_last_change_time > ipst->ips_ip_pathmtu_interval) { /* * Older than 20 minutes. Drop the path MTU information. */ mutex_enter(&dce->dce_lock); dce->dce_flags &= ~(DCEF_PMTU|DCEF_TOO_SMALL_PMTU); - dce->dce_last_change_time = TICK_TO_SEC(lbolt64); + dce->dce_last_change_time = TICK_TO_SEC(now); mutex_exit(&dce->dce_lock); dce_increment_generation(dce); ixa->ixa_fragsize = ip_get_base_mtu(nce->nce_ill, ire); diff --git a/usr/src/uts/common/inet/ip/ip_squeue.c b/usr/src/uts/common/inet/ip/ip_squeue.c index 0955bfd3f2..33a2fa5935 100644 --- a/usr/src/uts/common/inet/ip/ip_squeue.c +++ b/usr/src/uts/common/inet/ip/ip_squeue.c @@ -686,7 +686,7 @@ ip_squeue_get(ill_rx_ring_t *ill_rx_ring) squeue_t *sqp; if ((ill_rx_ring == NULL) || ((sqp = ill_rx_ring->rr_sqp) == NULL)) - return (IP_SQUEUE_GET(lbolt)); + return (IP_SQUEUE_GET(CPU_PSEUDO_RANDOM())); return (sqp); } diff --git a/usr/src/uts/common/inet/kssl/ksslrec.c b/usr/src/uts/common/inet/kssl/ksslrec.c index 6b7ce0ad42..109fc51b7f 100644 --- a/usr/src/uts/common/inet/kssl/ksslrec.c +++ b/usr/src/uts/common/inet/kssl/ksslrec.c @@ -678,7 +678,7 @@ kssl_cache_sid(sslSessionID *sid, kssl_entry_t *kssl_entry) /* set the values before creating the cache entry */ sid->cached = B_TRUE; - sid->time = lbolt; + sid->time = ddi_get_lbolt(); SET_HASH_INDEX(index, s, &sid->client_addr); index %= kssl_entry->sid_cache_nentries; @@ -747,7 +747,8 @@ kssl_lookup_sid(sslSessionID *sid, uchar_t *s, in6_addr_t *faddr, return; } - if (TICK_TO_SEC(lbolt - csid->time) > kssl_entry->sid_cache_timeout) { + if (TICK_TO_SEC(ddi_get_lbolt() - csid->time) > + kssl_entry->sid_cache_timeout) { csid->cached = B_FALSE; mutex_exit(lock); return; diff --git a/usr/src/uts/common/inet/nca/nca.h b/usr/src/uts/common/inet/nca/nca.h index 1670c49d5d..1dea4fa392 100644 --- a/usr/src/uts/common/inet/nca/nca.h +++ b/usr/src/uts/common/inet/nca/nca.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -326,7 +326,7 @@ typedef struct tw_s { } \ if ((_lbolt) != NCA_TW_NONE) { \ (twp)->tid = timeout((pfv_t)nca_tw_fire, (twp), \ - (twp)->lbolt3 - lbolt); \ + (twp)->lbolt3 - ddi_get_lbolt()); \ } \ } \ } diff --git a/usr/src/uts/common/inet/sctp/sctp.c b/usr/src/uts/common/inet/sctp/sctp.c index d444e1f10e..6f1a83b34a 100644 --- a/usr/src/uts/common/inet/sctp/sctp.c +++ b/usr/src/uts/common/inet/sctp/sctp.c @@ -363,7 +363,8 @@ sctp_disconnect(sctp_t *sctp) sctp->sctp_lingering = 1; sctp->sctp_client_errno = 0; - stoptime = lbolt + connp->conn_lingertime * hz; + stoptime = ddi_get_lbolt() + + connp->conn_lingertime * hz; mutex_enter(&sctp->sctp_lock); sctp->sctp_running = B_FALSE; @@ -847,7 +848,7 @@ sctp_init_values(sctp_t *sctp, sctp_t *psctp, int sleep) sctp->sctp_strikes = 0; - sctp->sctp_last_mtu_probe = lbolt64; + sctp->sctp_last_mtu_probe = ddi_get_lbolt64(); sctp->sctp_mtu_probe_intvl = sctps->sctps_mtu_probe_interval; sctp->sctp_sack_gaps = 0; @@ -1485,7 +1486,7 @@ sctp_create(void *ulpd, sctp_t *parent, int family, int type, int flags, * no IPCL_ZONEID */ connp->conn_ixa->ixa_zoneid = zoneid; - connp->conn_open_time = lbolt64; + connp->conn_open_time = ddi_get_lbolt64(); connp->conn_cred = credp; crhold(credp); connp->conn_cpid = curproc->p_pid; diff --git a/usr/src/uts/common/inet/sctp/sctp_bind.c b/usr/src/uts/common/inet/sctp/sctp_bind.c index 9e0b0e7418..b80995628d 100644 --- a/usr/src/uts/common/inet/sctp/sctp_bind.c +++ b/usr/src/uts/common/inet/sctp/sctp_bind.c @@ -157,7 +157,7 @@ sctp_listen(sctp_t *sctp) sctp->sctp_state = SCTPS_LISTEN; (void) random_get_pseudo_bytes(sctp->sctp_secret, SCTP_SECRET_LEN); - sctp->sctp_last_secret_update = lbolt64; + sctp->sctp_last_secret_update = ddi_get_lbolt64(); bzero(sctp->sctp_old_secret, SCTP_SECRET_LEN); tf = &sctps->sctps_listen_fanout[SCTP_LISTEN_HASH( ntohs(connp->conn_lport))]; diff --git a/usr/src/uts/common/inet/sctp/sctp_common.c b/usr/src/uts/common/inet/sctp/sctp_common.c index b518eb3981..6400c2cc0f 100644 --- a/usr/src/uts/common/inet/sctp/sctp_common.c +++ b/usr/src/uts/common/inet/sctp/sctp_common.c @@ -619,7 +619,7 @@ sctp_redo_faddr_srcs(sctp_t *sctp) void sctp_faddr_alive(sctp_t *sctp, sctp_faddr_t *fp) { - int64_t now = lbolt64; + int64_t now = ddi_get_lbolt64(); fp->strikes = 0; sctp->sctp_strikes = 0; @@ -1779,7 +1779,7 @@ sctp_init_faddr(sctp_t *sctp, sctp_faddr_t *fp, in6_addr_t *addr, fp->suna = 0; fp->pba = 0; fp->acked = 0; - fp->lastactive = lbolt64; + fp->lastactive = fp->hb_expiry = ddi_get_lbolt64(); fp->timer_mp = timer_mp; fp->hb_pending = B_FALSE; fp->hb_enabled = B_TRUE; @@ -1789,7 +1789,6 @@ sctp_init_faddr(sctp_t *sctp, sctp_faddr_t *fp, in6_addr_t *addr, fp->T3expire = 0; (void) random_get_pseudo_bytes((uint8_t *)&fp->hb_secret, sizeof (fp->hb_secret)); - fp->hb_expiry = lbolt64; fp->rxt_unacked = 0; sctp_get_dest(sctp, fp); diff --git a/usr/src/uts/common/inet/sctp/sctp_conn.c b/usr/src/uts/common/inet/sctp/sctp_conn.c index 7dc048f919..6cf4d9af3e 100644 --- a/usr/src/uts/common/inet/sctp/sctp_conn.c +++ b/usr/src/uts/common/inet/sctp/sctp_conn.c @@ -115,7 +115,7 @@ sctp_accept_comm(sctp_t *listener, sctp_t *acceptor, mblk_t *cr_pkt, bcopy(listener->sctp_secret, acceptor->sctp_secret, SCTP_SECRET_LEN); bcopy(listener->sctp_old_secret, acceptor->sctp_old_secret, SCTP_SECRET_LEN); - acceptor->sctp_last_secret_update = lbolt64; + acceptor->sctp_last_secret_update = ddi_get_lbolt64(); /* * After acceptor is inserted in the hash list, it can be found. @@ -136,7 +136,7 @@ sctp_accept_comm(sctp_t *listener, sctp_t *acceptor, mblk_t *cr_pkt, */ /* XXXSCTP */ acceptor->sctp_state = SCTPS_ESTABLISHED; - acceptor->sctp_assoc_start_time = (uint32_t)lbolt; + acceptor->sctp_assoc_start_time = (uint32_t)ddi_get_lbolt(); /* * listener->sctp_rwnd should be the default window size or a * window size changed via SO_RCVBUF option. diff --git a/usr/src/uts/common/inet/sctp/sctp_cookie.c b/usr/src/uts/common/inet/sctp/sctp_cookie.c index 4baf0a7147..a72df4c68e 100644 --- a/usr/src/uts/common/inet/sctp/sctp_cookie.c +++ b/usr/src/uts/common/inet/sctp/sctp_cookie.c @@ -736,7 +736,7 @@ sctp_send_initack(sctp_t *sctp, sctp_hdr_t *initsh, sctp_chunk_hdr_t *ch, /* timestamp */ now = (int64_t *)(cookieph + 1); - nowt = lbolt64; + nowt = ddi_get_lbolt64(); bcopy(&nowt, now, sizeof (*now)); /* cookie lifetime -- need configuration */ @@ -1279,7 +1279,7 @@ sctp_process_cookie(sctp_t *sctp, sctp_chunk_hdr_t *ch, mblk_t *cmp, * So it is lbolt64 - (ts + *lt). If it is positive, it means * that the Cookie has expired. */ - diff = lbolt64 - (ts + *lt); + diff = ddi_get_lbolt64() - (ts + *lt); if (diff > 0 && (init->sic_inittag != sctp->sctp_fvtag || iack->sic_inittag != sctp->sctp_lvtag)) { uint32_t staleness; @@ -1343,7 +1343,8 @@ sctp_process_cookie(sctp_t *sctp, sctp_chunk_hdr_t *ch, mblk_t *cmp, if (sctp->sctp_state < SCTPS_ESTABLISHED) { sctp->sctp_state = SCTPS_ESTABLISHED; - sctp->sctp_assoc_start_time = (uint32_t)lbolt; + sctp->sctp_assoc_start_time = + (uint32_t)ddi_get_lbolt(); } dprint(1, ("sctp peer %x:%x:%x:%x (%d) restarted\n", @@ -1371,7 +1372,8 @@ sctp_process_cookie(sctp_t *sctp, sctp_chunk_hdr_t *ch, mblk_t *cmp, if (!sctp_initialize_params(sctp, init, iack)) return (-1); /* Drop? */ sctp->sctp_state = SCTPS_ESTABLISHED; - sctp->sctp_assoc_start_time = (uint32_t)lbolt; + sctp->sctp_assoc_start_time = + (uint32_t)ddi_get_lbolt(); } dprint(1, ("init collision with %x:%x:%x:%x (%d)\n", @@ -1402,7 +1404,8 @@ sctp_process_cookie(sctp_t *sctp, sctp_chunk_hdr_t *ch, mblk_t *cmp, if (!sctp_initialize_params(sctp, init, iack)) return (-1); /* Drop? */ sctp->sctp_state = SCTPS_ESTABLISHED; - sctp->sctp_assoc_start_time = (uint32_t)lbolt; + sctp->sctp_assoc_start_time = + (uint32_t)ddi_get_lbolt(); } return (0); } else { diff --git a/usr/src/uts/common/inet/sctp/sctp_heartbeat.c b/usr/src/uts/common/inet/sctp/sctp_heartbeat.c index 2fbffee1c3..6069739f3c 100644 --- a/usr/src/uts/common/inet/sctp/sctp_heartbeat.c +++ b/usr/src/uts/common/inet/sctp/sctp_heartbeat.c @@ -158,7 +158,7 @@ sctp_send_heartbeat(sctp_t *sctp, sctp_faddr_t *fp) * Copy the current time to the heartbeat and we can use it to * calculate the RTT when we get it back in the heartbeat ACK. */ - now = lbolt64; + now = ddi_get_lbolt64(); t = (int64_t *)(hpp + 1); bcopy(&now, t, sizeof (now)); @@ -209,7 +209,7 @@ sctp_validate_peer(sctp_t *sctp) int64_t earliest_expiry; sctp_stack_t *sctps = sctp->sctp_sctps; - now = lbolt64; + now = ddi_get_lbolt64(); earliest_expiry = 0; cnt = sctps->sctps_maxburst; @@ -329,7 +329,7 @@ sctp_process_heartbeat(sctp_t *sctp, sctp_chunk_hdr_t *cp) /* This address is now confirmed and alive. */ sctp_faddr_alive(sctp, fp); - now = lbolt64; + now = ddi_get_lbolt64(); sctp_update_rtt(sctp, fp, now - sent); /* diff --git a/usr/src/uts/common/inet/sctp/sctp_impl.h b/usr/src/uts/common/inet/sctp/sctp_impl.h index d84c3762f3..509cb76fce 100644 --- a/usr/src/uts/common/inet/sctp/sctp_impl.h +++ b/usr/src/uts/common/inet/sctp/sctp_impl.h @@ -340,7 +340,7 @@ typedef struct { #define SCTP_MSG_TO_BE_ABANDONED(meta, mhdr, sctp) \ (((!SCTP_CHUNK_ISSENT((meta)->b_cont) && (mhdr)->smh_ttl > 0) || \ ((sctp)->sctp_prsctp_aware && ((mhdr)->smh_flags & MSG_PR_SCTP))) && \ - ((lbolt64 - (mhdr)->smh_tob) > (mhdr)->smh_ttl)) + ((ddi_get_lbolt64() - (mhdr)->smh_tob) > (mhdr)->smh_ttl)) /* SCTP association hash function. */ #define SCTP_CONN_HASH(sctps, ports) \ diff --git a/usr/src/uts/common/inet/sctp/sctp_input.c b/usr/src/uts/common/inet/sctp/sctp_input.c index e4a5ef5c5b..7ff11a588d 100644 --- a/usr/src/uts/common/inet/sctp/sctp_input.c +++ b/usr/src/uts/common/inet/sctp/sctp_input.c @@ -1776,7 +1776,7 @@ sctp_sack(sctp_t *sctp, mblk_t *dups) (void *)sctp->sctp_lastdata, SCTP_PRINTADDR(sctp->sctp_lastdata->faddr))); - sctp->sctp_active = lbolt64; + sctp->sctp_active = ddi_get_lbolt64(); BUMP_MIB(&sctps->sctps_mib, sctpOutAck); @@ -1918,7 +1918,8 @@ sctp_cumack(sctp_t *sctp, uint32_t tsn, mblk_t **first_unacked) xtsn == sctp->sctp_rtt_tsn) { /* Got a new RTT measurement */ sctp_update_rtt(sctp, fp, - lbolt64 - sctp->sctp_out_time); + ddi_get_lbolt64() - + sctp->sctp_out_time); sctp->sctp_out_time = 0; } if (SCTP_CHUNK_ISACKED(mp)) @@ -3583,7 +3584,7 @@ sctp_input_data(sctp_t *sctp, mblk_t *mp, ip_recv_attr_t *ira) gotdata = 0; trysend = 0; - now = lbolt64; + now = ddi_get_lbolt64(); /* Process the chunks */ do { dprint(3, ("sctp_dispatch_rput: state=%d, chunk id=%d\n", @@ -3918,7 +3919,8 @@ sctp_input_data(sctp_t *sctp, mblk_t *mp, ip_recv_attr_t *ira) } sctp->sctp_state = SCTPS_ESTABLISHED; - sctp->sctp_assoc_start_time = (uint32_t)lbolt; + sctp->sctp_assoc_start_time = + (uint32_t)ddi_get_lbolt(); BUMP_MIB(&sctps->sctps_mib, sctpActiveEstab); if (sctp->sctp_cookie_mp) { freemsg(sctp->sctp_cookie_mp); @@ -3959,7 +3961,8 @@ sctp_input_data(sctp_t *sctp, mblk_t *mp, ip_recv_attr_t *ira) if (sctp->sctp_unacked == 0) sctp_stop_faddr_timers(sctp); sctp->sctp_state = SCTPS_ESTABLISHED; - sctp->sctp_assoc_start_time = (uint32_t)lbolt; + sctp->sctp_assoc_start_time = + (uint32_t)ddi_get_lbolt(); BUMP_MIB(&sctps->sctps_mib, sctpActiveEstab); BUMP_LOCAL(sctp->sctp_ibchunks); if (sctp->sctp_cookie_mp) { @@ -4000,7 +4003,8 @@ sctp_input_data(sctp_t *sctp, mblk_t *mp, ip_recv_attr_t *ira) if (sctp->sctp_unacked == 0) sctp_stop_faddr_timers(sctp); sctp->sctp_state = SCTPS_ESTABLISHED; - sctp->sctp_assoc_start_time = (uint32_t)lbolt; + sctp->sctp_assoc_start_time = + (uint32_t)ddi_get_lbolt(); BUMP_MIB(&sctps->sctps_mib, sctpActiveEstab); if (sctp->sctp_cookie_mp) { freemsg(sctp->sctp_cookie_mp); diff --git a/usr/src/uts/common/inet/sctp/sctp_opt_data.c b/usr/src/uts/common/inet/sctp/sctp_opt_data.c index ee5eb445af..d114434723 100644 --- a/usr/src/uts/common/inet/sctp/sctp_opt_data.c +++ b/usr/src/uts/common/inet/sctp/sctp_opt_data.c @@ -478,7 +478,7 @@ sctp_set_peer_addr_params(sctp_t *sctp, const void *invalp) } } - now = lbolt64; + now = ddi_get_lbolt64(); if (fp != NULL) { if (spp->spp_hbinterval == UINT32_MAX) { /* diff --git a/usr/src/uts/common/inet/sctp/sctp_output.c b/usr/src/uts/common/inet/sctp/sctp_output.c index 1a50097260..f2b6084c26 100644 --- a/usr/src/uts/common/inet/sctp/sctp_output.c +++ b/usr/src/uts/common/inet/sctp/sctp_output.c @@ -257,7 +257,7 @@ sctp_sendmsg(sctp_t *sctp, mblk_t *mp, int flags) sctp_msg_hdr->smh_ppid = ppid; sctp_msg_hdr->smh_flags = msg_flags; sctp_msg_hdr->smh_ttl = MSEC_TO_TICK(timetolive); - sctp_msg_hdr->smh_tob = lbolt64; + sctp_msg_hdr->smh_tob = ddi_get_lbolt64(); for (; mp != NULL; mp = mp->b_cont) msg_len += MBLKL(mp); sctp_msg_hdr->smh_msglen = msg_len; @@ -979,7 +979,7 @@ sctp_fast_rexmit(sctp_t *sctp) sctp_set_iplen(sctp, head, fp->ixa); (void) conn_ip_output(head, fp->ixa); BUMP_LOCAL(sctp->sctp_opkts); - sctp->sctp_active = fp->lastactive = lbolt64; + sctp->sctp_active = fp->lastactive = ddi_get_lbolt64(); } void @@ -998,7 +998,7 @@ sctp_output(sctp_t *sctp, uint_t num_pkt) int32_t pad = 0; int32_t pathmax; int extra; - int64_t now = lbolt64; + int64_t now = ddi_get_lbolt64(); sctp_faddr_t *fp; sctp_faddr_t *lfp; sctp_data_hdr_t *sdc; @@ -2051,7 +2051,7 @@ restart_timer: */ SCTP_FADDR_TIMER_RESTART(sctp, fp, fp->rto); - sctp->sctp_active = lbolt64; + sctp->sctp_active = ddi_get_lbolt64(); } /* diff --git a/usr/src/uts/common/inet/sctp/sctp_shutdown.c b/usr/src/uts/common/inet/sctp/sctp_shutdown.c index ff835a60c0..017fed208a 100644 --- a/usr/src/uts/common/inet/sctp/sctp_shutdown.c +++ b/usr/src/uts/common/inet/sctp/sctp_shutdown.c @@ -75,7 +75,7 @@ sctp_send_shutdown(sctp_t *sctp, int rexmit) * sending the shutdown, we can overload out_time * to track how long we have waited. */ - sctp->sctp_out_time = lbolt64; + sctp->sctp_out_time = ddi_get_lbolt64(); } /* diff --git a/usr/src/uts/common/inet/sctp/sctp_timer.c b/usr/src/uts/common/inet/sctp/sctp_timer.c index 24b46ad6f0..47ffe3d1fc 100644 --- a/usr/src/uts/common/inet/sctp/sctp_timer.c +++ b/usr/src/uts/common/inet/sctp/sctp_timer.c @@ -24,7 +24,6 @@ * Use is subject to license terms. */ - #include <sys/types.h> #include <sys/systm.h> #include <sys/stream.h> @@ -416,7 +415,7 @@ sctp_heartbeat_timer(sctp_t *sctp) return; } - now = lbolt64; + now = ddi_get_lbolt64(); earliest_expiry = 0; cnt = sctps->sctps_maxburst; diff --git a/usr/src/uts/common/inet/squeue.c b/usr/src/uts/common/inet/squeue.c index db11ef79ae..a58b445158 100644 --- a/usr/src/uts/common/inet/squeue.c +++ b/usr/src/uts/common/inet/squeue.c @@ -311,7 +311,7 @@ squeue_worker_wakeup(squeue_t *sqp) if (sqp->sq_wait == 0) { ASSERT(tid == 0); ASSERT(!(sqp->sq_state & SQS_TMO_PROG)); - sqp->sq_awaken = lbolt; + sqp->sq_awaken = ddi_get_lbolt(); cv_signal(&sqp->sq_worker_cv); mutex_exit(&sqp->sq_lock); return; @@ -325,7 +325,8 @@ squeue_worker_wakeup(squeue_t *sqp) /* * Waiting for an enter() to process mblk(s). */ - clock_t waited = lbolt - sqp->sq_awaken; + clock_t now = ddi_get_lbolt(); + clock_t waited = now - sqp->sq_awaken; if (TICK_TO_MSEC(waited) >= sqp->sq_wait) { /* @@ -333,7 +334,7 @@ squeue_worker_wakeup(squeue_t *sqp) * waiting for work, so schedule it. */ sqp->sq_tid = 0; - sqp->sq_awaken = lbolt; + sqp->sq_awaken = now; cv_signal(&sqp->sq_worker_cv); mutex_exit(&sqp->sq_lock); (void) untimeout(tid); @@ -691,7 +692,7 @@ squeue_fire(void *arg) sqp->sq_state &= ~SQS_TMO_PROG; if (!(state & SQS_PROC)) { - sqp->sq_awaken = lbolt; + sqp->sq_awaken = ddi_get_lbolt(); cv_signal(&sqp->sq_worker_cv); } mutex_exit(&sqp->sq_lock); @@ -842,7 +843,7 @@ again: goto again; } else { did_wakeup = B_TRUE; - sqp->sq_awaken = lbolt; + sqp->sq_awaken = ddi_get_lbolt(); cv_signal(&sqp->sq_worker_cv); } } @@ -1113,7 +1114,7 @@ poll_again: */ } - sqp->sq_awaken = lbolt; + sqp->sq_awaken = ddi_get_lbolt(); /* * Put the SQS_PROC_HELD on so the worker * thread can distinguish where its called from. We @@ -1464,7 +1465,7 @@ squeue_synch_exit(squeue_t *sqp, conn_t *connp) * worker thread right away when there are outstanding * requests. */ - sqp->sq_awaken = lbolt; + sqp->sq_awaken = ddi_get_lbolt(); cv_signal(&sqp->sq_worker_cv); mutex_exit(&sqp->sq_lock); } diff --git a/usr/src/uts/common/inet/tcp/tcp.c b/usr/src/uts/common/inet/tcp/tcp.c index bfa25ce300..2a1568c063 100644 --- a/usr/src/uts/common/inet/tcp/tcp.c +++ b/usr/src/uts/common/inet/tcp/tcp.c @@ -102,6 +102,8 @@ #include <rpc/pmap_prot.h> #include <sys/callo.h> +#include <sys/clock_impl.h> + /* * TCP Notes: aka FireEngine Phase I (PSARC 2002/433) * @@ -4437,7 +4439,7 @@ tcp_input_listener(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *ira) * be to set the "tcp_syn_defense" flag now. */ TCP_STAT(tcps, tcp_listendropq0); - listener->tcp_last_rcv_lbolt = lbolt64; + listener->tcp_last_rcv_lbolt = ddi_get_lbolt64(); if (!tcp_drop_q0(listener)) { mutex_exit(&listener->tcp_eager_lock); BUMP_MIB(&tcps->tcps_mib, tcpListenDropQ0); @@ -6689,7 +6691,7 @@ tcp_init_values(tcp_t *tcp) tcp->tcp_rto = tcps->tcps_rexmit_interval_min; tcp->tcp_timer_backoff = 0; tcp->tcp_ms_we_have_waited = 0; - tcp->tcp_last_recv_time = lbolt; + tcp->tcp_last_recv_time = ddi_get_lbolt(); tcp->tcp_cwnd_max = tcps->tcps_cwnd_max_; tcp->tcp_cwnd_ssthresh = TCP_MAX_LARGEWIN; tcp->tcp_snd_burst = TCP_CWND_INFINITE; @@ -7221,7 +7223,7 @@ tcp_keepalive_killer(void *arg) return; } - idletime = TICK_TO_MSEC(lbolt - tcp->tcp_last_recv_time); + idletime = TICK_TO_MSEC(ddi_get_lbolt() - tcp->tcp_last_recv_time); /* * If we have not heard from the other side for a long * time, kill the connection unless the keepalive abort @@ -7650,7 +7652,7 @@ tcp_create_common(cred_t *credp, boolean_t isv6, boolean_t issocket, crhold(credp); connp->conn_cred = credp; connp->conn_cpid = curproc->p_pid; - connp->conn_open_time = lbolt64; + connp->conn_open_time = ddi_get_lbolt64(); connp->conn_zoneid = zoneid; /* conn_allzones can not be set this early, hence no IPCL_ZONEID */ @@ -9246,7 +9248,7 @@ tcp_sack_rxmit(tcp_t *tcp, uint_t *flags) /* * Update the send timestamp to avoid false retransmission. */ - snxt_mp->b_prev = (mblk_t *)lbolt; + snxt_mp->b_prev = (mblk_t *)ddi_get_lbolt(); BUMP_MIB(&tcps->tcps_mib, tcpRetransSegs); UPDATE_MIB(&tcps->tcps_mib, tcpRetransBytes, seg_len); @@ -9323,7 +9325,7 @@ tcp_ss_rexmit(tcp_t *tcp) * Update the send timestamp to avoid false * retransmission. */ - old_snxt_mp->b_prev = (mblk_t *)lbolt; + old_snxt_mp->b_prev = (mblk_t *)ddi_get_lbolt(); BUMP_MIB(&tcps->tcps_mib, tcpRetransSegs); UPDATE_MIB(&tcps->tcps_mib, tcpRetransBytes, cnt); @@ -9410,7 +9412,7 @@ tcp_process_options(tcp_t *tcp, tcpha_t *tcpha) tcp->tcp_snd_ts_ok = B_TRUE; tcp->tcp_ts_recent = tcpopt.tcp_opt_ts_val; - tcp->tcp_last_rcv_lbolt = lbolt64; + tcp->tcp_last_rcv_lbolt = ddi_get_lbolt64(); ASSERT(OK_32PTR(tmp_tcph)); ASSERT(connp->conn_ht_ulp_len == TCP_MIN_HEADER_LENGTH); @@ -9648,7 +9650,7 @@ tcp_send_conn_ind(void *arg, mblk_t *mp, void *arg2) if (listener->tcp_syn_defense && listener->tcp_syn_rcvd_timeout <= (tcps->tcps_conn_req_max_q0 >> 5) && - 10*MINUTES < TICK_TO_MSEC(lbolt64 - + 10*MINUTES < TICK_TO_MSEC(ddi_get_lbolt64() - listener->tcp_last_rcv_lbolt)) { /* * Turn off the defense mode if we @@ -9893,7 +9895,7 @@ tcp_input_data(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *ira) * But that should not cause any harm. And it is updated for * all kinds of incoming segments, not only for data segments. */ - tcp->tcp_last_recv_time = lbolt; + tcp->tcp_last_recv_time = LBOLT_FASTPATH; } flags = (unsigned int)tcpha->tha_flags & 0xFF; @@ -10638,7 +10640,7 @@ ok:; TSTMP_GEQ(tcpopt.tcp_opt_ts_val, tcp->tcp_ts_recent) && SEQ_LEQ(seg_seq, tcp->tcp_rack)) { tcp->tcp_ts_recent = tcpopt.tcp_opt_ts_val; - tcp->tcp_last_rcv_lbolt = lbolt64; + tcp->tcp_last_rcv_lbolt = ddi_get_lbolt64(); } if (seg_seq != tcp->tcp_rnxt || tcp->tcp_reass_head) { @@ -11660,7 +11662,7 @@ process_ack: if (tcp->tcp_snd_ts_ok) { /* Ignore zero timestamp echo-reply. */ if (tcpopt.tcp_opt_ts_ecr != 0) { - tcp_set_rto(tcp, (int32_t)lbolt - + tcp_set_rto(tcp, (int32_t)LBOLT_FASTPATH - (int32_t)tcpopt.tcp_opt_ts_ecr); } @@ -11682,7 +11684,7 @@ process_ack: */ if ((mp1->b_next != NULL) && SEQ_GT(seg_ack, (uint32_t)(uintptr_t)(mp1->b_next))) - tcp_set_rto(tcp, (int32_t)lbolt - + tcp_set_rto(tcp, (int32_t)LBOLT_FASTPATH - (int32_t)(intptr_t)mp1->b_prev); else BUMP_MIB(&tcps->tcps_mib, tcpRttNoUpdate); @@ -11713,7 +11715,8 @@ process_ack: */ if (SEQ_GT(seg_ack, (uint32_t)(uintptr_t)(mp1->b_next))) { - mp1->b_prev = (mblk_t *)(uintptr_t)lbolt; + mp1->b_prev = + (mblk_t *)(uintptr_t)LBOLT_FASTPATH; mp1->b_next = NULL; } break; @@ -12211,7 +12214,8 @@ xmit_check: B_TRUE); if (mp1 != NULL) { - tcp->tcp_xmit_head->b_prev = (mblk_t *)lbolt; + tcp->tcp_xmit_head->b_prev = + (mblk_t *)LBOLT_FASTPATH; tcp->tcp_csuna = tcp->tcp_snxt; BUMP_MIB(&tcps->tcps_mib, tcpRetransSegs); UPDATE_MIB(&tcps->tcps_mib, @@ -12246,7 +12250,8 @@ xmit_check: * limited transmitted segment's ACK gets back. */ if (tcp->tcp_xmit_head != NULL) - tcp->tcp_xmit_head->b_prev = (mblk_t *)lbolt; + tcp->tcp_xmit_head->b_prev = + (mblk_t *)LBOLT_FASTPATH; } /* Anything more to do? */ @@ -12407,8 +12412,8 @@ tcp_paws_check(tcp_t *tcp, tcpha_t *tcpha, tcp_opt_t *tcpoptp) if ((flags & TH_RST) == 0 && TSTMP_LT(tcpoptp->tcp_opt_ts_val, tcp->tcp_ts_recent)) { - if (TSTMP_LT(lbolt64, tcp->tcp_last_rcv_lbolt + - PAWS_TIMEOUT)) { + if (TSTMP_LT(LBOLT_FASTPATH, + tcp->tcp_last_rcv_lbolt + PAWS_TIMEOUT)) { /* This segment is not acceptable. */ return (B_FALSE); } else { @@ -13368,7 +13373,7 @@ tcp_timer(void *arg) BUMP_MIB(&tcps->tcps_mib, tcpTimRetrans); if (!tcp->tcp_xmit_head) break; - time_to_wait = lbolt - + time_to_wait = ddi_get_lbolt() - (clock_t)tcp->tcp_xmit_head->b_prev; time_to_wait = tcp->tcp_rto - TICK_TO_MSEC(time_to_wait); @@ -13536,7 +13541,7 @@ tcp_timer(void *arg) * time... */ if ((tcp->tcp_zero_win_probe == 0) || - (TICK_TO_MSEC(lbolt - tcp->tcp_last_recv_time) > + (TICK_TO_MSEC(ddi_get_lbolt() - tcp->tcp_last_recv_time) > second_threshold)) { BUMP_MIB(&tcps->tcps_mib, tcpTimRetransDrop); /* @@ -13558,8 +13563,8 @@ tcp_timer(void *arg) /* * Set tcp_ms_we_have_waited to second_threshold * so that in next timeout, we will do the above - * check (lbolt - tcp_last_recv_time). This is - * also to avoid overflow. + * check (ddi_get_lbolt() - tcp_last_recv_time). + * This is also to avoid overflow. * * We don't need to decrement tcp_timer_backoff * to avoid overflow because it will be decremented @@ -13635,7 +13640,7 @@ tcp_timer(void *arg) mss = tcp->tcp_swnd; if ((mp = tcp->tcp_xmit_head) != NULL) - mp->b_prev = (mblk_t *)lbolt; + mp->b_prev = (mblk_t *)ddi_get_lbolt(); mp = tcp_xmit_mp(tcp, mp, mss, NULL, NULL, tcp->tcp_suna, B_TRUE, &mss, B_TRUE); @@ -14003,7 +14008,8 @@ tcp_output(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy) * Reinitialize tcp_cwnd after idle. */ if ((tcp->tcp_suna == snxt) && !tcp->tcp_localnet && - (TICK_TO_MSEC(lbolt - tcp->tcp_last_recv_time) >= tcp->tcp_rto)) { + (TICK_TO_MSEC(ddi_get_lbolt() - tcp->tcp_last_recv_time) >= + tcp->tcp_rto)) { SET_TCP_INIT_CWND(tcp, mss, tcps->tcps_slow_start_after_idle); } @@ -14064,7 +14070,7 @@ tcp_output(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy) if ((mp1 = dupb(mp)) == 0) goto no_memory; - mp->b_prev = (mblk_t *)(uintptr_t)lbolt; + mp->b_prev = (mblk_t *)(uintptr_t)ddi_get_lbolt(); mp->b_next = (mblk_t *)(uintptr_t)snxt; /* adjust tcp header information */ @@ -14119,7 +14125,9 @@ tcp_output(void *arg, mblk_t *mp, void *arg2, ip_recv_attr_t *dummy) /* Fill in the timestamp option. */ if (tcp->tcp_snd_ts_ok) { - U32_TO_BE32((uint32_t)lbolt, + uint32_t llbolt = (uint32_t)LBOLT_FASTPATH; + + U32_TO_BE32(llbolt, (char *)tcpha + TCP_MIN_HEADER_LENGTH+4); U32_TO_BE32(tcp->tcp_ts_recent, (char *)tcpha + TCP_MIN_HEADER_LENGTH+8); @@ -15552,7 +15560,8 @@ data_null: } if ((tcp->tcp_suna == snxt) && !tcp->tcp_localnet && - (TICK_TO_MSEC(lbolt - tcp->tcp_last_recv_time) >= tcp->tcp_rto)) { + (TICK_TO_MSEC((clock_t)LBOLT_FASTPATH - tcp->tcp_last_recv_time) >= + tcp->tcp_rto)) { SET_TCP_INIT_CWND(tcp, mss, tcps->tcps_slow_start_after_idle); } if (tcpstate == TCPS_SYN_RCVD) { @@ -15634,7 +15643,7 @@ data_null: } } - local_time = (mblk_t *)lbolt; + local_time = (mblk_t *)LBOLT_FASTPATH; /* * "Our" Nagle Algorithm. This is not the same as in the old @@ -16795,7 +16804,9 @@ tcp_xmit_ctl(char *str, tcp_t *tcp, uint32_t seq, uint32_t ack, int ctl) } if (ctl & TH_ACK) { if (tcp->tcp_snd_ts_ok) { - U32_TO_BE32(lbolt, + uint32_t llbolt = (uint32_t)ddi_get_lbolt(); + + U32_TO_BE32(llbolt, (char *)tcpha + TCP_MIN_HEADER_LENGTH+4); U32_TO_BE32(tcp->tcp_ts_recent, (char *)tcpha + TCP_MIN_HEADER_LENGTH+8); @@ -16838,7 +16849,7 @@ tcp_send_rst_chk(tcp_stack_t *tcps) * limited. */ if (tcps->tcps_rst_sent_rate_enabled != 0) { - now = lbolt; + now = ddi_get_lbolt(); /* lbolt can wrap around. */ if ((tcps->tcps_last_rst_intrvl > now) || (TICK_TO_MSEC(now - tcps->tcps_last_rst_intrvl) > @@ -17482,7 +17493,8 @@ tcp_xmit_mp(tcp_t *tcp, mblk_t *mp, int32_t max_to_send, int32_t *offset, flags = TH_SYN; if (tcp->tcp_snd_ts_ok) { - uint32_t llbolt = (uint32_t)lbolt; + uint32_t llbolt = + (uint32_t)ddi_get_lbolt(); wptr = mp1->b_wptr; wptr[0] = TCPOPT_NOP; @@ -17619,7 +17631,7 @@ tcp_xmit_mp(tcp_t *tcp, mblk_t *mp, int32_t max_to_send, int32_t *offset, if (tcp->tcp_snd_ts_ok) { if (tcp->tcp_state != TCPS_SYN_SENT) { - uint32_t llbolt = (uint32_t)lbolt; + uint32_t llbolt = (uint32_t)ddi_get_lbolt(); U32_TO_BE32(llbolt, (char *)tcpha + TCP_MIN_HEADER_LENGTH+4); @@ -17843,7 +17855,7 @@ tcp_ack_mp(tcp_t *tcp) /* fill in timestamp option if in use */ if (tcp->tcp_snd_ts_ok) { - uint32_t llbolt = (uint32_t)lbolt; + uint32_t llbolt = (uint32_t)LBOLT_FASTPATH; U32_TO_BE32(llbolt, (char *)tcpha + TCP_MIN_HEADER_LENGTH+4); @@ -19339,7 +19351,7 @@ tcp_time_wait_processing(tcp_t *tcp, mblk_t *mp, uint32_t seg_seq, TSTMP_GEQ(tcpopt.tcp_opt_ts_val, tcp->tcp_ts_recent) && SEQ_LEQ(seg_seq, tcp->tcp_rack)) { tcp->tcp_ts_recent = tcpopt.tcp_opt_ts_val; - tcp->tcp_last_rcv_lbolt = lbolt64; + tcp->tcp_last_rcv_lbolt = ddi_get_lbolt64(); } if (seg_seq != tcp->tcp_rnxt && seg_len > 0) { diff --git a/usr/src/uts/common/inet/udp/udp.c b/usr/src/uts/common/inet/udp/udp.c index e18fc57f40..de54c3a5ab 100644 --- a/usr/src/uts/common/inet/udp/udp.c +++ b/usr/src/uts/common/inet/udp/udp.c @@ -5148,7 +5148,7 @@ udp_do_open(cred_t *credp, boolean_t isv6, int flags) crhold(credp); connp->conn_cred = credp; connp->conn_cpid = curproc->p_pid; - connp->conn_open_time = lbolt64; + connp->conn_open_time = ddi_get_lbolt64(); /* Cache things in ixa without an extra refhold */ connp->conn_ixa->ixa_cred = connp->conn_cred; connp->conn_ixa->ixa_cpid = connp->conn_cpid; |