diff options
author | Eric Dumazet <edumazet@google.com> | 2023-10-20 14:57:38 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-23 10:35:00 +0200 |
commit | 99d679556d737a14391c68e562d94076c2983252 (patch) | |
tree | 4555e11a5056c5dd365bd872dc16a7c1a6b52cf4 /include/net/tcp.h | |
parent | tcp: fix cookie_init_timestamp() overflows (diff) | |
download | linux-99d679556d737a14391c68e562d94076c2983252.tar.xz linux-99d679556d737a14391c68e562d94076c2983252.zip |
tcp: add tcp_time_stamp_ms() helper
In preparation of adding usec TCP TS values, add tcp_time_stamp_ms()
for contexts needing ms based values.
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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index d47a57a47b50..9fc6dc4ba9e2 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -804,6 +804,11 @@ static inline u32 tcp_time_stamp(const struct tcp_sock *tp) return div_u64(tp->tcp_mstamp, USEC_PER_SEC / TCP_TS_HZ); } +static inline u32 tcp_time_stamp_ms(const struct tcp_sock *tp) +{ + return div_u64(tp->tcp_mstamp, USEC_PER_MSEC); +} + /* Convert a nsec timestamp into TCP TSval timestamp (ms based currently) */ static inline u64 tcp_ns_to_ts(u64 ns) { |