Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/bbr.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 7,870 Lines • ▼ Show 20 Lines | if (tp->t_flags & TF_PREVVALID) { | ||||
if (tp->t_rxtshift == 1 && | if (tp->t_rxtshift == 1 && | ||||
(int)(ticks - tp->t_badrxtwin) < 0) | (int)(ticks - tp->t_badrxtwin) < 0) | ||||
bbr_cong_signal(tp, th, CC_RTO_ERR, NULL); | bbr_cong_signal(tp, th, CC_RTO_ERR, NULL); | ||||
} | } | ||||
SOCKBUF_LOCK(&so->so_snd); | SOCKBUF_LOCK(&so->so_snd); | ||||
acked_amount = min(acked, (int)sbavail(&so->so_snd)); | acked_amount = min(acked, (int)sbavail(&so->so_snd)); | ||||
tp->snd_wnd -= acked_amount; | tp->snd_wnd -= acked_amount; | ||||
mfree = sbcut_locked(&so->so_snd, acked_amount); | mfree = sbcut_locked(&so->so_snd, acked_amount); | ||||
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 (SEQ_GT(th->th_ack, tp->snd_una)) { | if (SEQ_GT(th->th_ack, tp->snd_una)) { | ||||
bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp)); | bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp)); | ||||
} | } | ||||
tp->snd_una = th->th_ack; | tp->snd_una = th->th_ack; | ||||
bbr_ack_received(tp, bbr, th, acked, sack_changed, prev_acked, __LINE__, (bbr->r_ctl.rc_lost - lost)); | bbr_ack_received(tp, bbr, th, acked, sack_changed, prev_acked, __LINE__, (bbr->r_ctl.rc_lost - lost)); | ||||
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) && | ||||
▲ Show 20 Lines • Show All 906 Lines • ▼ Show 20 Lines | #endif | ||||
*/ | */ | ||||
#ifdef TCPDEBUG | #ifdef TCPDEBUG | ||||
if (so->so_options & SO_DEBUG) | if (so->so_options & SO_DEBUG) | ||||
tcp_trace(TA_INPUT, ostate, tp, | tcp_trace(TA_INPUT, ostate, tp, | ||||
(void *)tcp_saveipgen, | (void *)tcp_saveipgen, | ||||
&tcp_savetcp, 0); | &tcp_savetcp, 0); | ||||
#endif | #endif | ||||
/* 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 (tp->snd_una == tp->snd_max) { | if (tp->snd_una == tp->snd_max) { | ||||
/* Nothing left outstanding */ | /* Nothing left outstanding */ | ||||
bbr_log_progress_event(bbr, tp, ticks, PROGRESS_CLEAR, __LINE__); | bbr_log_progress_event(bbr, tp, ticks, PROGRESS_CLEAR, __LINE__); | ||||
if (sbavail(&tp->t_inpcb->inp_socket->so_snd) == 0) | if (sbavail(&tp->t_inpcb->inp_socket->so_snd) == 0) | ||||
bbr->rc_tp->t_acktime = 0; | bbr->rc_tp->t_acktime = 0; | ||||
bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); | bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); | ||||
if (bbr->rc_in_persist == 0) { | if (bbr->rc_in_persist == 0) { | ||||
bbr->r_ctl.rc_went_idle_time = bbr->r_ctl.rc_rcvtime; | bbr->r_ctl.rc_went_idle_time = bbr->r_ctl.rc_rcvtime; | ||||
▲ Show 20 Lines • Show All 6,171 Lines • Show Last 20 Lines |