-
Notifications
You must be signed in to change notification settings - Fork 679
Expand file tree
/
Copy path0003-ss-display-ecn_low-if-tcp_info-tcpi_options-TCPI_OPT.patch
More file actions
59 lines (53 loc) · 2.07 KB
/
0003-ss-display-ecn_low-if-tcp_info-tcpi_options-TCPI_OPT.patch
File metadata and controls
59 lines (53 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 107339d7f48c95ae8a7461150e143fc53b08fea9 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Sun, 23 Jul 2023 23:33:21 -0400
Subject: [PATCH] ss: display "ecn_low" if tcp_info tcpi_options
TCPI_OPT_ECN_LOW bit is set
Display "ecn_low" if the TCPI_OPT_ECN_LOW bit is set in the
tcpi_options field in tcp_info.
Signed-off-by: Neal Cardwell <ncardwell@google.com>
---
include/uapi/linux/tcp.h | 1 +
misc/ss.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 4ee5d7721c6f..238e95d7693c 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -170,6 +170,7 @@ enum tcp_fastopen_client_fail {
#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
+#define TCPI_OPT_ECN_LOW 64 /* Low-latency ECN configured at init */
/*
* Sender's congestion state indicating normal or abnormal situations
diff --git a/misc/ss.c b/misc/ss.c
index 5f413118f0dd..634285adb7d3 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -907,6 +907,7 @@ struct tcpstat {
bool has_sack_opt;
bool has_ecn_opt;
bool has_ecnseen_opt;
+ bool has_ecn_low_opt;
bool has_fastopen_opt;
bool has_wscale_opt;
bool app_limited;
@@ -2621,6 +2622,8 @@ static void tcp_stats_print(struct tcpstat *s)
out(" ecn");
if (s->has_ecnseen_opt)
out(" ecnseen");
+ if (s->has_ecn_low_opt)
+ out(" ecn_low");
if (s->has_fastopen_opt)
out(" fastopen");
if (s->cong_alg[0])
@@ -3134,6 +3137,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
s.has_sack_opt = TCPI_HAS_OPT(info, TCPI_OPT_SACK);
s.has_ecn_opt = TCPI_HAS_OPT(info, TCPI_OPT_ECN);
s.has_ecnseen_opt = TCPI_HAS_OPT(info, TCPI_OPT_ECN_SEEN);
+ s.has_ecn_low_opt = TCPI_HAS_OPT(info, TCPI_OPT_ECN_LOW);
s.has_fastopen_opt = TCPI_HAS_OPT(info, TCPI_OPT_SYN_DATA);
}
--
2.41.0.487.g6d72f3e995-goog