summaryrefslogtreecommitdiff
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-10-20 12:57:39 +0000
committerDavid S. Miller <davem@davemloft.net>2023-10-23 09:35:01 +0100
commit2a7c8d291ffeba69a47d8528987156f625cc05b0 (patch)
treebb760ce96938f5f494a1455b31f04b291617d520 /include/net/tcp.h
parent99d679556d737a14391c68e562d94076c2983252 (diff)
tcp: introduce tcp_clock_ms()
It delivers current TCP time stamp in ms unit, and is used in place of confusing tcp_time_stamp_raw() It is the same family than tcp_clock_ns() and tcp_clock_ms(). tcp_time_stamp_raw() will be replaced later for TSval contexts with a more descriptive name. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 9fc6dc4ba9e2..3bdf1141f5a2 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -798,6 +798,11 @@ static inline u64 tcp_clock_us(void)
return div_u64(tcp_clock_ns(), NSEC_PER_USEC);
}
+static inline u64 tcp_clock_ms(void)
+{
+ return div_u64(tcp_clock_ns(), NSEC_PER_MSEC);
+}
+
/* This should only be used in contexts where tp->tcp_mstamp is up to date */
static inline u32 tcp_time_stamp(const struct tcp_sock *tp)
{