Skip to contentSkip to conversation

Disable TCP_DEBUG and FASTRETRANS_DEBUG by default

PATCH In review Dan McGee 3 participants 6 messages Oct 17, 2011 – Oct 24, 2011

Subsystems (3)
lore
Share & tools
lore

Dan McGee

author
#0 lore raw

PATCH 1/1 Disable TCP_DEBUG and FASTRETRANS_DEBUG by default

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.

---
 include/net/tcp.h    |    4 ++--
 net/ipv4/tcp_timer.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
include/net/tcp.h +2 -2
index acc620a..15236d0 100644
@@ -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>
net/ipv4/tcp_timer.c +1 -1
index ecd44b0..31669e7 100644
@@ -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",
Signature · 1 line
1.7.7
maintainer
#1 lore raw

From: Dan McGee <[email protected]>
Date: Mon, 17 Oct 2011 15:25:24 -0500

Quoted 5 lines

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.

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.

#2 lore raw
Quoted 7 lines · On Mon, 17 Oct 2011 17:52:38 -0400 (EDT) David Miller <[email protected]>…

From: Dan McGee <[email protected]>
Date: Mon, 17 Oct 2011 15:25:24 -0500

Quoted 4 lines

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.

Quoted 6 lines
Quoted 1 line

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

author
#3 lore raw
Quoted 12 lines · Flavio Leitner
Quoted 9 lines · On Mon, 17 Oct 2011 17:52:38 -0400 (EDT) David Miller <[email protected]>…

From: Dan McGee <[email protected]>
Date: Mon, 17 Oct 2011 15:25:24 -0500

Quoted 5 lines

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.

Quoted 7 lines
Quoted 4 lines

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

#4 lore raw

PATCH 1/1 TCP: remove TCP_DEBUG

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

---
 include/net/tcp.h    |    1 -
 net/ipv4/tcp.c       |    2 --
 net/ipv4/tcp_timer.c |    2 --
 3 files changed, 0 insertions(+), 5 deletions(-)
include/net/tcp.h +0 -1
index ed0e814..e147f42 100644
@@ -18,7 +18,6 @@
 #ifndef _TCP_H
 #define _TCP_H
 
-#define TCP_DEBUG 1
 #define FASTRETRANS_DEBUG 1
 
 #include <linux/list.h>
net/ipv4/tcp.c +0 -2
index eefc61e..34f5db1 100644
@@ -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);
net/ipv4/tcp_timer.c +0 -2
index ecd44b0..2e0f0af 100644
@@ -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;
Signature · 1 line
1.7.6