tcp: stretch ACK fixes in Veno prep
authorPengcheng Yang <yangpc@wangsu.com>
Mon, 16 Mar 2020 06:35:09 +0000 (14:35 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Mar 2020 01:26:55 +0000 (18:26 -0700)
No code logic has been changed in this patch.

Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_veno.c

index 3b36bb1..857491c 100644 (file)
@@ -153,31 +153,33 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
                veno->diff = (tp->snd_cwnd << V_PARAM_SHIFT) - target_cwnd;
 
                if (tcp_in_slow_start(tp)) {
-                       /* Slow start.  */
+                       /* Slow start. */
                        tcp_slow_start(tp, acked);
+                       goto done;
+               }
+
+               /* Congestion avoidance. */
+               if (veno->diff < beta) {
+                       /* In the "non-congestive state", increase cwnd
+                        * every rtt.
+                        */
+                       tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1);
                } else {
-                       /* Congestion avoidance. */
-                       if (veno->diff < beta) {
-                               /* In the "non-congestive state", increase cwnd
-                                *  every rtt.
-                                */
-                               tcp_cong_avoid_ai(tp, tp->snd_cwnd, 1);
-                       } else {
-                               /* In the "congestive state", increase cwnd
-                                * every other rtt.
-                                */
-                               if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
-                                       if (veno->inc &&
-                                           tp->snd_cwnd < tp->snd_cwnd_clamp) {
-                                               tp->snd_cwnd++;
-                                               veno->inc = 0;
-                                       } else
-                                               veno->inc = 1;
-                                       tp->snd_cwnd_cnt = 0;
+                       /* In the "congestive state", increase cwnd
+                        * every other rtt.
+                        */
+                       if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
+                               if (veno->inc &&
+                                   tp->snd_cwnd < tp->snd_cwnd_clamp) {
+                                       tp->snd_cwnd++;
+                                       veno->inc = 0;
                                } else
-                                       tp->snd_cwnd_cnt++;
-                       }
+                                       veno->inc = 1;
+                               tp->snd_cwnd_cnt = 0;
+                       } else
+                               tp->snd_cwnd_cnt++;
                }
+done:
                if (tp->snd_cwnd < 2)
                        tp->snd_cwnd = 2;
                else if (tp->snd_cwnd > tp->snd_cwnd_clamp)