Index: sys/netinet/cc/cc_cubic.c =================================================================== --- sys/netinet/cc/cc_cubic.c +++ sys/netinet/cc/cc_cubic.c @@ -317,7 +317,7 @@ * * XXXLAS: Find a way to do this without needing curack */ - if (V_tcp_do_rfc6675_pipe) + if (V_tcp_do_rfc6675) pipe = tcp_compute_pipe(ccv->ccvc.tcp); else pipe = CCV(ccv, snd_max) - ccv->curack; Index: sys/netinet/cc/cc_htcp.c =================================================================== --- sys/netinet/cc/cc_htcp.c +++ sys/netinet/cc/cc_htcp.c @@ -360,7 +360,7 @@ * * XXXLAS: Find a way to do this without needing curack */ - if (V_tcp_do_rfc6675_pipe) + if (V_tcp_do_rfc6675) pipe = tcp_compute_pipe(ccv->ccvc.tcp); else pipe = CCV(ccv, snd_max) - ccv->curack; Index: sys/netinet/cc/cc_newreno.c =================================================================== --- sys/netinet/cc/cc_newreno.c +++ sys/netinet/cc/cc_newreno.c @@ -227,7 +227,7 @@ * * XXXLAS: Find a way to do this without needing curack */ - if (V_tcp_do_rfc6675_pipe) + if (V_tcp_do_rfc6675) pipe = tcp_compute_pipe(ccv->ccvc.tcp); else pipe = CCV(ccv, snd_max) - ccv->curack; Index: sys/netinet/tcp_input.c =================================================================== --- sys/netinet/tcp_input.c +++ sys/netinet/tcp_input.c @@ -152,10 +152,10 @@ &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); -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_rfc6675) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_do_rfc6675), 0, + "Enable (partial) RFC 6675 support for pipe, cwnd and ssthresh calculations"); VNET_DEFINE(int, tcp_do_rfc3042) = 1; #define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) @@ -2582,7 +2582,7 @@ * we have less than 1/2 the original window's * worth of data in flight. */ - if (V_tcp_do_rfc6675_pipe) + if (V_tcp_do_rfc6675) awnd = tcp_compute_pipe(tp); else awnd = (tp->snd_nxt - tp->snd_fack) + @@ -2628,7 +2628,18 @@ TCPSTAT_INC( tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; - tp->snd_cwnd = maxseg; + /* + * As per RFC6675, + * ssthresh = cwnd = pipe / 2 + */ + if (V_tcp_do_rfc6675) { + int pipe; + pipe = tcp_compute_pipe(tp); + tp->snd_ssthresh = + tp->snd_cwnd = pipe / 2; + } else + tp->snd_cwnd = maxseg; + (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } Index: sys/netinet/tcp_stacks/fastpath.c =================================================================== --- sys/netinet/tcp_stacks/fastpath.c +++ sys/netinet/tcp_stacks/fastpath.c @@ -1097,7 +1097,7 @@ * we have less than 1/2 the original window's * worth of data in flight. */ - if (V_tcp_do_rfc6675_pipe) + if (V_tcp_do_rfc6675) awnd = tcp_compute_pipe(tp); else awnd = (tp->snd_nxt - tp->snd_fack) + @@ -1143,7 +1143,17 @@ TCPSTAT_INC( tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; - tp->snd_cwnd = tp->t_maxseg; + /* + * As per RFC6675, + * ssthresh = cwnd = pipe / 2 + */ + if (V_tcp_do_rfc6675) { + int pipe; + pipe = tcp_compute_pipe(tp); + tp->snd_ssthresh = + tp->snd_cwnd = pipe / 2; + } else + tp->snd_cwnd = tp->t_maxseg; (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } Index: sys/netinet/tcp_var.h =================================================================== --- sys/netinet/tcp_var.h +++ sys/netinet/tcp_var.h @@ -739,8 +739,8 @@ VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) -VNET_DECLARE(int, tcp_do_rfc6675_pipe); -#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) +VNET_DECLARE(int, tcp_do_rfc6675); +#define V_tcp_do_rfc6675 VNET(tcp_do_rfc6675) int tcp_addoptions(struct tcpopt *, u_char *); int tcp_ccalgounload(struct cc_algo *unload_algo);