Page MenuHomeFreeBSD

D3858.id9282.diff
No OneTemporary

D3858.id9282.diff

Index: sys/netinet/tcp_input.c
===================================================================
--- sys/netinet/tcp_input.c
+++ sys/netinet/tcp_input.c
@@ -164,6 +164,19 @@
&VNET_NAME(tcp_do_initcwnd10), 0,
"Enable RFC 6928 (Increasing initial CWND to 10)");
+SYSCTL_NODE(_net_inet_tcp, OID_AUTO, nonstandard, CTLFLAG_RW, 0,
+ "Nonstandard TCP extensions");
+
+VNET_DEFINE(int, tcp_nonstandard_allowed) = 0;
+SYSCTL_INT(_net_inet_tcp_nonstandard, OID_AUTO, allowed, CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(tcp_nonstandard_allowed), 0,
+ "Allow nonstandard TCP extensions");
+
+VNET_DEFINE(int, tcp_nonstandard_initcwnd) = 0;
+SYSCTL_INT(_net_inet_tcp_nonstandard, OID_AUTO, initcwnd, CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(tcp_nonstandard_initcwnd), 0,
+ "Slow-start flight size (initial congestion window)");
+
VNET_DEFINE(int, tcp_do_rfc3465) = 1;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(tcp_do_rfc3465), 0,
@@ -361,6 +374,7 @@
* RFC5681 Section 3.1 specifies the default conservative values.
* RFC3390 specifies slightly more aggressive values.
* RFC6928 increases it to ten segments.
+ * Support for user specified value for initial flight size.
*
* If a SYN or SYN/ACK was lost and retransmitted, we have to
* reduce the initial CWND to one segment as congestion is likely
@@ -368,6 +382,9 @@
*/
if (tp->snd_cwnd == 1)
tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */
+ else if (V_tcp_nonstandard_allowed && V_tcp_nonstandard_initcwnd)
+ tp->snd_cwnd = min(V_tcp_nonstandard_initcwnd * tp->t_maxseg,
+ max(2 * tp->t_maxseg, V_tcp_nonstandard_initcwnd * 1460));
else if (V_tcp_do_initcwnd10)
tp->snd_cwnd = min(10 * tp->t_maxseg,
max(2 * tp->t_maxseg, 14600));
Index: sys/netinet/tcp_var.h
===================================================================
--- sys/netinet/tcp_var.h
+++ sys/netinet/tcp_var.h
@@ -611,6 +611,8 @@
VNET_DECLARE(int, tcp_delack_enabled);
VNET_DECLARE(int, tcp_do_rfc3390);
VNET_DECLARE(int, tcp_do_initcwnd10);
+VNET_DECLARE(int, tcp_nonstandard_allowed);
+VNET_DECLARE(int, tcp_nonstandard_initcwnd);
VNET_DECLARE(int, tcp_sendspace);
VNET_DECLARE(int, tcp_recvspace);
VNET_DECLARE(int, path_mtu_discovery);
@@ -623,6 +625,8 @@
#define V_tcp_delack_enabled VNET(tcp_delack_enabled)
#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390)
#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10)
+#define V_tcp_nonstandard_allowed VNET(tcp_nonstandard_allowed)
+#define V_tcp_nonstandard_initcwnd VNET(tcp_nonstandard_initcwnd)
#define V_tcp_sendspace VNET(tcp_sendspace)
#define V_tcp_recvspace VNET(tcp_recvspace)
#define V_path_mtu_discovery VNET(path_mtu_discovery)

File Metadata

Mime Type
text/plain
Expires
Tue, Jun 16, 1:52 PM (9 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33988768
Default Alt Text
D3858.id9282.diff (2 KB)

Event Timeline