Commit b5c5693b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: report ECN_SEEN in tcp_info

Allows ss command (iproute2) to display "ecnseen" if at least one packet
with ECT(0) or ECT(1) or ECN was received by this socket.

"ecn" means ECN was negotiated at session establishment (TCP level)

"ecnseen" means we received at least one packet with ECT fields set (IP
level)

ss -i
...
ESTAB      0      0   192.168.20.110:22  192.168.20.144:38016
ino:5950 sk:f178e400
	 mem:(r0,w0,f0,t0) ts sack ecn ecnseen bic wscale:7,8 rto:210
rtt:12.5/7.5 cwnd:10 send 9.3Mbps rcv_space:14480
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0654011d
...@@ -111,7 +111,8 @@ enum { ...@@ -111,7 +111,8 @@ enum {
#define TCPI_OPT_TIMESTAMPS 1 #define TCPI_OPT_TIMESTAMPS 1
#define TCPI_OPT_SACK 2 #define TCPI_OPT_SACK 2
#define TCPI_OPT_WSCALE 4 #define TCPI_OPT_WSCALE 4
#define TCPI_OPT_ECN 8 #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 */
enum tcp_ca_state { enum tcp_ca_state {
TCP_CA_Open = 0, TCP_CA_Open = 0,
......
...@@ -2455,8 +2455,10 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info) ...@@ -2455,8 +2455,10 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale; info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale;
} }
if (tp->ecn_flags&TCP_ECN_OK) if (tp->ecn_flags & TCP_ECN_OK)
info->tcpi_options |= TCPI_OPT_ECN; info->tcpi_options |= TCPI_OPT_ECN;
if (tp->ecn_flags & TCP_ECN_SEEN)
info->tcpi_options |= TCPI_OPT_ECN_SEEN;
info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto); info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto);
info->tcpi_ato = jiffies_to_usecs(icsk->icsk_ack.ato); info->tcpi_ato = jiffies_to_usecs(icsk->icsk_ack.ato);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment