All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH 11/37] docs: networking: convert netif-msg.txt to ReST
Date: Thu, 30 Apr 2020 18:04:06 +0200	[thread overview]
Message-ID: <72289384e0cf00824ed80b819ef9720665eabccf.1588261997.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1588261997.git.mchehab+huawei@kernel.org>

- add SPDX header;
- adjust title and chapter markups;
- mark lists as such;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/networking/index.rst     |  1 +
 Documentation/networking/netif-msg.rst | 95 ++++++++++++++++++++++++++
 Documentation/networking/netif-msg.txt | 79 ---------------------
 3 files changed, 96 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/networking/netif-msg.rst
 delete mode 100644 Documentation/networking/netif-msg.txt

diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst
index 1ae0cbef8c04..d98509f15363 100644
--- a/Documentation/networking/index.rst
+++ b/Documentation/networking/index.rst
@@ -84,6 +84,7 @@ Contents:
    netdev-features
    netdevices
    netfilter-sysctl
+   netif-msg
 
 .. only::  subproject and html
 
diff --git a/Documentation/networking/netif-msg.rst b/Documentation/networking/netif-msg.rst
new file mode 100644
index 000000000000..b20d265a734d
--- /dev/null
+++ b/Documentation/networking/netif-msg.rst
@@ -0,0 +1,95 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+===============
+NETIF Msg Level
+===============
+
+The design of the network interface message level setting.
+
+History
+-------
+
+ The design of the debugging message interface was guided and
+ constrained by backwards compatibility previous practice.  It is useful
+ to understand the history and evolution in order to understand current
+ practice and relate it to older driver source code.
+
+ From the beginning of Linux, each network device driver has had a local
+ integer variable that controls the debug message level.  The message
+ level ranged from 0 to 7, and monotonically increased in verbosity.
+
+ The message level was not precisely defined past level 3, but were
+ always implemented within +-1 of the specified level.  Drivers tended
+ to shed the more verbose level messages as they matured.
+
+   - 0  Minimal messages, only essential information on fatal errors.
+   - 1  Standard messages, initialization status.  No run-time messages
+   - 2  Special media selection messages, generally timer-driver.
+   - 3  Interface starts and stops, including normal status messages
+   - 4  Tx and Rx frame error messages, and abnormal driver operation
+   - 5  Tx packet queue information, interrupt events.
+   - 6  Status on each completed Tx packet and received Rx packets
+   - 7  Initial contents of Tx and Rx packets
+
+ Initially this message level variable was uniquely named in each driver
+ e.g. "lance_debug", so that a kernel symbolic debugger could locate and
+ modify the setting.  When kernel modules became common, the variables
+ were consistently renamed to "debug" and allowed to be set as a module
+ parameter.
+
+ This approach worked well.  However there is always a demand for
+ additional features.  Over the years the following emerged as
+ reasonable and easily implemented enhancements
+
+   - Using an ioctl() call to modify the level.
+   - Per-interface rather than per-driver message level setting.
+   - More selective control over the type of messages emitted.
+
+ The netif_msg recommendation adds these features with only a minor
+ complexity and code size increase.
+
+ The recommendation is the following points
+
+  - Retaining the per-driver integer variable "debug" as a module
+    parameter with a default level of '1'.
+
+  - Adding a per-interface private variable named "msg_enable".  The
+    variable is a bit map rather than a level, and is initialized as::
+
+       1 << debug
+
+    Or more precisely::
+
+	debug < 0 ? 0 : 1 << min(sizeof(int)-1, debug)
+
+    Messages should changes from::
+
+      if (debug > 1)
+	   printk(MSG_DEBUG "%s: ...
+
+    to::
+
+      if (np->msg_enable & NETIF_MSG_LINK)
+	   printk(MSG_DEBUG "%s: ...
+
+
+The set of message levels is named
+
+
+  =========   ===================	============
+  Old level   Name			Bit position
+  =========   ===================	============
+    0         NETIF_MSG_DRV		0x0001
+    1         NETIF_MSG_PROBE		0x0002
+    2         NETIF_MSG_LINK		0x0004
+    2         NETIF_MSG_TIMER		0x0004
+    3         NETIF_MSG_IFDOWN		0x0008
+    3         NETIF_MSG_IFUP		0x0008
+    4         NETIF_MSG_RX_ERR		0x0010
+    4         NETIF_MSG_TX_ERR		0x0010
+    5         NETIF_MSG_TX_QUEUED	0x0020
+    5         NETIF_MSG_INTR		0x0020
+    6         NETIF_MSG_TX_DONE		0x0040
+    6         NETIF_MSG_RX_STATUS	0x0040
+    7         NETIF_MSG_PKTDATA		0x0080
+  =========   ===================	============
diff --git a/Documentation/networking/netif-msg.txt b/Documentation/networking/netif-msg.txt
deleted file mode 100644
index c967ddb90d0b..000000000000
--- a/Documentation/networking/netif-msg.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-
-________________
-NETIF Msg Level
-
-The design of the network interface message level setting.
-
-History
-
- The design of the debugging message interface was guided and
- constrained by backwards compatibility previous practice.  It is useful
- to understand the history and evolution in order to understand current
- practice and relate it to older driver source code.
-
- From the beginning of Linux, each network device driver has had a local
- integer variable that controls the debug message level.  The message
- level ranged from 0 to 7, and monotonically increased in verbosity.
-
- The message level was not precisely defined past level 3, but were
- always implemented within +-1 of the specified level.  Drivers tended
- to shed the more verbose level messages as they matured.
-    0  Minimal messages, only essential information on fatal errors.
-    1  Standard messages, initialization status.  No run-time messages
-    2  Special media selection messages, generally timer-driver.
-    3  Interface starts and stops, including normal status messages
-    4  Tx and Rx frame error messages, and abnormal driver operation
-    5  Tx packet queue information, interrupt events.
-    6  Status on each completed Tx packet and received Rx packets
-    7  Initial contents of Tx and Rx packets
-
- Initially this message level variable was uniquely named in each driver
- e.g. "lance_debug", so that a kernel symbolic debugger could locate and
- modify the setting.  When kernel modules became common, the variables
- were consistently renamed to "debug" and allowed to be set as a module
- parameter.
-
- This approach worked well.  However there is always a demand for
- additional features.  Over the years the following emerged as
- reasonable and easily implemented enhancements
-   Using an ioctl() call to modify the level.
-   Per-interface rather than per-driver message level setting.
-   More selective control over the type of messages emitted.
-
- The netif_msg recommendation adds these features with only a minor
- complexity and code size increase.
-
- The recommendation is the following points
-    Retaining the per-driver integer variable "debug" as a module
-    parameter with a default level of '1'.
-
-    Adding a per-interface private variable named "msg_enable".  The
-    variable is a bit map rather than a level, and is initialized as
-       1 << debug
-    Or more precisely
-        debug < 0 ? 0 : 1 << min(sizeof(int)-1, debug)
-
-    Messages should changes from
-      if (debug > 1)
-           printk(MSG_DEBUG "%s: ...
-    to
-      if (np->msg_enable & NETIF_MSG_LINK)
-           printk(MSG_DEBUG "%s: ...
-
-
-The set of message levels is named
-  Old level   Name   Bit position
-    0    NETIF_MSG_DRV		0x0001
-    1    NETIF_MSG_PROBE	0x0002
-    2    NETIF_MSG_LINK		0x0004
-    2    NETIF_MSG_TIMER	0x0004
-    3    NETIF_MSG_IFDOWN	0x0008
-    3    NETIF_MSG_IFUP		0x0008
-    4    NETIF_MSG_RX_ERR	0x0010
-    4    NETIF_MSG_TX_ERR	0x0010
-    5    NETIF_MSG_TX_QUEUED	0x0020
-    5    NETIF_MSG_INTR		0x0020
-    6    NETIF_MSG_TX_DONE	0x0040
-    6    NETIF_MSG_RX_STATUS	0x0040
-    7    NETIF_MSG_PKTDATA	0x0080
-
-- 
2.25.4


  parent reply	other threads:[~2020-04-30 16:07 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 16:03 [PATCH 00/37] net: manually convert files to ReST format - part 2 Mauro Carvalho Chehab
2020-04-30 16:03 ` Mauro Carvalho Chehab
2020-04-30 16:03 ` Mauro Carvalho Chehab
2020-04-30 16:03 ` Mauro Carvalho Chehab
2020-04-30 16:03 ` Mauro Carvalho Chehab
2020-04-30 16:03 ` Mauro Carvalho Chehab
2020-04-30 16:03 ` [PATCH 01/37] docs: networking: convert l2tp.txt to ReST Mauro Carvalho Chehab
2020-04-30 16:03 ` [PATCH 02/37] docs: networking: convert lapb-module.txt " Mauro Carvalho Chehab
2020-04-30 16:03 ` [PATCH 03/37] docs: networking: convert ltpc.txt " Mauro Carvalho Chehab
2020-04-30 16:03 ` [PATCH 04/37] docs: networking: convert mac80211-injection.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 05/37] docs: networking: convert mpls-sysctl.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 06/37] docs: networking: convert multiqueue.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 07/37] docs: networking: convert netconsole.txt " Mauro Carvalho Chehab
2020-04-30 16:04   ` Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 08/37] docs: networking: convert netdev-features.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 09/37] docs: networking: convert netdevices.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 10/37] docs: networking: convert netfilter-sysctl.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` Mauro Carvalho Chehab [this message]
2020-04-30 16:04 ` [PATCH 12/37] docs: networking: convert nf_conntrack-sysctl.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 13/37] docs: networking: convert nf_flowtable.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 14/37] docs: networking: convert openvswitch.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 15/37] docs: networking: convert operstates.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 16/37] docs: networking: convert packet_mmap.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 17/37] docs: networking: convert phonet.txt " Mauro Carvalho Chehab
2020-04-30 18:46   ` Rémi Denis-Courmont
2020-04-30 16:04 ` [PATCH 18/37] docs: networking: convert pktgen.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 19/37] docs: networking: convert PLIP.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 20/37] docs: networking: convert ppp_generic.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 21/37] docs: networking: convert proc_net_tcp.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 22/37] docs: networking: convert radiotap-headers.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 23/37] docs: networking: convert ray_cs.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 24/37] docs: networking: convert rds.txt " Mauro Carvalho Chehab
2020-04-30 16:08   ` santosh.shilimkar
2020-04-30 16:04 ` [PATCH 25/37] docs: networking: convert regulatory.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 26/37] docs: networking: convert rxrpc.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 27/37] docs: networking: convert sctp.txt " Mauro Carvalho Chehab
2020-04-30 16:04   ` Mauro Carvalho Chehab
2020-04-30 16:46   ` Marcelo Ricardo Leitner
2020-04-30 16:46     ` Marcelo Ricardo Leitner
2020-04-30 16:04 ` [PATCH 28/37] docs: networking: convert secid.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 29/37] docs: networking: convert seg6-sysctl.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 30/37] docs: networking: convert skfp.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 31/37] docs: networking: convert strparser.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 32/37] docs: networking: convert switchdev.txt " Mauro Carvalho Chehab
2020-04-30 16:04   ` Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 33/37] docs: networking: convert tc-actions-env-rules.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 34/37] docs: networking: convert tcp-thin.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 35/37] docs: networking: convert team.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 36/37] docs: networking: convert timestamping.txt " Mauro Carvalho Chehab
2020-04-30 16:04 ` [PATCH 37/37] docs: networking: convert tproxy.txt " Mauro Carvalho Chehab
2020-04-30 19:56 ` [PATCH 00/37] net: manually convert files to ReST format - part 2 David Miller
2020-04-30 19:56   ` David Miller
2020-04-30 19:56   ` David Miller
2020-04-30 19:56   ` David Miller
2020-04-30 19:56   ` 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=72289384e0cf00824ed80b819ef9720665eabccf.1588261997.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.