[PATCH 1/7] tcp: LRO timestamps have lost their previous precision

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
From: Randall Stewart <[email protected]>

Recently we had a rewrite to tcp_lro.c that was tested but one subtle change
was the move to a less precise timestamp. This causes all kinds of chaos
in tcp's that do pacing and needs to be fixed to use the more precise
time that was there before.

Reviewed by: mtuexen, gallatin, hselasky
Sponsored by: Netflix Inc
Differential Revision:	https://reviews.freebsd.org/D30695
---
 newlib/libc/include/sys/time.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h
index 5a3dec7ab..4062df728 100644
--- a/newlib/libc/include/sys/time.h
+++ b/newlib/libc/include/sys/time.h
@@ -281,6 +281,17 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts)
 	    (uint32_t)(_bt->frac >> 32)) >> 32;
 }
 
+static __inline uint64_t
+bintime2ns(const struct bintime *_bt)
+{
+	uint64_t ret;
+
+	ret = (uint64_t)(_bt->sec) * (uint64_t)1000000000;
+	ret += (((uint64_t)1000000000 *
+		 (uint32_t)(_bt->frac >> 32)) >> 32);
+	return (ret);
+}
+
 static __inline void
 timespec2bintime(const struct timespec *_ts, struct bintime *_bt)
 {
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.