Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_prr, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_prr), 1, | &VNET_NAME(tcp_do_prr), 1, | ||||
"Enable Proportional Rate Reduction per RFC 6937"); | "Enable Proportional Rate Reduction per RFC 6937"); | ||||
VNET_DEFINE(int, tcp_do_newcwv) = 0; | VNET_DEFINE(int, tcp_do_newcwv) = 0; | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, newcwv, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, newcwv, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_newcwv), 0, | &VNET_NAME(tcp_do_newcwv), 0, | ||||
"Enable New Congestion Window Validation per RFC7661"); | "Enable New Congestion Window Validation per RFC7661"); | ||||
VNET_DEFINE(int, tcp_do_rfc6675_pipe) = 0; | |||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675_pipe, CTLFLAG_VNET | CTLFLAG_RW, | |||||
&VNET_NAME(tcp_do_rfc6675_pipe), 0, | |||||
"Use calculated pipe/in-flight bytes per RFC 6675"); | |||||
VNET_DEFINE(int, tcp_do_rfc3042) = 1; | VNET_DEFINE(int, tcp_do_rfc3042) = 1; | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_rfc3042), 0, | &VNET_NAME(tcp_do_rfc3042), 0, | ||||
"Enable RFC 3042 (Limited Transmit)"); | "Enable RFC 3042 (Limited Transmit)"); | ||||
VNET_DEFINE(int, tcp_do_rfc3390) = 1; | VNET_DEFINE(int, tcp_do_rfc3390) = 1; | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_do_rfc3390), 0, | &VNET_NAME(tcp_do_rfc3390), 0, | ||||
▲ Show 20 Lines • Show All 2,406 Lines • ▼ Show 20 Lines | if (SEQ_LEQ(th->th_ack, tp->snd_una)) { | ||||
int awnd; | int awnd; | ||||
/* | /* | ||||
* Compute the amount of data in flight first. | * Compute the amount of data in flight first. | ||||
* We can inject new data into the pipe iff | * We can inject new data into the pipe iff | ||||
* we have less than 1/2 the original window's | * we have less than 1/2 the original window's | ||||
* worth of data in flight. | * worth of data in flight. | ||||
*/ | */ | ||||
if (V_tcp_do_rfc6675_pipe) | if (V_tcp_do_newsack) | ||||
awnd = tcp_compute_pipe(tp); | awnd = tcp_compute_pipe(tp); | ||||
else | else | ||||
awnd = (tp->snd_nxt - tp->snd_fack) + | awnd = (tp->snd_nxt - tp->snd_fack) + | ||||
tp->sackhint.sack_bytes_rexmit; | tp->sackhint.sack_bytes_rexmit; | ||||
if (awnd < tp->snd_ssthresh) { | if (awnd < tp->snd_ssthresh) { | ||||
tp->snd_cwnd += maxseg; | tp->snd_cwnd += maxseg; | ||||
if (tp->snd_cwnd > tp->snd_ssthresh) | if (tp->snd_cwnd > tp->snd_ssthresh) | ||||
tp->snd_cwnd = tp->snd_ssthresh; | tp->snd_cwnd = tp->snd_ssthresh; | ||||
} | } | ||||
} else | } else | ||||
tp->snd_cwnd += maxseg; | tp->snd_cwnd += maxseg; | ||||
(void) tp->t_fb->tfb_tcp_output(tp); | (void) tp->t_fb->tfb_tcp_output(tp); | ||||
goto drop; | goto drop; | ||||
} else if (tp->t_dupacks == tcprexmtthresh || | } else if (tp->t_dupacks == tcprexmtthresh || | ||||
(tp->t_flags & TF_SACK_PERMIT && | (tp->t_flags & TF_SACK_PERMIT && | ||||
V_tcp_do_rfc6675_pipe && | V_tcp_do_newsack && | ||||
kbowling: This hunk fails too | |||||
tp->sackhint.sacked_bytes > | tp->sackhint.sacked_bytes > | ||||
(tcprexmtthresh - 1) * maxseg)) { | (tcprexmtthresh - 1) * maxseg)) { | ||||
enter_recovery: | enter_recovery: | ||||
/* | /* | ||||
* Above is the RFC6675 trigger condition of | * Above is the RFC6675 trigger condition of | ||||
* more than (dupthresh-1)*maxseg sacked data. | * more than (dupthresh-1)*maxseg sacked data. | ||||
* If the count of holes in the | * If the count of holes in the | ||||
* scoreboard is >= dupthresh, we could | * scoreboard is >= dupthresh, we could | ||||
▲ Show 20 Lines • Show All 1,311 Lines • ▼ Show 20 Lines | tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
/* | /* | ||||
* Compute the amount of data that this ACK is indicating | * Compute the amount of data that this ACK is indicating | ||||
* (del_data) and an estimate of how many bytes are in the | * (del_data) and an estimate of how many bytes are in the | ||||
* network. | * network. | ||||
*/ | */ | ||||
del_data = tp->sackhint.delivered_data; | del_data = tp->sackhint.delivered_data; | ||||
if (V_tcp_do_rfc6675_pipe) | if (V_tcp_do_newsack) | ||||
pipe = tcp_compute_pipe(tp); | pipe = tcp_compute_pipe(tp); | ||||
else | else | ||||
pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; | pipe = (tp->snd_nxt - tp->snd_fack) + tp->sackhint.sack_bytes_rexmit; | ||||
tp->sackhint.prr_delivered += del_data; | tp->sackhint.prr_delivered += del_data; | ||||
/* | /* | ||||
* Proportional Rate Reduction | * Proportional Rate Reduction | ||||
*/ | */ | ||||
if (pipe >= tp->snd_ssthresh) { | if (pipe >= tp->snd_ssthresh) { | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |
This hunk fails too