tcp: cdg: use tcp high resolution clock cache
authorEric Dumazet <edumazet@google.com>
Mon, 15 Oct 2018 16:37:58 +0000 (09:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 05:56:42 +0000 (22:56 -0700)
We store in tcp socket a cache of most recent high resolution
clock, there is no need to call local_clock() again, since
this cache is good enough.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_cdg.c

index 06fbe102a425f28b43294925d8d13af4a13ec776..37eebd9103961be4731323cfb4d933b51954e802 100644 (file)
@@ -146,7 +146,7 @@ static void tcp_cdg_hystart_update(struct sock *sk)
                return;
 
        if (hystart_detect & HYSTART_ACK_TRAIN) {
-               u32 now_us = div_u64(local_clock(), NSEC_PER_USEC);
+               u32 now_us = tp->tcp_mstamp;
 
                if (ca->last_ack == 0 || !tcp_is_cwnd_limited(sk)) {
                        ca->last_ack = now_us;