netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
@ 2007-09-10 23:13 Rick Jones
  2007-09-11  0:39 ` Sridhar Samudrala
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Jones @ 2007-09-10 23:13 UTC (permalink / raw)
  To: netdev

Return some useful information such as the maximum listen backlog and
the current listen backlog in the tcp_info structure and have that 
match what one can see in /proc/net/tcp and /proc/net/tcp6.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
---

diff -r bdcdd0e1ee9d Documentation/networking/proc_net_tcp.txt
--- a/Documentation/networking/proc_net_tcp.txt	Sat Sep 01 07:00:31 2007 +0000
+++ b/Documentation/networking/proc_net_tcp.txt	Mon Sep 10 16:09:46 2007 -0700
@@ -20,8 +20,8 @@ up into 3 parts because of the length of
       |        |     |     |       |--> number of unrecovered RTO timeouts
       |        |     |     |----------> number of jiffies until timer expires
       |        |     |----------------> timer_active (see below)
-      |        |----------------------> receive-queue
-      |-------------------------------> transmit-queue
+      |        |----------------------> receive-queue or connection backlog
+      |-------------------------------> transmit-queue or connection limit
 
    1000        0 54165785 4 cd1e6040 25 4 27 3 -1
     |          |    |     |    |     |  | |  | |--> slow start size threshold, 
diff -r bdcdd0e1ee9d net/ipv4/tcp.c
--- a/net/ipv4/tcp.c	Sat Sep 01 07:00:31 2007 +0000
+++ b/net/ipv4/tcp.c	Mon Sep 10 16:09:46 2007 -0700
@@ -2030,8 +2030,14 @@ void tcp_get_info(struct sock *sk, struc
 	info->tcpi_snd_mss = tp->mss_cache;
 	info->tcpi_rcv_mss = icsk->icsk_ack.rcv_mss;
 
-	info->tcpi_unacked = tp->packets_out;
-	info->tcpi_sacked = tp->sacked_out;
+	if (sk->sk_state == TCP_LISTEN) {
+		info->tcpi_unacked = sk->sk_ack_backlog;
+		info->tcpi_sacked = sk->sk_max_ack_backlog;
+	}
+	else {
+		info->tcpi_unacked = tp->packets_out;
+		info->tcpi_sacked = tp->sacked_out;
+	}
 	info->tcpi_lost = tp->lost_out;
 	info->tcpi_retrans = tp->retrans_out;
 	info->tcpi_fackets = tp->fackets_out;
diff -r bdcdd0e1ee9d net/ipv4/tcp_ipv4.c
--- a/net/ipv4/tcp_ipv4.c	Sat Sep 01 07:00:31 2007 +0000
+++ b/net/ipv4/tcp_ipv4.c	Mon Sep 10 16:09:46 2007 -0700
@@ -2320,7 +2320,8 @@ static void get_tcp4_sock(struct sock *s
 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
 			"%08X %5d %8d %lu %d %p %u %u %u %u %d",
 		i, src, srcp, dest, destp, sk->sk_state,
-		tp->write_seq - tp->snd_una,
+		sk->sk_state == TCP_LISTEN ? sk->sk_max_ack_backlog :
+					     (tp->write_seq - tp->snd_una),
 		sk->sk_state == TCP_LISTEN ? sk->sk_ack_backlog :
 					     (tp->rcv_nxt - tp->copied_seq),
 		timer_active,
diff -r bdcdd0e1ee9d net/ipv6/tcp_ipv6.c
--- a/net/ipv6/tcp_ipv6.c	Sat Sep 01 07:00:31 2007 +0000
+++ b/net/ipv6/tcp_ipv6.c	Mon Sep 10 16:09:46 2007 -0700
@@ -2005,8 +2005,10 @@ static void get_tcp6_sock(struct seq_fil
 		   dest->s6_addr32[0], dest->s6_addr32[1],
 		   dest->s6_addr32[2], dest->s6_addr32[3], destp,
 		   sp->sk_state,
-		   tp->write_seq-tp->snd_una,
-		   (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : (tp->rcv_nxt - tp->copied_seq),
+		   (sp->sk_state == TCP_LISTEN) ? sp->sk_max_ack_backlog:
+						  tp->write_seq-tp->snd_una,
+		   (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : 
+					(tp->rcv_nxt - tp->copied_seq),
 		   timer_active,
 		   jiffies_to_clock_t(timer_expires - jiffies),
 		   icsk->icsk_retransmits,

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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-10 23:13 [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info Rick Jones
@ 2007-09-11  0:39 ` Sridhar Samudrala
  2007-09-11  6:09   ` Eric Dumazet
  0 siblings, 1 reply; 9+ messages in thread
From: Sridhar Samudrala @ 2007-09-11  0:39 UTC (permalink / raw)
  To: Rick Jones; +Cc: netdev

On Mon, 2007-09-10 at 16:13 -0700, Rick Jones wrote:
> Return some useful information such as the maximum listen backlog and
> the current listen backlog in the tcp_info structure and have that 
> match what one can see in /proc/net/tcp and /proc/net/tcp6.

If we are also exporting max listen backlog, another place to
consider adding this is to tcp_diag_get_info() called via INET_DIAG_INFO.
Current listen backlog is returned in inet_diag_msg->idiag_rqueue.
max listen backlog can be returned in inet_diag_msg->idiag_wqueue.

Thanks
Sridhar
> 
> Signed-off-by: Rick Jones <rick.jones2@hp.com>
> ---
> 
> diff -r bdcdd0e1ee9d Documentation/networking/proc_net_tcp.txt
> --- a/Documentation/networking/proc_net_tcp.txt	Sat Sep 01 07:00:31 2007 +0000
> +++ b/Documentation/networking/proc_net_tcp.txt	Mon Sep 10 16:09:46 2007 -0700
> @@ -20,8 +20,8 @@ up into 3 parts because of the length of
>        |        |     |     |       |--> number of unrecovered RTO timeouts
>        |        |     |     |----------> number of jiffies until timer expires
>        |        |     |----------------> timer_active (see below)
> -      |        |----------------------> receive-queue
> -      |-------------------------------> transmit-queue
> +      |        |----------------------> receive-queue or connection backlog
> +      |-------------------------------> transmit-queue or connection limit
> 
>     1000        0 54165785 4 cd1e6040 25 4 27 3 -1
>      |          |    |     |    |     |  | |  | |--> slow start size threshold, 
> diff -r bdcdd0e1ee9d net/ipv4/tcp.c
> --- a/net/ipv4/tcp.c	Sat Sep 01 07:00:31 2007 +0000
> +++ b/net/ipv4/tcp.c	Mon Sep 10 16:09:46 2007 -0700
> @@ -2030,8 +2030,14 @@ void tcp_get_info(struct sock *sk, struc
>  	info->tcpi_snd_mss = tp->mss_cache;
>  	info->tcpi_rcv_mss = icsk->icsk_ack.rcv_mss;
> 
> -	info->tcpi_unacked = tp->packets_out;
> -	info->tcpi_sacked = tp->sacked_out;
> +	if (sk->sk_state == TCP_LISTEN) {
> +		info->tcpi_unacked = sk->sk_ack_backlog;
> +		info->tcpi_sacked = sk->sk_max_ack_backlog;
> +	}
> +	else {
> +		info->tcpi_unacked = tp->packets_out;
> +		info->tcpi_sacked = tp->sacked_out;
> +	}
>  	info->tcpi_lost = tp->lost_out;
>  	info->tcpi_retrans = tp->retrans_out;
>  	info->tcpi_fackets = tp->fackets_out;
> diff -r bdcdd0e1ee9d net/ipv4/tcp_ipv4.c
> --- a/net/ipv4/tcp_ipv4.c	Sat Sep 01 07:00:31 2007 +0000
> +++ b/net/ipv4/tcp_ipv4.c	Mon Sep 10 16:09:46 2007 -0700
> @@ -2320,7 +2320,8 @@ static void get_tcp4_sock(struct sock *s
>  	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
>  			"%08X %5d %8d %lu %d %p %u %u %u %u %d",
>  		i, src, srcp, dest, destp, sk->sk_state,
> -		tp->write_seq - tp->snd_una,
> +		sk->sk_state == TCP_LISTEN ? sk->sk_max_ack_backlog :
> +					     (tp->write_seq - tp->snd_una),
>  		sk->sk_state == TCP_LISTEN ? sk->sk_ack_backlog :
>  					     (tp->rcv_nxt - tp->copied_seq),
>  		timer_active,
> diff -r bdcdd0e1ee9d net/ipv6/tcp_ipv6.c
> --- a/net/ipv6/tcp_ipv6.c	Sat Sep 01 07:00:31 2007 +0000
> +++ b/net/ipv6/tcp_ipv6.c	Mon Sep 10 16:09:46 2007 -0700
> @@ -2005,8 +2005,10 @@ static void get_tcp6_sock(struct seq_fil
>  		   dest->s6_addr32[0], dest->s6_addr32[1],
>  		   dest->s6_addr32[2], dest->s6_addr32[3], destp,
>  		   sp->sk_state,
> -		   tp->write_seq-tp->snd_una,
> -		   (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : (tp->rcv_nxt - tp->copied_seq),
> +		   (sp->sk_state == TCP_LISTEN) ? sp->sk_max_ack_backlog:
> +						  tp->write_seq-tp->snd_una,
> +		   (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : 
> +					(tp->rcv_nxt - tp->copied_seq),
>  		   timer_active,
>  		   jiffies_to_clock_t(timer_expires - jiffies),
>  		   icsk->icsk_retransmits,
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11  0:39 ` Sridhar Samudrala
@ 2007-09-11  6:09   ` Eric Dumazet
  2007-09-11  6:54     ` Eric Dumazet
  2007-09-11 17:00     ` Rick Jones
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Dumazet @ 2007-09-11  6:09 UTC (permalink / raw)
  To: Sridhar Samudrala, Rick Jones; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

Sridhar Samudrala a écrit :
> On Mon, 2007-09-10 at 16:13 -0700, Rick Jones wrote:
>> Return some useful information such as the maximum listen backlog and
>> the current listen backlog in the tcp_info structure and have that 
>> match what one can see in /proc/net/tcp and /proc/net/tcp6.
> 
> If we are also exporting max listen backlog, another place to
> consider adding this is to tcp_diag_get_info() called via INET_DIAG_INFO.
> Current listen backlog is returned in inet_diag_msg->idiag_rqueue.
> max listen backlog can be returned in inet_diag_msg->idiag_wqueue.
> 

I agree, /proc/net/tcp is deprecated nowadays...

Rick, could you add this part in your patch, and add my Sign-off-by ?

Thank you
Eric




[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 682 bytes --]

diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 57c5f0b..f5b6275 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -25,11 +25,13 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
 	const struct tcp_sock *tp = tcp_sk(sk);
 	struct tcp_info *info = _info;
 
-	if (sk->sk_state == TCP_LISTEN)
+	if (sk->sk_state == TCP_LISTEN) {
 		r->idiag_rqueue = sk->sk_ack_backlog;
-	else
+		r->idiag_wqueue = sk->sk_max_ack_backlog;
+	else {
 		r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq;
-	r->idiag_wqueue = tp->write_seq - tp->snd_una;
+		r->idiag_wqueue = tp->write_seq - tp->snd_una;
+	}
 	if (info != NULL)
 		tcp_get_info(sk, info);
 }

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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11  6:09   ` Eric Dumazet
@ 2007-09-11  6:54     ` Eric Dumazet
  2007-09-11 17:00     ` Rick Jones
  1 sibling, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2007-09-11  6:54 UTC (permalink / raw)
  To: Rick Jones; +Cc: Sridhar Samudrala, netdev

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

Eric Dumazet a écrit :
> Sridhar Samudrala a écrit :
>> On Mon, 2007-09-10 at 16:13 -0700, Rick Jones wrote:
>>> Return some useful information such as the maximum listen backlog and
>>> the current listen backlog in the tcp_info structure and have that 
>>> match what one can see in /proc/net/tcp and /proc/net/tcp6.
>>
>> If we are also exporting max listen backlog, another place to
>> consider adding this is to tcp_diag_get_info() called via INET_DIAG_INFO.
>> Current listen backlog is returned in inet_diag_msg->idiag_rqueue.
>> max listen backlog can be returned in inet_diag_msg->idiag_wqueue.
>>
> 
> I agree, /proc/net/tcp is deprecated nowadays...
> 
> Rick, could you add this part in your patch, and add my Sign-off-by ?
> 
> Thank you
> Eric

One } was missing, sorry


[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 684 bytes --]

diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 57c5f0b..f5b6275 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -25,11 +25,13 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
 	const struct tcp_sock *tp = tcp_sk(sk);
 	struct tcp_info *info = _info;
 
-	if (sk->sk_state == TCP_LISTEN)
+	if (sk->sk_state == TCP_LISTEN) {
 		r->idiag_rqueue = sk->sk_ack_backlog;
-	else
+		r->idiag_wqueue = sk->sk_max_ack_backlog;
+	} else {
 		r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq;
-	r->idiag_wqueue = tp->write_seq - tp->snd_una;
+		r->idiag_wqueue = tp->write_seq - tp->snd_una;
+	}
 	if (info != NULL)
 		tcp_get_info(sk, info);
 }

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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11  6:09   ` Eric Dumazet
  2007-09-11  6:54     ` Eric Dumazet
@ 2007-09-11 17:00     ` Rick Jones
  2007-09-11 17:15       ` Eric Dumazet
  1 sibling, 1 reply; 9+ messages in thread
From: Rick Jones @ 2007-09-11 17:00 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Sridhar Samudrala, netdev

Eric Dumazet wrote:
> Sridhar Samudrala a écrit :
> 
>> On Mon, 2007-09-10 at 16:13 -0700, Rick Jones wrote:
>>
>>> Return some useful information such as the maximum listen backlog and
>>> the current listen backlog in the tcp_info structure and have that 
>>> match what one can see in /proc/net/tcp and /proc/net/tcp6.
>>
>>
>> If we are also exporting max listen backlog, another place to
>> consider adding this is to tcp_diag_get_info() called via INET_DIAG_INFO.
>> Current listen backlog is returned in inet_diag_msg->idiag_rqueue.
>> max listen backlog can be returned in inet_diag_msg->idiag_wqueue.
>>
> 
> I agree, /proc/net/tcp is deprecated nowadays...

What takes its place?

> Rick, could you add this part in your patch, and add my Sign-off-by ?

My pleasure.

I have a small test program for the tcp_info bit - where do I go to find 
how the inet diag stuff works?

BTW, what do people think about doing the same thing with the rxqueue 
and txqueue's of netstat output?

rick jones

> 
> Thank you
> Eric
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
> index 57c5f0b..f5b6275 100644
> --- a/net/ipv4/tcp_diag.c
> +++ b/net/ipv4/tcp_diag.c
> @@ -25,11 +25,13 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
>  	const struct tcp_sock *tp = tcp_sk(sk);
>  	struct tcp_info *info = _info;
>  
> -	if (sk->sk_state == TCP_LISTEN)
> +	if (sk->sk_state == TCP_LISTEN) {
>  		r->idiag_rqueue = sk->sk_ack_backlog;
> -	else
> +		r->idiag_wqueue = sk->sk_max_ack_backlog;
> +	else {
>  		r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq;
> -	r->idiag_wqueue = tp->write_seq - tp->snd_una;
> +		r->idiag_wqueue = tp->write_seq - tp->snd_una;
> +	}
>  	if (info != NULL)
>  		tcp_get_info(sk, info);
>  }


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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11 17:00     ` Rick Jones
@ 2007-09-11 17:15       ` Eric Dumazet
  2007-09-11 17:35         ` Rick Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2007-09-11 17:15 UTC (permalink / raw)
  To: Rick Jones; +Cc: Sridhar Samudrala, netdev

On Tue, 11 Sep 2007 10:00:21 -0700
Rick Jones <rick.jones2@hp.com> wrote:

> Eric Dumazet wrote:
> > Sridhar Samudrala a écrit :
> > 
> >> On Mon, 2007-09-10 at 16:13 -0700, Rick Jones wrote:
> >>
> >>> Return some useful information such as the maximum listen backlog and
> >>> the current listen backlog in the tcp_info structure and have that 
> >>> match what one can see in /proc/net/tcp and /proc/net/tcp6.
> >>
> >>
> >> If we are also exporting max listen backlog, another place to
> >> consider adding this is to tcp_diag_get_info() called via INET_DIAG_INFO.
> >> Current listen backlog is returned in inet_diag_msg->idiag_rqueue.
> >> max listen backlog can be returned in inet_diag_msg->idiag_wqueue.
> >>
> > 
> > I agree, /proc/net/tcp is deprecated nowadays...
> 
> What takes its place?

ss command from iproute2 package ( http://linux-net.osdl.org/index.php/Iproute2 )

Problem with /proc/net/tcp is its quadratic time O(N^2) to output N lines...

On a loaded server :

# time ss|wc -l
 145695

real    0m9.383s
user    0m4.656s
sys     0m0.632s

# time netstat -an|wc -l
^C after some minutes .... no way...
real    3m23.825s
user    0m0.744s
sys     3m18.721s


> 
> > Rick, could you add this part in your patch, and add my Sign-off-by ?
> 
> My pleasure.
> 
> I have a small test program for the tcp_info bit - where do I go to find 
> how the inet diag stuff works?

ss state listen

> 
> BTW, what do people think about doing the same thing with the rxqueue 
> and txqueue's of netstat output?
>

I dont understand this question, I thought your patch already handled this 
(for the txqueue, since rxqueue is already there),  as netstat uses 
/proc/net/tcp (unfortunatly)


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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11 17:15       ` Eric Dumazet
@ 2007-09-11 17:35         ` Rick Jones
  2007-09-11 17:46           ` Sridhar Samudrala
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Jones @ 2007-09-11 17:35 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Sridhar Samudrala, netdev

> ss command from iproute2 package ( http://linux-net.osdl.org/index.php/Iproute2 )
> 
> Problem with /proc/net/tcp is its quadratic time O(N^2) to output N lines...

I could see where that might be a problem.

>>>Rick, could you add this part in your patch, and add my Sign-off-by ?
>>
>>My pleasure.
>>
>>I have a small test program for the tcp_info bit - where do I go to find 
>>how the inet diag stuff works?
> 
> 
> ss state listen

hpcpc103:~# ss --version
ss utility, iproute2-ss070313
hpcpc103:~# ss state listen
ss: no socket states to show with such filter.
hpcpc103:~# ss --all
State      Recv-Q Send-Q      Local Address:Port          Peer 
Address:Port
LISTEN     0      128                     *:sunrpc                   *:* 

LISTEN     0      128                     *:auth                     *:* 

LISTEN     0      128                    :::ssh                     :::* 

LISTEN     0      20              127.0.0.1:smtp                     *:* 

LISTEN     0      128                     *:42137                    *:* 


> 
> 
>>BTW, what do people think about doing the same thing with the rxqueue 
>>and txqueue's of netstat output?
>>
> 
> 
> I dont understand this question, I thought your patch already handled this 
> (for the txqueue, since rxqueue is already there),  as netstat uses 
> /proc/net/tcp (unfortunatly)

Well, it doesn't seem to be the case.  This is from the same system as 
the ss output above:

hpcpc103:~# netstat -an | grep LISTEN
tcp        0      0 0.0.0.0:111          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:113          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25         0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:42137        0.0.0.0:*               LISTEN
tcp6       0      0 :::22                :::*                    LISTEN
unix  2    [ ACC ]     STREAM   LISTENING   5666  /var/run/acpid.socket

I thought I saw some other code in there when I was stumbling around.

rick

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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11 17:35         ` Rick Jones
@ 2007-09-11 17:46           ` Sridhar Samudrala
  2007-09-11 18:10             ` Rick Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Sridhar Samudrala @ 2007-09-11 17:46 UTC (permalink / raw)
  To: Rick Jones; +Cc: Eric Dumazet, netdev

On Tue, 2007-09-11 at 10:35 -0700, Rick Jones wrote:
> > ss command from iproute2 package ( http://linux-net.osdl.org/index.php/Iproute2 )
> > 
> > Problem with /proc/net/tcp is its quadratic time O(N^2) to output N lines...
> 
> I could see where that might be a problem.
> 
> >>>Rick, could you add this part in your patch, and add my Sign-off-by ?
> >>
> >>My pleasure.
> >>
> >>I have a small test program for the tcp_info bit - where do I go to find 
> >>how the inet diag stuff works?
> > 
> > 
> > ss state listen
> 
> hpcpc103:~# ss --version
> ss utility, iproute2-ss070313
> hpcpc103:~# ss state listen
> ss: no socket states to show with such filter.

looks like 'ss state listening' or 'ss -l' is the right syntax.

> hpcpc103:~# ss --all
> State      Recv-Q Send-Q      Local Address:Port          Peer 
> Address:Port
> LISTEN     0      128                     *:sunrpc                   *:* 
> 
> LISTEN     0      128                     *:auth                     *:* 
> 
> LISTEN     0      128                    :::ssh                     :::* 
> 
> LISTEN     0      20              127.0.0.1:smtp                     *:* 
> 
> LISTEN     0      128                     *:42137                    *:* 
> 
> 
> > 
> > 
> >>BTW, what do people think about doing the same thing with the rxqueue 
> >>and txqueue's of netstat output?
> >>
> > 
> > 
> > I dont understand this question, I thought your patch already handled this 
> > (for the txqueue, since rxqueue is already there),  as netstat uses 
> > /proc/net/tcp (unfortunatly)
> 
> Well, it doesn't seem to be the case.  This is from the same system as 
> the ss output above:
> 
> hpcpc103:~# netstat -an | grep LISTEN
> tcp        0      0 0.0.0.0:111          0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:113          0.0.0.0:*               LISTEN
> tcp        0      0 127.0.0.1:25         0.0.0.0:*               LISTEN
> tcp        0      0 0.0.0.0:42137        0.0.0.0:*               LISTEN
> tcp6       0      0 :::22                :::*                    LISTEN
> unix  2    [ ACC ]     STREAM   LISTENING   5666  /var/run/acpid.socket
> 
> I thought I saw some other code in there when I was stumbling around.

Yes. netstat code seems to have a explicit check for TCP_LISTEN state
and zeroing txq and rxq.
>From tcp_do_one() in netstat.c
    if (state == TCP_LISTEN) {
        time_len = 0;
        retr = 0L;
        rxq = 0L;
        txq = 0L;
    }

We should fix this. Also i think it is a good idea to update netstat to use 
INET_DIAG_INFO instead of /proc/net/tcp.

Thanks
Sridhar


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

* Re: [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info
  2007-09-11 17:46           ` Sridhar Samudrala
@ 2007-09-11 18:10             ` Rick Jones
  0 siblings, 0 replies; 9+ messages in thread
From: Rick Jones @ 2007-09-11 18:10 UTC (permalink / raw)
  To: Sridhar Samudrala; +Cc: Eric Dumazet, netdev

>>>>BTW, what do people think about doing the same thing with the rxqueue 
>>>>and txqueue's of netstat output?
>>>>
>>>
>>>
>>>I dont understand this question, I thought your patch already handled this 
>>>(for the txqueue, since rxqueue is already there),  as netstat uses 
>>>/proc/net/tcp (unfortunatly)
>>
>>Well, it doesn't seem to be the case.  This is from the same system as 
>>the ss output above:
>>
>>hpcpc103:~# netstat -an | grep LISTEN
>>tcp        0      0 0.0.0.0:111          0.0.0.0:*               LISTEN
>>tcp        0      0 0.0.0.0:113          0.0.0.0:*               LISTEN
>>tcp        0      0 127.0.0.1:25         0.0.0.0:*               LISTEN
>>tcp        0      0 0.0.0.0:42137        0.0.0.0:*               LISTEN
>>tcp6       0      0 :::22                :::*                    LISTEN
>>unix  2    [ ACC ]     STREAM   LISTENING   5666  /var/run/acpid.socket
>>
>>I thought I saw some other code in there when I was stumbling around.
> 
> 
> Yes. netstat code seems to have a explicit check for TCP_LISTEN state
> and zeroing txq and rxq.
>>From tcp_do_one() in netstat.c
>     if (state == TCP_LISTEN) {
>         time_len = 0;
>         retr = 0L;
>         rxq = 0L;
>         txq = 0L;
>     }

How terribly cheeky of them.  I wonder why they were doing that?

> We should fix this. Also i think it is a good idea to update netstat to use 
> INET_DIAG_INFO instead of /proc/net/tcp.

Since that is user space I went ahead and sent the updated kernel patch 
in a fresh thread.

rick

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

end of thread, other threads:[~2007-09-11 18:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-10 23:13 [PATCH] include listenq max backlog in /proc/net/tcp and include in tcp_info Rick Jones
2007-09-11  0:39 ` Sridhar Samudrala
2007-09-11  6:09   ` Eric Dumazet
2007-09-11  6:54     ` Eric Dumazet
2007-09-11 17:00     ` Rick Jones
2007-09-11 17:15       ` Eric Dumazet
2007-09-11 17:35         ` Rick Jones
2007-09-11 17:46           ` Sridhar Samudrala
2007-09-11 18:10             ` Rick Jones

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).