Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_timer.c
Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | tcp_timer_delack(void *xtp) | ||||
} | } | ||||
KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, | KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, | ||||
("%s: tp %p tcpcb can't be stopped here", __func__, tp)); | ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); | ||||
KASSERT((tp->t_timers->tt_flags & TT_DELACK) != 0, | KASSERT((tp->t_timers->tt_flags & TT_DELACK) != 0, | ||||
("%s: tp %p delack callout should be running", __func__, tp)); | ("%s: tp %p delack callout should be running", __func__, tp)); | ||||
tp->t_flags |= TF_ACKNOW; | tp->t_flags |= TF_ACKNOW; | ||||
TCPSTAT_INC(tcps_delack); | TCPSTAT_INC(tcps_delack); | ||||
(void) tcp_output(tp); | (void) tp->t_fb->tfb_tcp_output(tp); | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
void | void | ||||
tcp_timer_2msl(void *xtp) | tcp_timer_2msl(void *xtp) | ||||
{ | { | ||||
struct tcpcb *tp = xtp; | struct tcpcb *tp = xtp; | ||||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | #endif | ||||
if (tp->t_state > TCPS_CLOSE_WAIT && | if (tp->t_state > TCPS_CLOSE_WAIT && | ||||
(ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { | (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { | ||||
TCPSTAT_INC(tcps_persistdrop); | TCPSTAT_INC(tcps_persistdrop); | ||||
tp = tcp_drop(tp, ETIMEDOUT); | tp = tcp_drop(tp, ETIMEDOUT); | ||||
goto out; | goto out; | ||||
} | } | ||||
tcp_setpersist(tp); | tcp_setpersist(tp); | ||||
tp->t_flags |= TF_FORCEDATA; | tp->t_flags |= TF_FORCEDATA; | ||||
(void) tcp_output(tp); | (void) tp->t_fb->tfb_tcp_output(tp); | ||||
tp->t_flags &= ~TF_FORCEDATA; | tp->t_flags &= ~TF_FORCEDATA; | ||||
out: | out: | ||||
#ifdef TCPDEBUG | #ifdef TCPDEBUG | ||||
if (tp != NULL && tp->t_inpcb->inp_socket->so_options & SO_DEBUG) | if (tp != NULL && tp->t_inpcb->inp_socket->so_options & SO_DEBUG) | ||||
tcp_trace(TA_USER, ostate, tp, NULL, NULL, PRU_SLOWTIMO); | tcp_trace(TA_USER, ostate, tp, NULL, NULL, PRU_SLOWTIMO); | ||||
#endif | #endif | ||||
TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); | TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | #endif | ||||
tp->t_flags |= TF_ACKNOW; | tp->t_flags |= TF_ACKNOW; | ||||
/* | /* | ||||
* If timing a segment in this window, stop the timer. | * If timing a segment in this window, stop the timer. | ||||
*/ | */ | ||||
tp->t_rtttime = 0; | tp->t_rtttime = 0; | ||||
cc_cong_signal(tp, NULL, CC_RTO); | cc_cong_signal(tp, NULL, CC_RTO); | ||||
(void) tcp_output(tp); | (void) tp->t_fb->tfb_tcp_output(tp); | ||||
out: | out: | ||||
#ifdef TCPDEBUG | #ifdef TCPDEBUG | ||||
if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) | if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) | ||||
tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, | tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, | ||||
PRU_SLOWTIMO); | PRU_SLOWTIMO); | ||||
#endif | #endif | ||||
TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); | TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | case TT_KEEP: | ||||
f_reset = TT_KEEP_RST; | f_reset = TT_KEEP_RST; | ||||
break; | break; | ||||
case TT_2MSL: | case TT_2MSL: | ||||
t_callout = &tp->t_timers->tt_2msl; | t_callout = &tp->t_timers->tt_2msl; | ||||
f_callout = tcp_timer_2msl; | f_callout = tcp_timer_2msl; | ||||
f_reset = TT_2MSL_RST; | f_reset = TT_2MSL_RST; | ||||
break; | break; | ||||
default: | default: | ||||
if (tp->t_fb->tfb_tcp_timer_activate) { | |||||
tp->t_fb->tfb_tcp_timer_activate(tp, timer_type, delta); | |||||
return; | |||||
} | |||||
panic("tp %p bad timer_type %#x", tp, timer_type); | panic("tp %p bad timer_type %#x", tp, timer_type); | ||||
} | } | ||||
if (delta == 0) { | if (delta == 0) { | ||||
if ((tp->t_timers->tt_flags & timer_type) && | if ((tp->t_timers->tt_flags & timer_type) && | ||||
(callout_stop(t_callout) > 0) && | (callout_stop(t_callout) > 0) && | ||||
(tp->t_timers->tt_flags & f_reset)) { | (tp->t_timers->tt_flags & f_reset)) { | ||||
tp->t_timers->tt_flags &= ~(timer_type | f_reset); | tp->t_timers->tt_flags &= ~(timer_type | f_reset); | ||||
} | } | ||||
Show All 30 Lines | case TT_PERSIST: | ||||
break; | break; | ||||
case TT_KEEP: | case TT_KEEP: | ||||
t_callout = &tp->t_timers->tt_keep; | t_callout = &tp->t_timers->tt_keep; | ||||
break; | break; | ||||
case TT_2MSL: | case TT_2MSL: | ||||
t_callout = &tp->t_timers->tt_2msl; | t_callout = &tp->t_timers->tt_2msl; | ||||
break; | break; | ||||
default: | default: | ||||
if (tp->t_fb->tfb_tcp_timer_active) { | |||||
return(tp->t_fb->tfb_tcp_timer_active(tp, timer_type)); | |||||
} | |||||
panic("tp %p bad timer_type %#x", tp, timer_type); | panic("tp %p bad timer_type %#x", tp, timer_type); | ||||
} | } | ||||
return callout_active(t_callout); | return callout_active(t_callout); | ||||
} | } | ||||
void | void | ||||
tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type) | tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type) | ||||
{ | { | ||||
Show All 25 Lines | case TT_KEEP: | ||||
f_reset = TT_KEEP_RST; | f_reset = TT_KEEP_RST; | ||||
break; | break; | ||||
case TT_2MSL: | case TT_2MSL: | ||||
t_callout = &tp->t_timers->tt_2msl; | t_callout = &tp->t_timers->tt_2msl; | ||||
f_callout = tcp_timer_2msl_discard; | f_callout = tcp_timer_2msl_discard; | ||||
f_reset = TT_2MSL_RST; | f_reset = TT_2MSL_RST; | ||||
break; | break; | ||||
default: | default: | ||||
if (tp->t_fb->tfb_tcp_timer_stop) { | |||||
/* | |||||
* XXXrrs we need to look at this with the | |||||
* stop case below (flags). | |||||
*/ | |||||
tp->t_fb->tfb_tcp_timer_stop(tp, timer_type); | |||||
return; | |||||
} | |||||
panic("tp %p bad timer_type %#x", tp, timer_type); | panic("tp %p bad timer_type %#x", tp, timer_type); | ||||
} | } | ||||
if (tp->t_timers->tt_flags & timer_type) { | if (tp->t_timers->tt_flags & timer_type) { | ||||
if ((callout_stop(t_callout) > 0) && | if ((callout_stop(t_callout) > 0) && | ||||
(tp->t_timers->tt_flags & f_reset)) { | (tp->t_timers->tt_flags & f_reset)) { | ||||
tp->t_timers->tt_flags &= ~(timer_type | f_reset); | tp->t_timers->tt_flags &= ~(timer_type | f_reset); | ||||
} else { | } else { | ||||
Show All 39 Lines |