netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: about : [NET]: Replace CONFIG_NET_DEBUG with sysctl.
Date: Fri, 9 Mar 2007 10:06:44 -0800	[thread overview]
Message-ID: <20070309100644.448d186d@freekitty> (raw)
In-Reply-To: <45F0FFE7.1080304@cosmosbay.com>

This was what the patch was (complete with spulling error)...

Covert network warning messages from a compile time to runtime choice.
Removes kernel config option and replaces it with new /proc/sys/net/core/warnings.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>  


---
 Documentation/filesystems/proc.txt |    9 +++++++++
 include/linux/sysctl.h             |    1 +
 include/net/sock.h                 |   12 +++++-------
 net/Kconfig                        |    7 -------
 net/core/sysctl_net_core.c         |    8 ++++++++
 net/core/utils.c                   |    2 ++
 6 files changed, 25 insertions(+), 14 deletions(-)

--- net-2.6.22.orig/Documentation/filesystems/proc.txt	2007-03-08 11:23:38.000000000 -0800
+++ net-2.6.22/Documentation/filesystems/proc.txt	2007-03-08 11:26:10.000000000 -0800
@@ -1421,6 +1421,15 @@
 be dropped.  The  default  settings  limit  warning messages to one every five
 seconds.
 
+warnings
+--------
+
+This controls console messages from the networking stack that can occur because
+of problems on the network like duplicate address or bad checksums. Normally,
+this should be enabled, but if the problem persists the messages can be
+disabled.
+
+
 netdev_max_backlog
 ------------------
 
--- net-2.6.22.orig/include/linux/sysctl.h	2007-03-08 11:11:46.000000000 -0800
+++ net-2.6.22/include/linux/sysctl.h	2007-03-08 11:17:39.000000000 -0800
@@ -290,6 +290,7 @@
 	NET_CORE_BUDGET=19,
 	NET_CORE_AEVENT_ETIME=20,
 	NET_CORE_AEVENT_RSEQTH=21,
+	NET_CORE_WARNINGS=22,
 };
 
 /* /proc/sys/net/ethernet */
--- net-2.6.22.orig/include/net/sock.h	2007-03-08 11:06:36.000000000 -0800
+++ net-2.6.22/include/net/sock.h	2007-03-08 11:26:17.000000000 -0800
@@ -1333,14 +1333,12 @@
 /* 
  *	Enable debug/info messages 
  */
+extern int net_msg_warn;
+#define NETDEBUG(fmt, args...) \
+	do { if (net_msg_warn) printk(fmt,##args); } while (0)
 
-#ifdef CONFIG_NETDEBUG
-#define NETDEBUG(fmt, args...)	printk(fmt,##args)
-#define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0)
-#else
-#define NETDEBUG(fmt, args...)	do { } while (0)
-#define LIMIT_NETDEBUG(fmt, args...) do { } while(0)
-#endif
+#define LIMIT_NETDEBUG(fmt, args...) \
+	do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0)
 
 /*
  * Macros for sleeping on a socket. Use them like this:
--- net-2.6.22.orig/net/Kconfig	2007-03-08 11:21:05.000000000 -0800
+++ net-2.6.22/net/Kconfig	2007-03-08 11:21:16.000000000 -0800
@@ -27,13 +27,6 @@
 
 menu "Networking options"
 
-config NETDEBUG
-	bool "Network packet debugging"
-	help
-	  You can say Y here if you want to get additional messages useful in
-	  debugging bad packets, but can overwhelm logs under denial of service
-	  attacks.
-
 source "net/packet/Kconfig"
 source "net/unix/Kconfig"
 source "net/xfrm/Kconfig"
--- net-2.6.22.orig/net/core/sysctl_net_core.c	2007-03-08 11:10:40.000000000 -0800
+++ net-2.6.22/net/core/sysctl_net_core.c	2007-03-08 11:37:18.000000000 -0800
@@ -136,6 +136,14 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec
 	},
+	{
+		.ctl_name	= NET_CORE_WARNINGS,
+		.procname	= "warnings",
+		.data		= &net_msg_warn,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec
+	},
 	{ .ctl_name = 0 }
 };
 
--- net-2.6.22.orig/net/core/utils.c	2007-03-08 11:18:09.000000000 -0800
+++ net-2.6.22/net/core/utils.c	2007-03-08 11:39:08.000000000 -0800
@@ -32,6 +32,8 @@
 
 int net_msg_cost = 5*HZ;
 int net_msg_burst = 10;
+int net_msg_warn = 1;
+EXPORT_SYMBOL(net_msg_warn);
 
 /*
  * All net warning printk()s should be guarded by this function.

  parent reply	other threads:[~2007-03-09 18:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-08 20:52 [PATCH 0/8] net-2.6.22 spring cleaning Stephen Hemminger
2007-03-08 20:52 ` [PATCH 1/8] udp: ipv4 whitespace cleanup Stephen Hemminger
2007-03-09  4:42   ` David Miller
2007-03-09  6:34     ` about : [NET]: Replace CONFIG_NET_DEBUG with sysctl Eric Dumazet
2007-03-09  6:37       ` David Miller
2007-03-09  6:59         ` Eric Dumazet
2007-03-09  7:14           ` David Miller
2007-03-09  7:51             ` Eric Dumazet
2007-03-09  7:55               ` David Miller
2007-03-09  7:58                 ` Eric Dumazet
2007-03-09 16:15           ` Stephen Hemminger
2007-03-09 16:22       ` Stephen Hemminger
2007-03-09 18:06       ` Stephen Hemminger [this message]
2007-03-08 20:52 ` [PATCH 2/8] udp: ipv6 style cleanup Stephen Hemminger
2007-03-09  4:42   ` David Miller
2007-03-08 20:52 ` [PATCH 3/8] network core: whitespace cleanup Stephen Hemminger
2007-03-09  4:43   ` David Miller
2007-03-08 20:52 ` [PATCH 4/8] wireless: use ARRAY_SIZE() Stephen Hemminger
2007-03-09  4:43   ` David Miller
2007-03-08 20:52 ` [PATCH 5/8] ipv4 cleanup Stephen Hemminger
2007-03-09  4:44   ` David Miller
2007-03-08 20:52 ` [PATCH 6/8] tcp: whitespace cleanup Stephen Hemminger
2007-03-09  4:45   ` David Miller
2007-03-08 20:52 ` [PATCH 7/8] net: deinline some functions Stephen Hemminger
2007-03-09  4:46   ` David Miller
2007-03-08 20:52 ` [PATCH 8/8] udp: deinline Stephen Hemminger
2007-03-09  4:46   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070309100644.448d186d@freekitty \
    --to=shemminger@linux-foundation.org \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).