* [PATCH] tcp: Replace time wait bucket msg by counter.
@ 2010-12-04 21:35 Tom Herbert
2010-12-04 21:52 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Tom Herbert @ 2010-12-04 21:35 UTC (permalink / raw)
To: davem, netdev
Rather than printing the message to the log, use a mib counter to keep
track of the count of occurences of time wait bucket overflow. Reduces
spam in logs.
Signed-off-by: Tom Herbert <therbert@google.com>
---
include/linux/snmp.h | 1 +
net/ipv4/proc.c | 1 +
net/ipv4/tcp_minisocks.c | 2 +-
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index ebb0c80..12b2b18 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -230,6 +230,7 @@ enum
LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
LINUX_MIB_TCPDEFERACCEPTDROP,
LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
+ LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
__LINUX_MIB_MAX
};
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 1b48eb1..b14ec7d 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -253,6 +253,7 @@ static const struct snmp_mib snmp4_net_list[] = {
SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP),
SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP),
SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER),
+ SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW),
SNMP_MIB_SENTINEL
};
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 43cf901..3052a2b 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -347,7 +347,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
* socket up. We've got bigger problems than
* non-graceful socket closings.
*/
- LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n");
+ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW);
}
tcp_update_metrics(sk);
--
1.7.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] tcp: Replace time wait bucket msg by counter.
2010-12-04 21:35 [PATCH] tcp: Replace time wait bucket msg by counter Tom Herbert
@ 2010-12-04 21:52 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2010-12-04 21:52 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev
Le samedi 04 décembre 2010 à 13:35 -0800, Tom Herbert a écrit :
> Rather than printing the message to the log, use a mib counter to keep
> track of the count of occurences of time wait bucket overflow. Reduces
> spam in logs.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
>
> diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
> index 43cf901..3052a2b 100644
> --- a/net/ipv4/tcp_minisocks.c
> +++ b/net/ipv4/tcp_minisocks.c
> @@ -347,7 +347,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
> * socket up. We've got bigger problems than
> * non-graceful socket closings.
> */
> - LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n");
> + NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW);
> }
>
> tcp_update_metrics(sk);
NET_INC_STATS_BH() should be more appropriate, since we are in a
softirq ?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-04 21:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-04 21:35 [PATCH] tcp: Replace time wait bucket msg by counter Tom Herbert
2010-12-04 21:52 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox