Skip to content

Commit 35821fc

Browse files
edumazetdavem330
authored andcommitted
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: Eric Dumazet <[email protected]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 473900a commit 35821fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv4/tcp_cubic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static inline void bictcp_hystart_reset(struct sock *sk)
133133

134134
ca->round_start = ca->last_ack = bictcp_clock();
135135
ca->end_seq = tp->snd_nxt;
136-
ca->curr_rtt = 0;
136+
ca->curr_rtt = ~0U;
137137
ca->sample_cnt = 0;
138138
}
139139

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

408408
ca->sample_cnt++;

0 commit comments

Comments
 (0)