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 9,391 Lines • ▼ Show 20 Lines | if (!IN_FASTRECOVERY(rack->rc_tp->t_flags) && | ||||
rack_handle_might_revert(rack->rc_tp, rack); | rack_handle_might_revert(rack->rc_tp, rack); | ||||
rack->r_might_revert = 0; | rack->r_might_revert = 0; | ||||
rack->r_ctl.retran_during_recovery = 0; | rack->r_ctl.retran_during_recovery = 0; | ||||
rack->r_ctl.dsack_byte_cnt = 0; | rack->r_ctl.dsack_byte_cnt = 0; | ||||
} | } | ||||
return (was_tlp); | return (was_tlp); | ||||
} | } | ||||
static uint32_t | |||||
do_rack_compute_pipe(struct tcpcb *tp, struct tcp_rack *rack, uint32_t snd_una) | |||||
{ | |||||
return (((tp->snd_max - snd_una) - rack->r_ctl.rc_sacked) + rack->r_ctl.rc_holes_rxt); | |||||
} | |||||
static int32_t | |||||
rack_compute_pipe(struct tcpcb *tp) | |||||
{ | |||||
return ((int32_t)do_rack_compute_pipe(tp, | |||||
(struct tcp_rack *)tp->t_fb_ptr, | |||||
tp->snd_una)); | |||||
} | |||||
static void | static void | ||||
rack_update_prr(struct tcpcb *tp, struct tcp_rack *rack, uint32_t changed, tcp_seq th_ack) | rack_update_prr(struct tcpcb *tp, struct tcp_rack *rack, uint32_t changed, tcp_seq th_ack) | ||||
{ | { | ||||
/* Deal with changed and PRR here (in recovery only) */ | /* Deal with changed and PRR here (in recovery only) */ | ||||
uint32_t pipe, snd_una; | uint32_t pipe, snd_una; | ||||
rack->r_ctl.rc_prr_delivered += changed; | rack->r_ctl.rc_prr_delivered += changed; | ||||
if (sbavail(&rack->rc_inp->inp_socket->so_snd) <= (tp->snd_max - tp->snd_una)) { | if (sbavail(&rack->rc_inp->inp_socket->so_snd) <= (tp->snd_max - tp->snd_una)) { | ||||
/* | /* | ||||
* It is all outstanding, we are application limited | * It is all outstanding, we are application limited | ||||
* and thus we don't need more room to send anything. | * and thus we don't need more room to send anything. | ||||
* Note we use tp->snd_una here and not th_ack because | * Note we use tp->snd_una here and not th_ack because | ||||
* the data as yet not been cut from the sb. | * the data as yet not been cut from the sb. | ||||
*/ | */ | ||||
rack->r_ctl.rc_prr_sndcnt = 0; | rack->r_ctl.rc_prr_sndcnt = 0; | ||||
return; | return; | ||||
} | } | ||||
/* Compute prr_sndcnt */ | /* Compute prr_sndcnt */ | ||||
if (SEQ_GT(tp->snd_una, th_ack)) { | if (SEQ_GT(tp->snd_una, th_ack)) { | ||||
snd_una = tp->snd_una; | snd_una = tp->snd_una; | ||||
} else { | } else { | ||||
snd_una = th_ack; | snd_una = th_ack; | ||||
} | } | ||||
pipe = ((tp->snd_max - snd_una) - rack->r_ctl.rc_sacked) + rack->r_ctl.rc_holes_rxt; | pipe = do_rack_compute_pipe(tp, rack, snd_una); | ||||
if (pipe > tp->snd_ssthresh) { | if (pipe > tp->snd_ssthresh) { | ||||
long sndcnt; | long sndcnt; | ||||
sndcnt = rack->r_ctl.rc_prr_delivered * tp->snd_ssthresh; | sndcnt = rack->r_ctl.rc_prr_delivered * tp->snd_ssthresh; | ||||
if (rack->r_ctl.rc_prr_recovery_fs > 0) | if (rack->r_ctl.rc_prr_recovery_fs > 0) | ||||
sndcnt /= (long)rack->r_ctl.rc_prr_recovery_fs; | sndcnt /= (long)rack->r_ctl.rc_prr_recovery_fs; | ||||
else { | else { | ||||
rack->r_ctl.rc_prr_sndcnt = 0; | rack->r_ctl.rc_prr_sndcnt = 0; | ||||
▲ Show 20 Lines • Show All 10,879 Lines • ▼ Show 20 Lines | static struct tcp_function_block __tcp_rack = { | ||||
.tfb_tcp_timer_activate = rack_timer_activate, | .tfb_tcp_timer_activate = rack_timer_activate, | ||||
.tfb_tcp_timer_active = rack_timer_active, | .tfb_tcp_timer_active = rack_timer_active, | ||||
.tfb_tcp_timer_stop = rack_timer_stop, | .tfb_tcp_timer_stop = rack_timer_stop, | ||||
.tfb_tcp_rexmit_tmr = rack_remxt_tmr, | .tfb_tcp_rexmit_tmr = rack_remxt_tmr, | ||||
.tfb_tcp_handoff_ok = rack_handoff_ok, | .tfb_tcp_handoff_ok = rack_handoff_ok, | ||||
.tfb_tcp_mtu_chg = rack_mtu_change, | .tfb_tcp_mtu_chg = rack_mtu_change, | ||||
.tfb_pru_options = rack_pru_options, | .tfb_pru_options = rack_pru_options, | ||||
.tfb_hwtls_change = rack_hw_tls_change, | .tfb_hwtls_change = rack_hw_tls_change, | ||||
.tfb_compute_pipe = rack_compute_pipe, | |||||
.tfb_flags = TCP_FUNC_OUTPUT_CANDROP, | .tfb_flags = TCP_FUNC_OUTPUT_CANDROP, | ||||
}; | }; | ||||
/* | /* | ||||
* rack_ctloutput() must drop the inpcb lock before performing copyin on | * rack_ctloutput() must drop the inpcb lock before performing copyin on | ||||
* socket option arguments. When it re-acquires the lock after the copy, it | * socket option arguments. When it re-acquires the lock after the copy, it | ||||
* has to revalidate that the connection is still valid for the socket | * has to revalidate that the connection is still valid for the socket | ||||
* option. | * option. | ||||
▲ Show 20 Lines • Show All 615 Lines • Show Last 20 Lines |