|
Michal Kubecek |
2b346f |
From: Eric Dumazet <edumazet@google.com>
|
|
Michal Kubecek |
2b346f |
Date: Tue, 16 May 2017 14:00:01 -0700
|
|
Michal Kubecek |
2b346f |
Subject: tcp: introduce tcp_jiffies32
|
|
Michal Kubecek |
2b346f |
Patch-mainline: v4.13-rc1
|
|
Michal Kubecek |
2b346f |
Git-commit: ec66eda82d4b0c552bf40005d8f53b63b2b07de4
|
|
Michal Kubecek |
2b346f |
References: bsc#1061739
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
We abuse tcp_time_stamp for two different cases :
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
1) base to generate TCP Timestamp options (RFC 7323)
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
2) A 32bit version of jiffies since some TCP fields
|
|
Michal Kubecek |
2b346f |
are 32bit wide to save memory.
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
Since we want in the future to have 1ms TCP TS clock,
|
|
Michal Kubecek |
2b346f |
regardless of HZ value, we want to cleanup things.
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
tcp_jiffies32 is the truncated jiffies value,
|
|
Michal Kubecek |
2b346f |
which will be used only in places where we want a 'host'
|
|
Michal Kubecek |
2b346f |
timestamp.
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
Signed-off-by: Eric Dumazet <edumazet@google.com>
|
|
Michal Kubecek |
2b346f |
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
|
|
Michal Kubecek |
2b346f |
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Michal Kubecek |
2b346f |
Acked-by: Michal Kubecek <mkubecek@suse.cz>
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
---
|
|
Michal Kubecek |
2b346f |
include/net/tcp.h | 13 ++++++++-----
|
|
Michal Kubecek |
2b346f |
1 file changed, 8 insertions(+), 5 deletions(-)
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
diff --git a/include/net/tcp.h b/include/net/tcp.h
|
|
Michal Kubecek |
2b346f |
index 3dd09e0f68ee..297a2123cabf 100644
|
|
Michal Kubecek |
2b346f |
--- a/include/net/tcp.h
|
|
Michal Kubecek |
2b346f |
+++ b/include/net/tcp.h
|
|
Michal Kubecek |
2b346f |
@@ -699,11 +699,14 @@ u32 __tcp_select_window(struct sock *sk);
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
void tcp_send_window_probe(struct sock *sk);
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
-/* TCP timestamps are only 32-bits, this causes a slight
|
|
Michal Kubecek |
2b346f |
- * complication on 64-bit systems since we store a snapshot
|
|
Michal Kubecek |
2b346f |
- * of jiffies in the buffer control blocks below. We decided
|
|
Michal Kubecek |
2b346f |
- * to use only the low 32-bits of jiffies and hide the ugly
|
|
Michal Kubecek |
2b346f |
- * casts with the following macro.
|
|
Michal Kubecek |
2b346f |
+/* TCP uses 32bit jiffies to save some space.
|
|
Michal Kubecek |
2b346f |
+ * Note that this is different from tcp_time_stamp, which
|
|
Michal Kubecek |
2b346f |
+ * historically has been the same until linux-4.13.
|
|
Michal Kubecek |
2b346f |
+ */
|
|
Michal Kubecek |
2b346f |
+#define tcp_jiffies32 ((u32)jiffies)
|
|
Michal Kubecek |
2b346f |
+
|
|
Michal Kubecek |
2b346f |
+/* Generator for TCP TS option (RFC 7323)
|
|
Michal Kubecek |
2b346f |
+ * Currently tied to 'jiffies' but will soon be driven by 1 ms clock.
|
|
Michal Kubecek |
2b346f |
*/
|
|
Michal Kubecek |
2b346f |
#define tcp_time_stamp ((__u32)(jiffies))
|
|
Michal Kubecek |
2b346f |
|
|
Michal Kubecek |
2b346f |
--
|
|
Michal Kubecek |
2b346f |
2.15.1
|
|
Michal Kubecek |
2b346f |
|