Commit 35821fc2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp_cubic: remove one conditional from hystart_update()



If we initialize ca->curr_rtt to ~0U, we do not need to test
for zero value in hystart_update()

We only read ca->curr_rtt if at least HYSTART_MIN_SAMPLES have
been processed, and thus ca->curr_rtt will have a sane value.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 473900a5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ static inline void bictcp_hystart_reset(struct sock *sk)

	ca->round_start = ca->last_ack = bictcp_clock();
	ca->end_seq = tp->snd_nxt;
	ca->curr_rtt = 0;
	ca->curr_rtt = ~0U;
	ca->sample_cnt = 0;
}

@@ -402,7 +402,7 @@ static void hystart_update(struct sock *sk, u32 delay)
	if (hystart_detect & HYSTART_DELAY) {
		/* obtain the minimum delay of more than sampling packets */
		if (ca->sample_cnt < HYSTART_MIN_SAMPLES) {
			if (ca->curr_rtt == 0 || ca->curr_rtt > delay)
			if (ca->curr_rtt > delay)
				ca->curr_rtt = delay;

			ca->sample_cnt++;