Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/rack.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 8,338 Lines • ▼ Show 20 Lines | if ((sbused(&so->so_snd) == 0) && | ||||
/* | /* | ||||
* We must be sure our fin | * We must be sure our fin | ||||
* was sent and acked (we can be | * was sent and acked (we can be | ||||
* in FIN_WAIT_1 without having | * in FIN_WAIT_1 without having | ||||
* sent the fin). | * sent the fin). | ||||
*/ | */ | ||||
ourfinisacked = 1; | ourfinisacked = 1; | ||||
} | } | ||||
SOCKBUF_UNLOCK(&so->so_snd); | /* NB: sowwakeup_locked() does an implicit unlock. */ | ||||
tp->t_flags |= TF_WAKESOW; | sowwakeup_locked(so); | ||||
m_freem(mfree); | m_freem(mfree); | ||||
if (rack->r_ctl.rc_early_recovery == 0) { | if (rack->r_ctl.rc_early_recovery == 0) { | ||||
if (IN_RECOVERY(tp->t_flags)) { | if (IN_RECOVERY(tp->t_flags)) { | ||||
if (SEQ_LT(th->th_ack, tp->snd_recover) && | if (SEQ_LT(th->th_ack, tp->snd_recover) && | ||||
(SEQ_LT(th->th_ack, tp->snd_max))) { | (SEQ_LT(th->th_ack, tp->snd_max))) { | ||||
tcp_rack_partialack(tp, th); | tcp_rack_partialack(tp, th); | ||||
} else { | } else { | ||||
rack_post_recovery(tp, th); | rack_post_recovery(tp, th); | ||||
▲ Show 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | #endif | ||||
SOCKBUF_LOCK(&so->so_rcv); | SOCKBUF_LOCK(&so->so_rcv); | ||||
if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { | if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { | ||||
m_freem(m); | m_freem(m); | ||||
} else | } else | ||||
#ifdef NETFLIX_SB_LIMITS | #ifdef NETFLIX_SB_LIMITS | ||||
appended = | appended = | ||||
#endif | #endif | ||||
sbappendstream_locked(&so->so_rcv, m, 0); | sbappendstream_locked(&so->so_rcv, m, 0); | ||||
SOCKBUF_UNLOCK(&so->so_rcv); | |||||
tp->t_flags |= TF_WAKESOR; | tp->t_flags |= TF_WAKESOR; | ||||
#ifdef NETFLIX_SB_LIMITS | #ifdef NETFLIX_SB_LIMITS | ||||
if (so->so_rcv.sb_shlim && appended != mcnt) | if (so->so_rcv.sb_shlim && appended != mcnt) | ||||
counter_fo_release(so->so_rcv.sb_shlim, | counter_fo_release(so->so_rcv.sb_shlim, | ||||
mcnt - appended); | mcnt - appended); | ||||
#endif | #endif | ||||
} else { | } else { | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | if (newsize) | ||||
so->so_rcv.sb_flags &= ~SB_AUTOSIZE; | so->so_rcv.sb_flags &= ~SB_AUTOSIZE; | ||||
m_adj(m, drop_hdrlen); /* delayed header drop */ | m_adj(m, drop_hdrlen); /* delayed header drop */ | ||||
#ifdef NETFLIX_SB_LIMITS | #ifdef NETFLIX_SB_LIMITS | ||||
appended = | appended = | ||||
#endif | #endif | ||||
sbappendstream_locked(&so->so_rcv, m, 0); | sbappendstream_locked(&so->so_rcv, m, 0); | ||||
ctf_calc_rwin(so, tp); | ctf_calc_rwin(so, tp); | ||||
} | } | ||||
SOCKBUF_UNLOCK(&so->so_rcv); | |||||
tp->t_flags |= TF_WAKESOR; | tp->t_flags |= TF_WAKESOR; | ||||
#ifdef NETFLIX_SB_LIMITS | #ifdef NETFLIX_SB_LIMITS | ||||
if (so->so_rcv.sb_shlim && mcnt != appended) | if (so->so_rcv.sb_shlim && mcnt != appended) | ||||
counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); | counter_fo_release(so->so_rcv.sb_shlim, mcnt - appended); | ||||
#endif | #endif | ||||
rack_handle_delayed_ack(tp, rack, tlen, 0); | rack_handle_delayed_ack(tp, rack, tlen, 0); | ||||
if (tp->snd_una == tp->snd_max) | if (tp->snd_una == tp->snd_max) | ||||
sack_filter_clear(&rack->r_ctl.rack_sf, tp->snd_una); | sack_filter_clear(&rack->r_ctl.rack_sf, tp->snd_una); | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | if (tp->snd_una == tp->snd_max) { | ||||
if (rack->r_ctl.rc_went_idle_time == 0) | if (rack->r_ctl.rc_went_idle_time == 0) | ||||
rack->r_ctl.rc_went_idle_time = 1; | rack->r_ctl.rc_went_idle_time = 1; | ||||
rack_log_progress_event(rack, tp, 0, PROGRESS_CLEAR, __LINE__); | rack_log_progress_event(rack, tp, 0, PROGRESS_CLEAR, __LINE__); | ||||
if (sbavail(&tp->t_inpcb->inp_socket->so_snd) == 0) | if (sbavail(&tp->t_inpcb->inp_socket->so_snd) == 0) | ||||
tp->t_acktime = 0; | tp->t_acktime = 0; | ||||
rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); | rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); | ||||
} | } | ||||
/* Wake up the socket if we have room to write more */ | /* Wake up the socket if we have room to write more */ | ||||
tp->t_flags |= TF_WAKESOW; | sowwakeup(so); | ||||
if (sbavail(&so->so_snd)) { | if (sbavail(&so->so_snd)) { | ||||
rack->r_wanted_output = 1; | rack->r_wanted_output = 1; | ||||
} | } | ||||
return (1); | return (1); | ||||
} | } | ||||
/* | /* | ||||
* Return value of 1, the TCB is unlocked and most | * Return value of 1, the TCB is unlocked and most | ||||
▲ Show 20 Lines • Show All 5,826 Lines • Show Last 20 Lines |