Skip to contentSkip to conversation

ss: add fastopen support

PATCH In review Eric Dumazet 4 participants 6 messages Mar 29, 2013 – May 4, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ss: add fastopen support

From: Eric Dumazet <[email protected]>

ss -i can output "fastopen" attribute if socket used Fast Open

---
 include/netinet/tcp.h |    5 +++--
 misc/ss.c             |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
include/netinet/tcp.h +3 -2
index 3f890a1..ba79c63 100644
@@ -171,8 +171,9 @@ enum
 # define TCPI_OPT_TIMESTAMPS	1
 # define TCPI_OPT_SACK		2
 # define TCPI_OPT_WSCALE	4
-# define TCPI_OPT_ECN		8
-# define TCPI_OPT_ECN_SEEN	16
+# 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 */
 
 /* Values for tcpi_state.  */
 enum tcp_ca_state
misc/ss.c +2 -0
index da9d32c..b7bcd80 100644
@@ -1392,6 +1392,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r)
 				printf(" ecn");
 			if (info->tcpi_options & TCPI_OPT_ECN_SEEN)
 				printf(" ecnseen");
+			if (info->tcpi_options & TCPI_OPT_SYN_DATA)
+				printf(" fastopen");
 		}
 
 		if (tb[INET_DIAG_CONG])
#3 lore raw
Quoted 4 lines · Yuchung Cheng
Quoted 3 lines · David Miller

From: Eric Dumazet <[email protected]>
Date: Fri, 29 Mar 2013 13:51:57 -0700

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

From: Eric Dumazet <[email protected]>

ss -i can output "fastopen" attribute if socket used Fast Open

Oh well, it seems this patch got lost.

Stephen, tell me if you want me to resend it, thanks !

#4 lore raw
In reply to Eric Dumazet
Quoted 6 lines · On Fri, 29 Mar 2013 13:51:57 -0700 Eric Dumazet <[email protected]> wrote:

From: Eric Dumazet <[email protected]>

ss -i can output "fastopen" attribute if socket used Fast Open

Ok, but the header stuff needs work.

The headers from iproute2 come from the kernel sanitized headers (ie make headers_install) The only definition of TCPI_OPT_ECN_SEEN in those headers is in <linux/tcp.h> I will tweak the ss to use linux/tcp.h

#5 lore raw
Quoted 5 lines · Stephen Hemminger

Ok, but the header stuff needs work.

The headers from iproute2 come from the kernel sanitized headers (ie make headers_install) The only definition of TCPI_OPT_ECN_SEEN in those headers is in <linux/tcp.h> I will tweak the ss to use linux/tcp.h

Thanks, this seems good to me.