aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_cubic.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-12-23 12:27:51 -0800
committerDavid S. Miller <davem@davemloft.net>2019-12-27 16:29:14 -0800
commit35821fc2b41c51161e503bade3630603668dd3af (patch)
treed140df406ebe3399e08eb0b9462807958ec87a35 /net/ipv4/tcp_cubic.c
parenttcp_cubic: optimize hystart_update() (diff)
downloadlinux-dev-35821fc2b41c51161e503bade3630603668dd3af.tar.xz
linux-dev-35821fc2b41c51161e503bade3630603668dd3af.zip
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 <edumazet@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/tcp_cubic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 297936033c33..5eff762acd7f 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -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++;