]> err.no Git - linux-2.6/commitdiff
[DCCP] CCID2: Initialize ssthresh to infinity
authorAndrea Bittau <a.bittau@cs.ucl.ac.uk>
Tue, 19 Sep 2006 20:07:20 +0000 (13:07 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:19:11 +0000 (15:19 -0700)
Initialize the slow-start threshold to infinity.  This way, upon connection
initiation, slow-start will be exited only upon a packet loss.  This patch will
allow connections to quickly gain speed.

Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/ccids/ccid2.c
net/dccp/ccids/ccid2.h

index 54a6b7ef3b7b38249e79eaeaf71519462d415cf5..699a56674659b400e3df1c3395b3896aeb51b7f9 100644 (file)
@@ -678,9 +678,12 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
        int seqcount = ccid2_seq_len;
        int i;
 
-       /* XXX init variables with proper values */
        hctx->ccid2hctx_cwnd      = 1;
-       hctx->ccid2hctx_ssthresh  = 10;
+       /* Initialize ssthresh to infinity.  This means that we will exit the
+        * initial slow-start after the first packet loss.  This is what we
+        * want.
+        */
+       hctx->ccid2hctx_ssthresh  = ~0;
        hctx->ccid2hctx_numdupack = 3;
 
        /* XXX init ~ to window size... */
index 451a87464fa5d1c3ca12adc0c074e965dc4001bd..b4cc6c0bf020f4521c9ce9d09fe364029168609c 100644 (file)
@@ -50,7 +50,7 @@ struct ccid2_hc_tx_sock {
        int                     ccid2hctx_cwnd;
        int                     ccid2hctx_ssacks;
        int                     ccid2hctx_acks;
-       int                     ccid2hctx_ssthresh;
+       unsigned int            ccid2hctx_ssthresh;
        int                     ccid2hctx_pipe;
        int                     ccid2hctx_numdupack;
        struct ccid2_seq        *ccid2hctx_seqbuf;