Lines Matching refs:tcp

140 	tcp_t *tcp = connp->conn_tcp;  in tcp_timeout()  local
144 TCP_DBGSTAT(tcp->tcp_tcps, tcp_timeout_calls); in tcp_timeout()
146 if (tcp->tcp_timercache == NULL) { in tcp_timeout()
149 TCP_DBGSTAT(tcp->tcp_tcps, tcp_timeout_cached_alloc); in tcp_timeout()
150 mp = tcp->tcp_timercache; in tcp_timeout()
151 tcp->tcp_timercache = mp->b_next; in tcp_timeout()
194 tcp_t *tcp = connp->conn_tcp; in tcp_timer_handler() local
215 if (tcp->tcp_state != TCPS_CLOSED) { in tcp_timer_handler()
218 tcp->tcp_timer_tid = 0; in tcp_timer_handler()
331 tcp_timermp_free(tcp_t *tcp) in tcp_timermp_free() argument
335 while ((mp = tcp->tcp_timercache) != NULL) { in tcp_timermp_free()
337 tcp->tcp_timercache = tcp->tcp_timercache->b_next; in tcp_timermp_free()
348 tcp_timer_free(tcp_t *tcp, mblk_t *mp) in tcp_timer_free() argument
350 mblk_t *mp1 = tcp->tcp_timercache; in tcp_timer_free()
365 tcp->tcp_timercache = mp; in tcp_timer_free()
368 TCP_DBGSTAT(tcp->tcp_tcps, tcp_timermp_freed); in tcp_timer_free()
376 tcp_timers_stop(tcp_t *tcp) in tcp_timers_stop() argument
378 if (tcp->tcp_timer_tid != 0) { in tcp_timers_stop()
379 (void) TCP_TIMER_CANCEL(tcp, tcp->tcp_timer_tid); in tcp_timers_stop()
380 tcp->tcp_timer_tid = 0; in tcp_timers_stop()
382 if (tcp->tcp_ka_tid != 0) { in tcp_timers_stop()
383 (void) TCP_TIMER_CANCEL(tcp, tcp->tcp_ka_tid); in tcp_timers_stop()
384 tcp->tcp_ka_tid = 0; in tcp_timers_stop()
386 if (tcp->tcp_ack_tid != 0) { in tcp_timers_stop()
387 (void) TCP_TIMER_CANCEL(tcp, tcp->tcp_ack_tid); in tcp_timers_stop()
388 tcp->tcp_ack_tid = 0; in tcp_timers_stop()
390 if (tcp->tcp_push_tid != 0) { in tcp_timers_stop()
391 (void) TCP_TIMER_CANCEL(tcp, tcp->tcp_push_tid); in tcp_timers_stop()
392 tcp->tcp_push_tid = 0; in tcp_timers_stop()
394 if (tcp->tcp_reass_tid != 0) { in tcp_timers_stop()
395 (void) TCP_TIMER_CANCEL(tcp, tcp->tcp_reass_tid); in tcp_timers_stop()
396 tcp->tcp_reass_tid = 0; in tcp_timers_stop()
422 tcp_t *tcp = connp->conn_tcp; in tcp_keepalive_timer() local
426 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_keepalive_timer()
428 tcp->tcp_ka_tid = 0; in tcp_keepalive_timer()
430 if (tcp->tcp_fused) in tcp_keepalive_timer()
434 ka_intrvl = tcp->tcp_ka_interval; in tcp_keepalive_timer()
440 if (tcp->tcp_state > TCPS_CLOSE_WAIT) { in tcp_keepalive_timer()
444 if (tcp->tcp_state < TCPS_ESTABLISHED) { in tcp_keepalive_timer()
445 tcp->tcp_ka_tid = TCP_TIMER(tcp, tcp_keepalive_timer, in tcp_keepalive_timer()
450 idletime = TICK_TO_MSEC(ddi_get_lbolt() - tcp->tcp_last_recv_time); in tcp_keepalive_timer()
456 if (tcp->tcp_ka_abort_thres != 0 && in tcp_keepalive_timer()
457 idletime > (ka_intrvl + tcp->tcp_ka_abort_thres)) { in tcp_keepalive_timer()
459 (void) tcp_clean_death(tcp, tcp->tcp_client_errno ? in tcp_keepalive_timer()
460 tcp->tcp_client_errno : ETIMEDOUT); in tcp_keepalive_timer()
464 if (tcp->tcp_snxt == tcp->tcp_suna && in tcp_keepalive_timer()
471 mp = tcp_xmit_mp(tcp, mp1, 1, NULL, NULL, in tcp_keepalive_timer()
472 tcp->tcp_suna - 1, B_FALSE, NULL, B_TRUE); in tcp_keepalive_timer()
479 tcp_send_data(tcp, mp); in tcp_keepalive_timer()
481 if (tcp->tcp_ka_rinterval) { in tcp_keepalive_timer()
482 firetime = tcp->tcp_ka_rinterval; in tcp_keepalive_timer()
483 } else if (tcp->tcp_ka_last_intrvl != 0) { in tcp_keepalive_timer()
490 max = tcp->tcp_rto_max; in tcp_keepalive_timer()
492 tcp->tcp_ka_last_intrvl << 1); in tcp_keepalive_timer()
496 firetime = tcp->tcp_rto; in tcp_keepalive_timer()
498 tcp->tcp_ka_tid = TCP_TIMER(tcp, in tcp_keepalive_timer()
500 tcp->tcp_ka_last_intrvl = firetime; in tcp_keepalive_timer()
505 tcp->tcp_ka_last_intrvl = 0; in tcp_keepalive_timer()
512 tcp->tcp_ka_tid = TCP_TIMER(tcp, tcp_keepalive_timer, firetime); in tcp_keepalive_timer()
519 tcp_t *tcp = connp->conn_tcp; in tcp_reass_timer() local
521 tcp->tcp_reass_tid = 0; in tcp_reass_timer()
522 if (tcp->tcp_reass_head == NULL) in tcp_reass_timer()
524 ASSERT(tcp->tcp_reass_tail != NULL); in tcp_reass_timer()
525 if (tcp->tcp_snd_sack_ok && tcp->tcp_num_sack_blk > 0) { in tcp_reass_timer()
526 tcp_sack_remove(tcp->tcp_sack_list, in tcp_reass_timer()
527 TCP_REASS_END(tcp->tcp_reass_tail), &tcp->tcp_num_sack_blk); in tcp_reass_timer()
529 tcp_close_mpp(&tcp->tcp_reass_head); in tcp_reass_timer()
530 tcp->tcp_reass_tail = NULL; in tcp_reass_timer()
531 TCP_STAT(tcp->tcp_tcps, tcp_reass_timeout); in tcp_reass_timer()
539 tcp_t *tcp = connp->conn_tcp; in tcp_push_timer() local
541 TCP_DBGSTAT(tcp->tcp_tcps, tcp_push_timer_cnt); in tcp_push_timer()
543 ASSERT(tcp->tcp_listener == NULL); in tcp_push_timer()
547 tcp->tcp_push_tid = 0; in tcp_push_timer()
549 if (tcp->tcp_rcv_list != NULL && in tcp_push_timer()
550 tcp_rcv_drain(tcp) == TH_ACK_NEEDED) in tcp_push_timer()
551 tcp_xmit_ctl(NULL, tcp, tcp->tcp_snxt, tcp->tcp_rnxt, TH_ACK); in tcp_push_timer()
561 tcp_t *tcp = connp->conn_tcp; in tcp_ack_timer() local
563 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_ack_timer()
567 tcp->tcp_ack_tid = 0; in tcp_ack_timer()
569 if (tcp->tcp_fused) in tcp_ack_timer()
575 if (tcp->tcp_rnxt == tcp->tcp_rack) { in tcp_ack_timer()
579 if ((tcp->tcp_rnxt - tcp->tcp_rack) > tcp->tcp_mss) { in tcp_ack_timer()
590 if (tcp->tcp_rack_abs_max > 2) in tcp_ack_timer()
591 tcp->tcp_rack_abs_max--; in tcp_ack_timer()
592 tcp->tcp_rack_cur_max = 2; in tcp_ack_timer()
594 mp = tcp_ack_mp(tcp); in tcp_ack_timer()
600 tcp_send_data(tcp, mp); in tcp_ack_timer()
609 tcp_ip_notify(tcp_t *tcp) in tcp_ip_notify() argument
611 conn_t *connp = tcp->tcp_connp; in tcp_ip_notify()
650 tcp_t *tcp = connp->conn_tcp; in tcp_timer() local
651 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_timer()
654 tcp->tcp_timer_tid = 0; in tcp_timer()
656 if (tcp->tcp_fused) in tcp_timer()
659 first_threshold = tcp->tcp_first_timer_threshold; in tcp_timer()
660 second_threshold = tcp->tcp_second_timer_threshold; in tcp_timer()
661 switch (tcp->tcp_state) { in tcp_timer()
667 tcp_t *listener = tcp->tcp_listener; in tcp_timer()
669 if (tcp->tcp_syn_rcvd_timeout == 0 && (listener != NULL)) { in tcp_timer()
671 tcp->tcp_syn_rcvd_timeout = 1; in tcp_timer()
674 if (!tcp->tcp_dontdrop && !tcp->tcp_closemp_used) { in tcp_timer()
680 MAKE_DROPPABLE(listener, tcp); in tcp_timer()
700 tcp->tcp_syn_rcvd_timeout++; in tcp_timer()
701 if (tcp->tcp_syn_rcvd_timeout > 1 && in tcp_timer()
702 !tcp->tcp_closemp_used) { in tcp_timer()
713 MAKE_DROPPABLE(listener, tcp); in tcp_timer()
720 first_threshold = tcp->tcp_first_ctimer_threshold; in tcp_timer()
721 second_threshold = tcp->tcp_second_ctimer_threshold; in tcp_timer()
733 if (tcp->tcp_active_open) in tcp_timer()
753 if (tcp->tcp_suna != tcp->tcp_snxt) { in tcp_timer()
757 if (!tcp->tcp_xmit_head) in tcp_timer()
760 (hrtime_t)(intptr_t)tcp->tcp_xmit_head->b_prev); in tcp_timer()
761 time_to_wait = tcp->tcp_rto - time_to_wait; in tcp_timer()
768 TCP_TIMER_RESTART(tcp, time_to_wait); in tcp_timer()
781 if (tcp->tcp_swnd == 0 || tcp->tcp_zero_win_probe) { in tcp_timer()
787 cc_cong_signal(tcp, 0, CC_RTO); in tcp_timer()
804 if (tcp->tcp_unsent != 0) { in tcp_timer()
808 if (tcp->tcp_snd_zcopy_aware && !tcp->tcp_xmit_zc_clean) in tcp_timer()
809 tcp->tcp_xmit_head = tcp_zcopy_backoff(tcp, in tcp_timer()
810 tcp->tcp_xmit_head, B_TRUE); in tcp_timer()
812 if (tcp->tcp_cwnd == 0) { in tcp_timer()
819 ASSERT(tcp->tcp_ecn_ok); in tcp_timer()
820 tcp->tcp_cwnd = tcp->tcp_mss; in tcp_timer()
822 if (tcp->tcp_swnd == 0) { in tcp_timer()
824 tcp->tcp_swnd++; in tcp_timer()
825 tcp->tcp_zero_win_probe = B_TRUE; in tcp_timer()
827 tcp->tcp_cs.tcp_out_zwnd_probes++; in tcp_timer()
845 tcp->tcp_max_swnd = MAX(tcp->tcp_swnd, 2); in tcp_timer()
847 tcp_wput_data(tcp, NULL, B_FALSE); in tcp_timer()
851 if ((tcp->tcp_valid_bits & TCP_FSS_VALID) && in tcp_timer()
852 !tcp->tcp_fin_acked) in tcp_timer()
864 if (TCP_IS_DETACHED(tcp)) { in tcp_timer()
865 (void) tcp_clean_death(tcp, 0); in tcp_timer()
867 TCP_TIMER_RESTART(tcp, in tcp_timer()
868 tcp->tcp_fin_wait_2_flush_interval); in tcp_timer()
872 (void) tcp_clean_death(tcp, 0); in tcp_timer()
878 tcp->tcp_state, tcp_display(tcp, NULL, in tcp_timer()
889 if (tcps->tcps_reclaim || (tcp->tcp_listen_cnt != NULL && in tcp_timer()
890 tcp->tcp_listen_cnt->tlc_cnt > tcp->tcp_listen_cnt->tlc_max)) { in tcp_timer()
899 if ((ms = tcp->tcp_ms_we_have_waited) > second_threshold) { in tcp_timer()
903 if (tcp->tcp_snd_zcopy_aware && !tcp->tcp_xmit_zc_clean) in tcp_timer()
904 tcp->tcp_xmit_head = tcp_zcopy_backoff(tcp, in tcp_timer()
905 tcp->tcp_xmit_head, B_TRUE); in tcp_timer()
912 tcp->tcp_ms_we_have_waited = second_threshold; in tcp_timer()
921 if ((tcp->tcp_zero_win_probe == 0) || in tcp_timer()
922 (TICK_TO_MSEC(ddi_get_lbolt() - tcp->tcp_last_recv_time) > in tcp_timer()
930 if (tcp->tcp_state == TCPS_SYN_RCVD) { in tcp_timer()
933 tcp, tcp->tcp_snxt, in tcp_timer()
934 tcp->tcp_rnxt, TH_RST | TH_ACK); in tcp_timer()
936 (void) tcp_clean_death(tcp, in tcp_timer()
937 tcp->tcp_client_errno ? in tcp_timer()
938 tcp->tcp_client_errno : ETIMEDOUT); in tcp_timer()
946 (void) tcp_clean_death(tcp, in tcp_timer()
947 tcp->tcp_client_errno ? in tcp_timer()
948 tcp->tcp_client_errno : ETIMEDOUT); in tcp_timer()
967 tcp->tcp_ms_we_have_waited = second_threshold; in tcp_timer()
973 if (tcp->tcp_snd_zcopy_aware && !tcp->tcp_xmit_zc_clean) in tcp_timer()
974 tcp->tcp_xmit_head = tcp_zcopy_backoff(tcp, in tcp_timer()
975 tcp->tcp_xmit_head, B_TRUE); in tcp_timer()
985 if (tcp->tcp_rtt_sa != 0 && tcp->tcp_zero_win_probe == 0) { in tcp_timer()
986 tcp->tcp_rtt_sd += tcp->tcp_rtt_sa >> 3 + in tcp_timer()
987 tcp->tcp_rtt_sa >> 5; in tcp_timer()
988 tcp->tcp_rtt_sa = 0; in tcp_timer()
989 tcp_ip_notify(tcp); in tcp_timer()
990 tcp->tcp_rtt_update = 0; in tcp_timer()
995 tcp->tcp_timer_backoff++; in tcp_timer()
1001 ms = tcp_calculate_rto(tcp, tcps, 0) << tcp->tcp_timer_backoff; in tcp_timer()
1002 if (ms > tcp->tcp_rto_max) { in tcp_timer()
1003 ms = tcp->tcp_rto_max; in tcp_timer()
1004 tcp->tcp_timer_backoff--; in tcp_timer()
1006 tcp->tcp_ms_we_have_waited += ms; in tcp_timer()
1007 if (tcp->tcp_zero_win_probe == 0) { in tcp_timer()
1008 tcp->tcp_rto = ms; in tcp_timer()
1010 TCP_TIMER_RESTART(tcp, ms); in tcp_timer()
1016 tcp->tcp_set_timer = 1; in tcp_timer()
1017 mss = tcp->tcp_snxt - tcp->tcp_suna; in tcp_timer()
1018 if (mss > tcp->tcp_mss) in tcp_timer()
1019 mss = tcp->tcp_mss; in tcp_timer()
1020 if (mss > tcp->tcp_swnd && tcp->tcp_swnd != 0) in tcp_timer()
1021 mss = tcp->tcp_swnd; in tcp_timer()
1023 if ((mp = tcp->tcp_xmit_head) != NULL) { in tcp_timer()
1026 mp = tcp_xmit_mp(tcp, mp, mss, NULL, NULL, tcp->tcp_suna, B_TRUE, &mss, in tcp_timer()
1034 tcp->tcp_rexmit_nxt = tcp->tcp_suna; in tcp_timer()
1035 if ((tcp->tcp_valid_bits & TCP_FSS_VALID) && in tcp_timer()
1036 (tcp->tcp_unsent == 0)) { in tcp_timer()
1037 tcp->tcp_rexmit_max = tcp->tcp_fss; in tcp_timer()
1039 tcp->tcp_rexmit_max = tcp->tcp_snxt; in tcp_timer()
1041 tcp->tcp_rexmit = B_TRUE; in tcp_timer()
1042 tcp->tcp_dupack_cnt = 0; in tcp_timer()
1047 if (tcp->tcp_snd_sack_ok) in tcp_timer()
1048 TCP_NOTSACK_REMOVE_ALL(tcp->tcp_notsack_list, tcp); in tcp_timer()
1053 tcp->tcp_csuna = tcp->tcp_snxt; in tcp_timer()
1056 tcp->tcp_cs.tcp_out_retrans_segs++; in tcp_timer()
1057 tcp->tcp_cs.tcp_out_retrans_bytes += mss; in tcp_timer()
1058 tcp_send_data(tcp, mp); in tcp_timer()
1070 tcp_t *tcp = connp->conn_tcp; in tcp_close_linger_timeout() local
1072 tcp->tcp_client_errno = ETIMEDOUT; in tcp_close_linger_timeout()
1073 tcp_stop_lingering(tcp); in tcp_close_linger_timeout()