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; | static int sysctl_net_inet_tcp_rfc6675pipe(SYSCTL_HANDLER_ARGS); | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675_pipe, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rfc6675_pipe, | ||||
&VNET_NAME(tcp_do_rfc6675_pipe), 0, | CTLTYPE_STRING | CTLFLAG_SKIP | CTLFLAG_VNET | CTLFLAG_RD | CTLFLAG_MPSAFE, | ||||
"Use calculated pipe/in-flight bytes per RFC 6675"); | 0, 0, sysctl_net_inet_tcp_rfc6675pipe, "A", | ||||
"Deprecated: 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, | ||||
▲ Show 20 Lines • Show All 2,400 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) | ||||
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 94 Lines • ▼ Show 20 Lines | else { | ||||
/* Per RFC5681 Section 3.1 */ | /* Per RFC5681 Section 3.1 */ | ||||
if (maxseg > 2190) | if (maxseg > 2190) | ||||
return (2 * maxseg); | return (2 * maxseg); | ||||
else if (maxseg > 1095) | else if (maxseg > 1095) | ||||
return (3 * maxseg); | return (3 * maxseg); | ||||
else | else | ||||
return (4 * maxseg); | return (4 * maxseg); | ||||
} | } | ||||
} | |||||
static int | |||||
sysctl_net_inet_tcp_rfc6675pipe(SYSCTL_HANDLER_ARGS) | |||||
{ | |||||
char sb[120] = {}; | |||||
char *p = (char *)&sb; | |||||
int error; | |||||
error = snprintf(p, sizeof(p), "%d\n" | |||||
"Use of net.inet.tcp.rfc6675_pipe is deprecated.\n" | |||||
"Please use net.inet.tcp.sack.revised instead.", | |||||
V_tcp_do_newsack); | |||||
if (error > 0) | |||||
error = SYSCTL_OUT(req, p, strlen(p)); | |||||
return(error); | |||||
} | } |
This hunk fails too