Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63390
b: refs/heads/master
c: 113bbbd
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jul 31, 2007
1 parent 58ce7e7 commit 8bf0864
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: e7d0c88586a66cf03e70750a8119d984fdedf2aa
refs/heads/master: 113bbbd8d2da61b50417a1dd06d8e7c19047e54b
8 changes: 4 additions & 4 deletions trunk/net/ipv4/tcp_htcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ static u32 htcp_cwnd_undo(struct sock *sk)
return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta);
}

static inline void measure_rtt(struct sock *sk)
static inline void measure_rtt(struct sock *sk, u32 srtt)
{
const struct inet_connection_sock *icsk = inet_csk(sk);
const struct tcp_sock *tp = tcp_sk(sk);
struct htcp *ca = inet_csk_ca(sk);
u32 srtt = tp->srtt >> 3;

/* keep track of minimum RTT seen so far, minRTT is zero at first */
if (ca->minRTT > srtt || !ca->minRTT)
Expand All @@ -108,6 +107,9 @@ static void measure_achieved_throughput(struct sock *sk, u32 pkts_acked, s32 rtt
if (icsk->icsk_ca_state == TCP_CA_Open)
ca->pkts_acked = pkts_acked;

if (rtt > 0)
measure_rtt(sk, usecs_to_jiffies(rtt));

if (!use_bandwidth_switch)
return;

Expand Down Expand Up @@ -237,8 +239,6 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack,
if (tp->snd_cwnd <= tp->snd_ssthresh)
tcp_slow_start(tp);
else {
measure_rtt(sk);

/* In dangerous area, increase slowly.
* In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd
*/
Expand Down

0 comments on commit 8bf0864

Please sign in to comment.