David S. Miller wrote:

From: [EMAIL PROTECTED]
Date: Thu, 10 Nov 2005 15:15:11 -0800

Move all the code that does linear TCP slowstart to one
inline function to ease later patch to add ABC support.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Applied, but one question about this hunk.

--- net-2.6.orig/net/ipv4/tcp_scalable.c
+++ net-2.6/net/ipv4/tcp_scalable.c
@@ -24,17 +24,16 @@ static void tcp_scalable_cong_avoid(stru
        if (!tcp_is_cwnd_limited(sk, in_flight))
                return;

-       if (tp->snd_cwnd <= tp->snd_ssthresh) {
-               tp->snd_cwnd++;
-       } else {
+       if (tp->snd_cwnd <= tp->snd_ssthresh)
+               tcp_slow_start(tp);
+       else {
                tp->snd_cwnd_cnt++;
                if (tp->snd_cwnd_cnt > min(tp->snd_cwnd, TCP_SCALABLE_AI_CNT)){
-                       tp->snd_cwnd++;
+                       if (tp->snd_cwnd < tp->snd_cwnd_clamp)
+                               tp->snd_cwnd++;
                        tp->snd_cwnd_cnt = 0;
                }
        }
-       tp->snd_cwnd = min_t(u32, tp->snd_cwnd, tp->snd_cwnd_clamp);
-       tp->snd_cwnd_stamp = tcp_time_stamp;
}

static u32 tcp_scalable_ssthresh(struct sock *sk)

Are you sure that removing those last two lines are correct?
Maybe this code is trying to influence the congestion window
validation engine by updating snd_cwnd_stamp like that.  And
are we sure that the snd_cwnd is always going to be clamped
properly with the min_t() line removed?  If so, maybe it's
better to BUG() check it, or use WARN_ON().
cwnd_stamp is always updated by tcp_cong_avoid (the caller)
so the extra assignment was redundant

cwnd is already limited by clamp in the slow_start and the
increment code so the min() was redundant

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to