]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_cubic.c
[DCCP]: Wait for CCID
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_cubic.c
index 14224487b16ba4de368e5b341cbfb6ba5a159014..80bd084a9f9198d5b4c31f380ffcd5448a8390b0 100644 (file)
@@ -29,7 +29,7 @@
 static int fast_convergence __read_mostly = 1;
 static int max_increment __read_mostly = 16;
 static int beta __read_mostly = 819;   /* = 819/1024 (BICTCP_BETA_SCALE) */
-static int initial_ssthresh __read_mostly = 100;
+static int initial_ssthresh __read_mostly;
 static int bic_scale __read_mostly = 41;
 static int tcp_friendliness __read_mostly = 1;
 
@@ -246,38 +246,12 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
                ca->cnt = 1;
 }
 
-
-/* Keep track of minimum rtt */
-static inline void measure_delay(struct sock *sk)
-{
-       const struct tcp_sock *tp = tcp_sk(sk);
-       struct bictcp *ca = inet_csk_ca(sk);
-       u32 delay;
-
-       /* No time stamp */
-       if (!(tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) ||
-            /* Discard delay samples right after fast recovery */
-           (s32)(tcp_time_stamp - ca->epoch_start) < HZ)
-               return;
-
-       delay = (tcp_time_stamp - tp->rx_opt.rcv_tsecr)<<3;
-       if (delay == 0)
-               delay = 1;
-
-       /* first time call or link delay decreases */
-       if (ca->delay_min == 0 || ca->delay_min > delay)
-               ca->delay_min = delay;
-}
-
 static void bictcp_cong_avoid(struct sock *sk, u32 ack,
-                             u32 seq_rtt, u32 in_flight, int data_acked)
+                             u32 in_flight, int data_acked)
 {
        struct tcp_sock *tp = tcp_sk(sk);
        struct bictcp *ca = inet_csk_ca(sk);
 
-       if (data_acked)
-               measure_delay(sk);
-
        if (!tcp_is_cwnd_limited(sk, in_flight))
                return;
 
@@ -334,17 +308,33 @@ static void bictcp_state(struct sock *sk, u8 new_state)
 /* Track delayed acknowledgment ratio using sliding window
  * ratio = (15*ratio + sample) / 16
  */
-static void bictcp_acked(struct sock *sk, u32 cnt, ktime_t last)
+static void bictcp_acked(struct sock *sk, u32 cnt, s32 rtt_us)
 {
        const struct inet_connection_sock *icsk = inet_csk(sk);
+       struct bictcp *ca = inet_csk_ca(sk);
+       u32 delay;
 
-       if (cnt > 0 && icsk->icsk_ca_state == TCP_CA_Open) {
-               struct bictcp *ca = inet_csk_ca(sk);
+       if (icsk->icsk_ca_state == TCP_CA_Open) {
                cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT;
                ca->delayed_ack += cnt;
        }
-}
 
+       /* Some calls are for duplicates without timetamps */
+       if (rtt_us < 0)
+               return;
+
+       /* Discard delay samples right after fast recovery */
+       if ((s32)(tcp_time_stamp - ca->epoch_start) < HZ)
+               return;
+
+       delay = usecs_to_jiffies(rtt_us) << 3;
+       if (delay == 0)
+               delay = 1;
+
+       /* first time call or link delay decreases */
+       if (ca->delay_min == 0 || ca->delay_min > delay)
+               ca->delay_min = delay;
+}
 
 static struct tcp_congestion_ops cubictcp = {
        .init           = bictcp_init,