netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Disable TCP_DEBUG and FASTRETRANS_DEBUG by default
@ 2011-10-17 20:25 Dan McGee
  2011-10-17 21:52 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Dan McGee @ 2011-10-17 20:25 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, linux-kernel

If these are truly debug options, they should be turned off by default
and can be tweaked if necessary. Fix one usage of the flag to use #if
instead of #ifdef so defining to zero is acceptable.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
 include/net/tcp.h    |    4 ++--
 net/ipv4/tcp_timer.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index acc620a..15236d0 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -18,8 +18,8 @@
 #ifndef _TCP_H
 #define _TCP_H
 
-#define TCP_DEBUG 1
-#define FASTRETRANS_DEBUG 1
+#define TCP_DEBUG 0
+#define FASTRETRANS_DEBUG 0
 
 #include <linux/list.h>
 #include <linux/tcp.h>
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ecd44b0..31669e7 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -334,7 +334,7 @@ void tcp_retransmit_timer(struct sock *sk)
 		 * connection. If the socket is an orphan, time it out,
 		 * we cannot allow such beasts to hang infinitely.
 		 */
-#ifdef TCP_DEBUG
+#if TCP_DEBUG
 		struct inet_sock *inet = inet_sk(sk);
 		if (sk->sk_family == AF_INET) {
 			LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI4:%u/%u unexpectedly shrunk window %u:%u (repaired)\n",
-- 
1.7.7

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

* Re: [PATCH] Disable TCP_DEBUG and FASTRETRANS_DEBUG by default
  2011-10-17 20:25 [PATCH] Disable TCP_DEBUG and FASTRETRANS_DEBUG by default Dan McGee
@ 2011-10-17 21:52 ` David Miller
  2011-10-19 17:16   ` Flavio Leitner
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2011-10-17 21:52 UTC (permalink / raw)
  To: dpmcgee; +Cc: netdev, kuznet, jmorris, yoshfuji, kaber, linux-kernel

From: Dan McGee <dpmcgee@gmail.com>
Date: Mon, 17 Oct 2011 15:25:24 -0500

> If these are truly debug options, they should be turned off by default
> and can be tweaked if necessary. Fix one usage of the flag to use #if
> instead of #ifdef so defining to zero is acceptable.
> 
> Signed-off-by: Dan McGee <dpmcgee@gmail.com>

Illegal window shrinks are a serious issue, and the fact that everyone
will see those messages by default and sometimes report them has been
tremendously useful.

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

* Re: [PATCH] Disable TCP_DEBUG and FASTRETRANS_DEBUG by default
  2011-10-17 21:52 ` David Miller
@ 2011-10-19 17:16   ` Flavio Leitner
  2011-10-22  1:54     ` Dan McGee
  0 siblings, 1 reply; 6+ messages in thread
From: Flavio Leitner @ 2011-10-19 17:16 UTC (permalink / raw)
  To: David Miller
  Cc: dpmcgee, netdev, kuznet, jmorris, yoshfuji, kaber, linux-kernel

On Mon, 17 Oct 2011 17:52:38 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Dan McGee <dpmcgee@gmail.com>
> Date: Mon, 17 Oct 2011 15:25:24 -0500
> 
> > If these are truly debug options, they should be turned off by default
> > and can be tweaked if necessary. Fix one usage of the flag to use #if
> > instead of #ifdef so defining to zero is acceptable.
> > 
> > Signed-off-by: Dan McGee <dpmcgee@gmail.com>
> 
> Illegal window shrinks are a serious issue, and the fact that everyone
> will see those messages by default and sometimes report them has been
> tremendously useful.
>

Agreed. I recently got bug report because of that message.  It is useful
and doesn't disturbe when network is fine, so please don't remove it.

fbl

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

* Re: [PATCH] Disable TCP_DEBUG and FASTRETRANS_DEBUG by default
  2011-10-19 17:16   ` Flavio Leitner
@ 2011-10-22  1:54     ` Dan McGee
  2011-10-24 18:15       ` [PATCH] TCP: remove TCP_DEBUG Flavio Leitner
  0 siblings, 1 reply; 6+ messages in thread
From: Dan McGee @ 2011-10-22  1:54 UTC (permalink / raw)
  To: Flavio Leitner
  Cc: David Miller, netdev, kuznet, jmorris, yoshfuji, kaber,
	linux-kernel

On Wed, Oct 19, 2011 at 12:16 PM, Flavio Leitner <fbl@redhat.com> wrote:
> On Mon, 17 Oct 2011 17:52:38 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Dan McGee <dpmcgee@gmail.com>
>> Date: Mon, 17 Oct 2011 15:25:24 -0500
>>
>> > If these are truly debug options, they should be turned off by default
>> > and can be tweaked if necessary. Fix one usage of the flag to use #if
>> > instead of #ifdef so defining to zero is acceptable.
>> >
>> > Signed-off-by: Dan McGee <dpmcgee@gmail.com>
>>
>> Illegal window shrinks are a serious issue, and the fact that everyone
>> will see those messages by default and sometimes report them has been
>> tremendously useful.
>>
>
> Agreed. I recently got bug report because of that message.  It is useful
> and doesn't disturbe when network is fine, so please don't remove it.
Can we kill TCP_DEBUG completely then? This is the only place it is
used, and it clearly is mislabeled if this is a "serious" and "useful"
feature.

Can anyone weigh in on FASTRETRANS_DEBUG and setting that to 0 by default?

-Dan

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

* [PATCH] TCP: remove TCP_DEBUG
  2011-10-22  1:54     ` Dan McGee
@ 2011-10-24 18:15       ` Flavio Leitner
  2011-10-24 21:35         ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Flavio Leitner @ 2011-10-24 18:15 UTC (permalink / raw)
  To: netdev
  Cc: David Miller, Dan McGee, kuznet, jmorris, yoshfuji, kaber,
	linux-kernel

It was enabled by default and the messages guarded
by the define are useful.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 include/net/tcp.h    |    1 -
 net/ipv4/tcp.c       |    2 --
 net/ipv4/tcp_timer.c |    2 --
 3 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index ed0e814..e147f42 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -18,7 +18,6 @@
 #ifndef _TCP_H
 #define _TCP_H
 
-#define TCP_DEBUG 1
 #define FASTRETRANS_DEBUG 1
 
 #include <linux/list.h>
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index eefc61e..34f5db1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1193,13 +1193,11 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied)
 	struct tcp_sock *tp = tcp_sk(sk);
 	int time_to_ack = 0;
 
-#if TCP_DEBUG
 	struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
 
 	WARN(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq),
 	     "cleanup rbuf bug: copied %X seq %X rcvnxt %X\n",
 	     tp->copied_seq, TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt);
-#endif
 
 	if (inet_csk_ack_scheduled(sk)) {
 		const struct inet_connection_sock *icsk = inet_csk(sk);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ecd44b0..2e0f0af 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -334,7 +334,6 @@ void tcp_retransmit_timer(struct sock *sk)
 		 * connection. If the socket is an orphan, time it out,
 		 * we cannot allow such beasts to hang infinitely.
 		 */
-#ifdef TCP_DEBUG
 		struct inet_sock *inet = inet_sk(sk);
 		if (sk->sk_family == AF_INET) {
 			LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI4:%u/%u unexpectedly shrunk window %u:%u (repaired)\n",
@@ -349,7 +348,6 @@ void tcp_retransmit_timer(struct sock *sk)
 			       inet->inet_num, tp->snd_una, tp->snd_nxt);
 		}
 #endif
-#endif
 		if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) {
 			tcp_write_err(sk);
 			goto out;
-- 
1.7.6

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

* Re: [PATCH] TCP: remove TCP_DEBUG
  2011-10-24 18:15       ` [PATCH] TCP: remove TCP_DEBUG Flavio Leitner
@ 2011-10-24 21:35         ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2011-10-24 21:35 UTC (permalink / raw)
  To: fbl; +Cc: netdev, dpmcgee, kuznet, jmorris, yoshfuji, kaber, linux-kernel

From: Flavio Leitner <fbl@redhat.com>
Date: Mon, 24 Oct 2011 16:15:10 -0200

> It was enabled by default and the messages guarded
> by the define are useful.
> 
> Signed-off-by: Flavio Leitner <fbl@redhat.com>

Applied, thanks Flavio.

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

end of thread, other threads:[~2011-10-24 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17 20:25 [PATCH] Disable TCP_DEBUG and FASTRETRANS_DEBUG by default Dan McGee
2011-10-17 21:52 ` David Miller
2011-10-19 17:16   ` Flavio Leitner
2011-10-22  1:54     ` Dan McGee
2011-10-24 18:15       ` [PATCH] TCP: remove TCP_DEBUG Flavio Leitner
2011-10-24 21:35         ` 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).