|
@@ -76,12 +76,11 @@ static u32 htcp_cwnd_undo(struct sock *sk)
|
|
return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta);
|
|
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 inet_connection_sock *icsk = inet_csk(sk);
|
|
const struct tcp_sock *tp = tcp_sk(sk);
|
|
const struct tcp_sock *tp = tcp_sk(sk);
|
|
struct htcp *ca = inet_csk_ca(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 */
|
|
/* keep track of minimum RTT seen so far, minRTT is zero at first */
|
|
if (ca->minRTT > srtt || !ca->minRTT)
|
|
if (ca->minRTT > srtt || !ca->minRTT)
|
|
@@ -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)
|
|
if (icsk->icsk_ca_state == TCP_CA_Open)
|
|
ca->pkts_acked = pkts_acked;
|
|
ca->pkts_acked = pkts_acked;
|
|
|
|
|
|
|
|
+ if (rtt > 0)
|
|
|
|
+ measure_rtt(sk, usecs_to_jiffies(rtt));
|
|
|
|
+
|
|
if (!use_bandwidth_switch)
|
|
if (!use_bandwidth_switch)
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -237,8 +239,6 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack,
|
|
if (tp->snd_cwnd <= tp->snd_ssthresh)
|
|
if (tp->snd_cwnd <= tp->snd_ssthresh)
|
|
tcp_slow_start(tp);
|
|
tcp_slow_start(tp);
|
|
else {
|
|
else {
|
|
- measure_rtt(sk);
|
|
|
|
-
|
|
|
|
/* In dangerous area, increase slowly.
|
|
/* In dangerous area, increase slowly.
|
|
* In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd
|
|
* In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd
|
|
*/
|
|
*/
|