aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-03 14:01:21 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-03 14:01:21 -0400
commitb5c5693bb723a019deac3cd1345f3e7233c8a67e (patch)
treee5136c3e7a6efee0453f2012882e0d95eed7672d
parent0654011d900670884197d9a06ad17b378dfde831 (diff)
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: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/tcp.h3
-rw-r--r--net/ipv4/tcp.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 6b63b310af36..7f59ee946983 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -111,7 +111,8 @@ enum {
111#define TCPI_OPT_TIMESTAMPS 1 111#define TCPI_OPT_TIMESTAMPS 1
112#define TCPI_OPT_SACK 2 112#define TCPI_OPT_SACK 2
113#define TCPI_OPT_WSCALE 4 113#define TCPI_OPT_WSCALE 4
114#define TCPI_OPT_ECN 8 114#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
115#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
115 116
116enum tcp_ca_state { 117enum tcp_ca_state {
117 TCP_CA_Open = 0, 118 TCP_CA_Open = 0,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 131c45f93373..4c0da24fb649 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2455,8 +2455,10 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
2455 info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale; 2455 info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale;
2456 } 2456 }
2457 2457
2458 if (tp->ecn_flags&TCP_ECN_OK) 2458 if (tp->ecn_flags & TCP_ECN_OK)
2459 info->tcpi_options |= TCPI_OPT_ECN; 2459 info->tcpi_options |= TCPI_OPT_ECN;
2460 if (tp->ecn_flags & TCP_ECN_SEEN)
2461 info->tcpi_options |= TCPI_OPT_ECN_SEEN;
2460 2462
2461 info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto); 2463 info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto);
2462 info->tcpi_ato = jiffies_to_usecs(icsk->icsk_ack.ato); 2464 info->tcpi_ato = jiffies_to_usecs(icsk->icsk_ack.ato);