* [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
@ 2007-09-12 0:38 Rick Jones
2007-09-17 18:38 ` Rick Jones
0 siblings, 1 reply; 10+ messages in thread
From: Rick Jones @ 2007-09-12 0:38 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, /proc/net/tcp6, and INET_DIAG_INFO.
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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_diag.c
--- a/net/ipv4/tcp_diag.c Sat Sep 01 07:00:31 2007 +0000
+++ b/net/ipv4/tcp_diag.c Tue Sep 11 10:38:23 2007 -0700
@@ -25,11 +25,14 @@ static void tcp_diag_get_info(struct soc
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);
}
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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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] 10+ messages in thread* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-12 0:38 [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder Rick Jones
@ 2007-09-17 18:38 ` Rick Jones
2007-09-17 19:01 ` David Miller
0 siblings, 1 reply; 10+ messages in thread
From: Rick Jones @ 2007-09-17 18:38 UTC (permalink / raw)
To: netdev; +Cc: Rick Jones
Since small things fall more easily through cracks I thought I'd make
sure it didn't get lost?
rick jones
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, /proc/net/tcp6, and INET_DIAG_INFO.
>
> Signed-off-by: Rick Jones <rick.jones2@hp.com>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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_diag.c
> --- a/net/ipv4/tcp_diag.c Sat Sep 01 07:00:31 2007 +0000
> +++ b/net/ipv4/tcp_diag.c Tue Sep 11 10:38:23 2007 -0700
> @@ -25,11 +25,14 @@ static void tcp_diag_get_info(struct soc
> 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);
> }
> 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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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] 10+ messages in thread* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 18:38 ` Rick Jones
@ 2007-09-17 19:01 ` David Miller
2007-09-17 19:51 ` Rick Jones
0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2007-09-17 19:01 UTC (permalink / raw)
To: rick.jones2; +Cc: netdev
From: Rick Jones <rick.jones2@hp.com>
Date: Mon, 17 Sep 2007 11:38:09 -0700
> Since small things fall more easily through cracks I thought I'd make
> sure it didn't get lost?
Reposting the patch is often better because if you quote it
then the copy I have has to be meticuliously edited to remove
the quoting information.
Alternatively forward the original patch posting so it does
not get all the quoting material added.
As is, what you've forwarded is useless to me since I also
don't have the original posting.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 19:01 ` David Miller
@ 2007-09-17 19:51 ` Rick Jones
0 siblings, 0 replies; 10+ messages in thread
From: Rick Jones @ 2007-09-17 19:51 UTC (permalink / raw)
To: David Miller; +Cc: netdev
David Miller wrote:
> From: Rick Jones <rick.jones2@hp.com>
> Date: Mon, 17 Sep 2007 11:38:09 -0700
>
>
>>Since small things fall more easily through cracks I thought I'd make
>>sure it didn't get lost?
>
>
> Reposting the patch is often better because if you quote it
> then the copy I have has to be meticuliously edited to remove
> the quoting information.
>
> Alternatively forward the original patch posting so it does
> not get all the quoting material added.
>
> As is, what you've forwarded is useless to me since I also
> don't have the original posting.
I'm batting a thousand today... resent with a different mailer.
rick
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
@ 2007-09-17 19:50 Rick Jones
2007-09-17 20:06 ` John Heffner
0 siblings, 1 reply; 10+ messages in thread
From: Rick Jones @ 2007-09-17 19:50 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, /proc/net/tcp6, and INET_DIAG_INFO.
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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_diag.c
--- a/net/ipv4/tcp_diag.c Sat Sep 01 07:00:31 2007 +0000
+++ b/net/ipv4/tcp_diag.c Tue Sep 11 10:38:23 2007 -0700
@@ -25,11 +25,14 @@ static void tcp_diag_get_info(struct soc
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);
}
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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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] 10+ messages in thread* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 19:50 Rick Jones
@ 2007-09-17 20:06 ` John Heffner
2007-09-17 20:30 ` Rick Jones
0 siblings, 1 reply; 10+ messages in thread
From: John Heffner @ 2007-09-17 20:06 UTC (permalink / raw)
To: Rick Jones; +Cc: netdev
Any reason you're overloading tcpi_unacked and tcpi_sacked? It seems
that setting idiag_rqueue and idiag_wqueue are sufficient.
-John
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, /proc/net/tcp6, and INET_DIAG_INFO.
>
> Signed-off-by: Rick Jones <rick.jones2@hp.com>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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_diag.c
> --- a/net/ipv4/tcp_diag.c Sat Sep 01 07:00:31 2007 +0000
> +++ b/net/ipv4/tcp_diag.c Tue Sep 11 10:38:23 2007 -0700
> @@ -25,11 +25,14 @@ static void tcp_diag_get_info(struct soc
> 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);
> }
> 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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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] 10+ messages in thread* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 20:06 ` John Heffner
@ 2007-09-17 20:30 ` Rick Jones
2007-09-17 20:44 ` John Heffner
2007-09-17 21:26 ` David Miller
0 siblings, 2 replies; 10+ messages in thread
From: Rick Jones @ 2007-09-17 20:30 UTC (permalink / raw)
To: John Heffner; +Cc: netdev
John Heffner wrote:
> Any reason you're overloading tcpi_unacked and tcpi_sacked? It seems
> that setting idiag_rqueue and idiag_wqueue are sufficient.
Different fields for different structures. The tcp_info struct doesn't
have the idiag_mumble, so to get the two values shown in /proc/net/tcp I
use tcpi_unacked and tcpi_sacked.
For the INET_DIAG_INFO stuff the idiag_mumble fields are used and that
then covers ss.
rick
>
> -John
>
>
> 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, /proc/net/tcp6, and INET_DIAG_INFO.
>>
>> Signed-off-by: Rick Jones <rick.jones2@hp.com>
>> Signed-off-by: Eric Dumazet <dada1@cosmosbay.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 Tue Sep 11 10:38:23
>> 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 Tue Sep 11 10:38:23 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_diag.c
>> --- a/net/ipv4/tcp_diag.c Sat Sep 01 07:00:31 2007 +0000
>> +++ b/net/ipv4/tcp_diag.c Tue Sep 11 10:38:23 2007 -0700
>> @@ -25,11 +25,14 @@ static void tcp_diag_get_info(struct soc
>> 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);
>> }
>> 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 Tue Sep 11 10:38:23 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 Tue Sep 11 10:38:23 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] 10+ messages in thread* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 20:30 ` Rick Jones
@ 2007-09-17 20:44 ` John Heffner
2007-09-17 22:48 ` Rick Jones
2007-09-17 21:26 ` David Miller
1 sibling, 1 reply; 10+ messages in thread
From: John Heffner @ 2007-09-17 20:44 UTC (permalink / raw)
To: Rick Jones; +Cc: netdev
Rick Jones wrote:
> John Heffner wrote:
>> Any reason you're overloading tcpi_unacked and tcpi_sacked? It seems
>> that setting idiag_rqueue and idiag_wqueue are sufficient.
>
> Different fields for different structures. The tcp_info struct doesn't
> have the idiag_mumble, so to get the two values shown in /proc/net/tcp I
> use tcpi_unacked and tcpi_sacked.
>
> For the INET_DIAG_INFO stuff the idiag_mumble fields are used and that
> then covers ss.
Maybe I'm missing something. get_tcp[46]_sock() does not use struct
tcp_info. The only way I see using this is by doing
getsockopt(TCP_INFO) on your listen socket. Is this the intention?
-John
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 20:44 ` John Heffner
@ 2007-09-17 22:48 ` Rick Jones
0 siblings, 0 replies; 10+ messages in thread
From: Rick Jones @ 2007-09-17 22:48 UTC (permalink / raw)
To: John Heffner; +Cc: netdev
John Heffner wrote:
> Rick Jones wrote:
>
>> John Heffner wrote:
>>
>>> Any reason you're overloading tcpi_unacked and tcpi_sacked? It seems
>>> that setting idiag_rqueue and idiag_wqueue are sufficient.
>>
>>
>> Different fields for different structures. The tcp_info struct
>> doesn't have the idiag_mumble, so to get the two values shown in
>> /proc/net/tcp I use tcpi_unacked and tcpi_sacked.
>>
>> For the INET_DIAG_INFO stuff the idiag_mumble fields are used and that
>> then covers ss.
>
>
> Maybe I'm missing something. get_tcp[46]_sock() does not use struct
> tcp_info. The only way I see using this is by doing
> getsockopt(TCP_INFO) on your listen socket. Is this the intention?
Yes. Sorry I got a triffle turned-around there.
rick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder
2007-09-17 20:30 ` Rick Jones
2007-09-17 20:44 ` John Heffner
@ 2007-09-17 21:26 ` David Miller
1 sibling, 0 replies; 10+ messages in thread
From: David Miller @ 2007-09-17 21:26 UTC (permalink / raw)
To: rick.jones2; +Cc: jheffner, netdev
From: Rick Jones <rick.jones2@hp.com>
Date: Mon, 17 Sep 2007 13:30:12 -0700
> Different fields for different structures. The tcp_info struct doesn't
> have the idiag_mumble, so to get the two values shown in /proc/net/tcp I
> use tcpi_unacked and tcpi_sacked.
>
> For the INET_DIAG_INFO stuff the idiag_mumble fields are used and that
> then covers ss.
I want to reiterate what has been stated earlier in reply to this
patch in that we shouldn't be modifying /proc/net/tcp* at all,
any change can break some application parsing the strings it
spits out.
Therefore only the inet_diag thing can have the fields added
in a backward compatible manner.
Actually, this is why I initially deleted this patch from my inbox
without applying it, I didn't see you remove the procfs code
based upon the feedback you got stating that was necessary.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-09-17 22:48 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12 0:38 [PATCH] include listenq max/backlog in tcp_info and related reports - correct version/signorder Rick Jones
2007-09-17 18:38 ` Rick Jones
2007-09-17 19:01 ` David Miller
2007-09-17 19:51 ` Rick Jones
-- strict thread matches above, loose matches on Subject: below --
2007-09-17 19:50 Rick Jones
2007-09-17 20:06 ` John Heffner
2007-09-17 20:30 ` Rick Jones
2007-09-17 20:44 ` John Heffner
2007-09-17 22:48 ` Rick Jones
2007-09-17 21:26 ` 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).