netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: report ECN_SEEN in tcp_info
@ 2011-09-30  4:44 Eric Dumazet
  2011-09-30 16:29 ` Stephen Hemminger
  2011-10-03 18:01 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2011-09-30  4:44 UTC (permalink / raw)
  To: David Miller, Stephen Hemminger; +Cc: netdev

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 negociated 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>
---
Stephen are you planning to provide an alternative git tree for
iproute2 ? Thanks !

 include/linux/tcp.h |    3 ++-
 net/ipv4/tcp.c      |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 6b63b31..7f59ee9 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -111,7 +111,8 @@ 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		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 {
 	TCP_CA_Open = 0,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 131c45f..4c0da24 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)
 		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;
+	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_ato = jiffies_to_usecs(icsk->icsk_ack.ato);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tcp: report ECN_SEEN in tcp_info
  2011-09-30  4:44 [PATCH net-next] tcp: report ECN_SEEN in tcp_info Eric Dumazet
@ 2011-09-30 16:29 ` Stephen Hemminger
  2011-10-03 18:01 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2011-09-30 16:29 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev

On Fri, 30 Sep 2011 06:44:57 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Stephen are you planning to provide an alternative git tree for
> iproute2 ? Thanks !

It is on github for now.
  
  git clone git://github.com/shemminger/iproute2.git

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tcp: report ECN_SEEN in tcp_info
  2011-09-30  4:44 [PATCH net-next] tcp: report ECN_SEEN in tcp_info Eric Dumazet
  2011-09-30 16:29 ` Stephen Hemminger
@ 2011-10-03 18:01 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2011-10-03 18:01 UTC (permalink / raw)
  To: eric.dumazet; +Cc: shemminger, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 30 Sep 2011 06:44:57 +0200

> 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 negociated 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>

Applied, thanks Eric.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-03 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30  4:44 [PATCH net-next] tcp: report ECN_SEEN in tcp_info Eric Dumazet
2011-09-30 16:29 ` Stephen Hemminger
2011-10-03 18:01 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).