Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63419
b: refs/heads/master
c: 1e757f9
h: refs/heads/master
i:
  63417: f115342
  63415: 749c45b
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Jul 31, 2007
1 parent 75af806 commit 7aef772
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 143cf35324548df54563b19d0444e0fe170027f8
refs/heads/master: 1e757f9996114f713a79d3fbcd08739efcfc5c34
21 changes: 12 additions & 9 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,19 +1851,22 @@ static inline u32 tcp_cwnd_min(const struct sock *sk)
}

/* Decrease cwnd each second ack. */
static void tcp_cwnd_down(struct sock *sk)
static void tcp_cwnd_down(struct sock *sk, int flag)
{
struct tcp_sock *tp = tcp_sk(sk);
int decr = tp->snd_cwnd_cnt + 1;

tp->snd_cwnd_cnt = decr&1;
decr >>= 1;
if ((flag&FLAG_FORWARD_PROGRESS) ||
(IsReno(tp) && !(flag&FLAG_NOT_DUP))) {
tp->snd_cwnd_cnt = decr&1;
decr >>= 1;

if (decr && tp->snd_cwnd > tcp_cwnd_min(sk))
tp->snd_cwnd -= decr;
if (decr && tp->snd_cwnd > tcp_cwnd_min(sk))
tp->snd_cwnd -= decr;

tp->snd_cwnd = min(tp->snd_cwnd, tcp_packets_in_flight(tp)+1);
tp->snd_cwnd_stamp = tcp_time_stamp;
tp->snd_cwnd = min(tp->snd_cwnd, tcp_packets_in_flight(tp)+1);
tp->snd_cwnd_stamp = tcp_time_stamp;
}
}

/* Nothing was retransmitted or returned timestamp is less
Expand Down Expand Up @@ -2060,7 +2063,7 @@ static void tcp_try_to_open(struct sock *sk, int flag)
}
tcp_moderate_cwnd(tp);
} else {
tcp_cwnd_down(sk);
tcp_cwnd_down(sk, flag);
}
}

Expand Down Expand Up @@ -2260,7 +2263,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,

if (is_dupack || tcp_head_timedout(sk))
tcp_update_scoreboard(sk);
tcp_cwnd_down(sk);
tcp_cwnd_down(sk, flag);
tcp_xmit_retransmit_queue(sk);
}

Expand Down

0 comments on commit 7aef772

Please sign in to comment.