diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_htcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c index fa61663ace3b..b66556c0a5bd 100644 --- a/net/ipv4/tcp_htcp.c +++ b/net/ipv4/tcp_htcp.c | |||
@@ -76,12 +76,11 @@ static u32 htcp_cwnd_undo(struct sock *sk) | |||
76 | return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta); | 76 | return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta); |
77 | } | 77 | } |
78 | 78 | ||
79 | static inline void measure_rtt(struct sock *sk) | 79 | static inline void measure_rtt(struct sock *sk, u32 srtt) |
80 | { | 80 | { |
81 | const struct inet_connection_sock *icsk = inet_csk(sk); | 81 | const struct inet_connection_sock *icsk = inet_csk(sk); |
82 | const struct tcp_sock *tp = tcp_sk(sk); | 82 | const struct tcp_sock *tp = tcp_sk(sk); |
83 | struct htcp *ca = inet_csk_ca(sk); | 83 | struct htcp *ca = inet_csk_ca(sk); |
84 | u32 srtt = tp->srtt >> 3; | ||
85 | 84 | ||
86 | /* keep track of minimum RTT seen so far, minRTT is zero at first */ | 85 | /* keep track of minimum RTT seen so far, minRTT is zero at first */ |
87 | if (ca->minRTT > srtt || !ca->minRTT) | 86 | if (ca->minRTT > srtt || !ca->minRTT) |
@@ -108,6 +107,9 @@ static void measure_achieved_throughput(struct sock *sk, u32 pkts_acked, s32 rtt | |||
108 | if (icsk->icsk_ca_state == TCP_CA_Open) | 107 | if (icsk->icsk_ca_state == TCP_CA_Open) |
109 | ca->pkts_acked = pkts_acked; | 108 | ca->pkts_acked = pkts_acked; |
110 | 109 | ||
110 | if (rtt > 0) | ||
111 | measure_rtt(sk, usecs_to_jiffies(rtt)); | ||
112 | |||
111 | if (!use_bandwidth_switch) | 113 | if (!use_bandwidth_switch) |
112 | return; | 114 | return; |
113 | 115 | ||
@@ -237,8 +239,6 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack, | |||
237 | if (tp->snd_cwnd <= tp->snd_ssthresh) | 239 | if (tp->snd_cwnd <= tp->snd_ssthresh) |
238 | tcp_slow_start(tp); | 240 | tcp_slow_start(tp); |
239 | else { | 241 | else { |
240 | measure_rtt(sk); | ||
241 | |||
242 | /* In dangerous area, increase slowly. | 242 | /* In dangerous area, increase slowly. |
243 | * In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd | 243 | * In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd |
244 | */ | 244 | */ |