On Tue, Mar 4, 2014 at 7:38 PM, Lawrence Stewart <lstew...@freebsd.org> wrote:
<skip>

> I lost the battle of wills on this topic and 10.0 shipped with IW10
> enabled by default :(
>
> As for having it configurable, it is a trivial patch which perhaps,
> Hiren, you might be willing to take a stab at? I obviously did not
> manage to carve out the time last year to push forward with the agenda I
> proposed in this thread, but I will get back to it at some point.

Hi Lawrence,

Let's fix it the right way if possible.

Below is a rough/untested quick patch I came up with. Is this how you
were planning to have "nonstandard" sysctl knob designed?

Index: sys/netinet/tcp_input.c
===================================================================
--- sys/netinet/tcp_input.c     (revision 260833)
+++ sys/netinet/tcp_input.c     (working copy)
@@ -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_VNET_INT(_net_inet_tcp_nonstandard, OID_AUTO, allowed, CTLFLAG_RW,
+    &VNET_NAME(tcp_nonstandard_allowed), 0,
+    "Allow nonstandard TCP extensions");
+
+VNET_DEFINE(int, tcp_nonstandard_initcwnd) = 0;
+SYSCTL_VNET_INT(_net_inet_tcp_nonstandard, OID_AUTO, initcwnd, CTLFLAG_RW,
+    &VNET_NAME(tcp_nonstandard_initcwnd), 0,
+    "Slow-start flight size (initial congestion window)");
+
 VNET_DEFINE(int, tcp_do_rfc3465) = 1;
 SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW,
     &VNET_NAME(tcp_do_rfc3465), 0,
@@ -368,6 +381,8 @@
         */
        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 = V_tcp_nonstandard_initcwnd * tp->t_maxseg;
        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       (revision 260833)
+++ sys/netinet/tcp_var.h       (working copy)
@@ -610,6 +610,7 @@
 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);
@@ -622,6 +623,7 @@
 #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)
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to