tcp: /proc/net/tcp rto,ato values not scaled properly
Subsystems (3)
PATCH 1/1 tcp: /proc/net/tcp rto,ato values not scaled properly
I found another case where we are sending information to userspace in the wrong HZ scale. This should have been fixed back in 2.5 :-(
This means an ABI change but as it stands there is no way for an application like ss to get the right value.
net/ipv4/tcp_ipv4.c +2 -2
@@ -2201,8 +2201,8 @@ static void get_tcp4_sock(struct sock *s icsk->icsk_probes_out,sock_i_ino (sk),atomic_read (&sk->sk_refcnt), sk, - icsk->icsk_rto, - icsk->icsk_ack.ato, +jiffies_to_clock_t (icsk->icsk_rto), +jiffies_to_clock_t (icsk->icsk_ack.ato), (icsk->icsk_ack.quick <<1 ) | icsk->icsk_ack.pingpong, tp->snd_cwnd, tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh,
net/ipv6/tcp_ipv6.c +2 -2
@@ -1962,8 +1962,8 @@ static void get_tcp6_sock(struct seq_fil icsk->icsk_probes_out,sock_i_ino (sp),atomic_read (&sp->sk_refcnt), sp, - icsk->icsk_rto, - icsk->icsk_ack.ato, +jiffies_to_clock_t (icsk->icsk_rto), +jiffies_to_clock_t (icsk->icsk_ack.ato), (icsk->icsk_ack.quick <<1 ) | icsk->icsk_ack.pingpong, tp->snd_cwnd, tp->snd_ssthresh>=0xFFFF ?-1 :tp->snd_ssthresh );
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Fri, 20 Jun 2008 11:56:03 -0700
Quoted 7 lines
I found another case where we are sending information to userspace in the wrong HZ scale. This should have been fixed back in 2.5 :-(
This means an ABI change but as it stands there is no way for an application like ss to get the right value.
Signed-off-by Stephen Hemminger <[email protected]>
Agree with your patch, but 'ss' should be getting this kind of info from netlink not procfs, right?
Quoted 6 lines · On Fri, 20 Jun 2008 12:05:26 -0700 (PDT) David Miller <[email protected]>…
From: Stephen Hemminger <[email protected]>
Date: Fri, 20 Jun 2008 11:56:03 -0700Quoted 3 lines
I found another case where we are sending information to userspace in the wrong HZ scale. This should have been fixed back in 2.5 :-(
Quoted 8 lines
Quoted 4 lines
This means an ABI change but as it stands there is no way for an application like ss to get the right value.
Signed-off-by Stephen Hemminger <[email protected]>Agree with your patch, but 'ss' should be getting this kind of info from netlink not procfs, right?
Yes, ss tries netlink first and fallsback to /proc.
I am in process of making sure all usages of HZ in iproute utilities are correct. The old user code assumed that the hz value used by tc (psched) was also correct for lots of other places. That is where I keep finding these turds.
Soon all uses of get_hz() in iproute will be replaced with either get_psched_hz() for tc; get_user_hz for clock values, or just use ms or us.
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Fri, 20 Jun 2008 11:56:03 -0700
Quoted 7 lines
I found another case where we are sending information to userspace in the wrong HZ scale. This should have been fixed back in 2.5 :-(
This means an ABI change but as it stands there is no way for an application like ss to get the right value.
Signed-off-by Stephen Hemminger <[email protected]>
Please fix these warnings and resubmit:
net/ipv4/tcp_ipv4.c: In function 'get_tcp4_sock':net/ipv4/tcp_ipv4.c:2311: warning: format '%u' expects type 'unsigned int', but argument 19 has type 'clock_t' net/ipv4/tcp_ipv4.c:2311: warning: format '%u' expects type 'unsigned int', but argument 20 has type 'clock_t' net/ipv6/tcp_ipv6.c: In function 'get_tcp6_sock':net/ipv6/tcp_ipv6.c:2059: warning: format '%u' expects type 'unsigned int', but argument 25 has type 'clock_t' net/ipv6/tcp_ipv6.c:2059: warning: format '%u' expects type 'unsigned int', but argument 26 has type 'clock_t'
Thanks!
PATCH 1/1 tcp: /proc/net/tcp rto,ato values not scaled properly (v2)
In reply to Stephen HemmingerI found another case where we are sending information to userspace in the wrong HZ scale. This should have been fixed back in 2.5 :-(
This means an ABI change but as it stands there is no way for an application like ss to get the right value.
---
Fixed printf format warnings in earlier patch
net/ipv4/tcp_ipv4.c +3 -3
@@ -2189,7 +2189,7 @@ static void get_tcp4_sock(struct sock *s } seq_printf(f, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX " - "%08X %5d %8d %lu %d %p %u %u %u %u %d%n", + "%08X %5d %8d %lu %d %p %lu %lu %u %u %d%n", i, src, srcp, dest, destp, sk->sk_state, tp->write_seq - tp->snd_una, sk->sk_state == TCP_LISTEN ? sk->sk_ack_backlog :
@@ -2201,8 +2201,8 @@ static void get_tcp4_sock(struct sock *s icsk->icsk_probes_out,sock_i_ino (sk),atomic_read (&sk->sk_refcnt), sk, - icsk->icsk_rto, - icsk->icsk_ack.ato, +jiffies_to_clock_t (icsk->icsk_rto), +jiffies_to_clock_t (icsk->icsk_ack.ato), (icsk->icsk_ack.quick <<1 ) | icsk->icsk_ack.pingpong, tp->snd_cwnd, tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh,
net/ipv6/tcp_ipv6.c +3 -3
@@ -1946,7 +1946,7 @@ static void get_tcp6_sock(struct seq_fil seq_printf(seq, "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X " - "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %u %u %u %u %d\n", + "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %lu %lu %u %u %d\n", i, src->s6_addr32[0], src->s6_addr32[1], src->s6_addr32[2], src->s6_addr32[3], srcp,
@@ -1962,8 +1962,8 @@ static void get_tcp6_sock(struct seq_fil icsk->icsk_probes_out,sock_i_ino (sp),atomic_read (&sp->sk_refcnt), sp, - icsk->icsk_rto, - icsk->icsk_ack.ato, +jiffies_to_clock_t (icsk->icsk_rto), +jiffies_to_clock_t (icsk->icsk_ack.ato), (icsk->icsk_ack.quick <<1 ) | icsk->icsk_ack.pingpong, tp->snd_cwnd, tp->snd_ssthresh>=0xFFFF ?-1 :tp->snd_ssthresh );
Re: [PATCH] tcp: /proc/net/tcp rto,ato values not scaled properly (v2)
From: Stephen Hemminger <[email protected]>
Date: Mon, 23 Jun 2008 11:16:00 -0700
Quoted 7 lines
I found another case where we are sending information to userspace in the wrong HZ scale. This should have been fixed back in 2.5 :-(
This means an ABI change but as it stands there is no way for an application like ss to get the right value.
Signed-off-by Stephen Hemminger <[email protected]>
Applied, thanks.