Commit c4d5dff6 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by David S. Miller

docs: networking: convert netif-msg.txt to ReST

- 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: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 01915330
...@@ -84,6 +84,7 @@ Contents: ...@@ -84,6 +84,7 @@ Contents:
netdev-features netdev-features
netdevices netdevices
netfilter-sysctl netfilter-sysctl
netif-msg
.. only:: subproject and html .. only:: subproject and html
......
.. SPDX-License-Identifier: GPL-2.0
________________ ===============
NETIF Msg Level NETIF Msg Level
===============
The design of the network interface message level setting. The design of the network interface message level setting.
History History
-------
The design of the debugging message interface was guided and The design of the debugging message interface was guided and
constrained by backwards compatibility previous practice. It is useful constrained by backwards compatibility previous practice. It is useful
...@@ -18,14 +21,15 @@ History ...@@ -18,14 +21,15 @@ History
The message level was not precisely defined past level 3, but were The message level was not precisely defined past level 3, but were
always implemented within +-1 of the specified level. Drivers tended always implemented within +-1 of the specified level. Drivers tended
to shed the more verbose level messages as they matured. 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 - 0 Minimal messages, only essential information on fatal errors.
2 Special media selection messages, generally timer-driver. - 1 Standard messages, initialization status. No run-time messages
3 Interface starts and stops, including normal status messages - 2 Special media selection messages, generally timer-driver.
4 Tx and Rx frame error messages, and abnormal driver operation - 3 Interface starts and stops, including normal status messages
5 Tx packet queue information, interrupt events. - 4 Tx and Rx frame error messages, and abnormal driver operation
6 Status on each completed Tx packet and received Rx packets - 5 Tx packet queue information, interrupt events.
7 Initial contents of Tx and Rx packets - 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 Initially this message level variable was uniquely named in each driver
e.g. "lance_debug", so that a kernel symbolic debugger could locate and e.g. "lance_debug", so that a kernel symbolic debugger could locate and
...@@ -36,44 +40,56 @@ History ...@@ -36,44 +40,56 @@ History
This approach worked well. However there is always a demand for This approach worked well. However there is always a demand for
additional features. Over the years the following emerged as additional features. Over the years the following emerged as
reasonable and easily implemented enhancements reasonable and easily implemented enhancements
Using an ioctl() call to modify the level.
Per-interface rather than per-driver message level setting. - Using an ioctl() call to modify the level.
More selective control over the type of messages emitted. - 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 The netif_msg recommendation adds these features with only a minor
complexity and code size increase. complexity and code size increase.
The recommendation is the following points The recommendation is the following points
Retaining the per-driver integer variable "debug" as a module
- Retaining the per-driver integer variable "debug" as a module
parameter with a default level of '1'. parameter with a default level of '1'.
Adding a per-interface private variable named "msg_enable". The - Adding a per-interface private variable named "msg_enable". The
variable is a bit map rather than a level, and is initialized as variable is a bit map rather than a level, and is initialized as::
1 << debug 1 << debug
Or more precisely
debug < 0 ? 0 : 1 << min(sizeof(int)-1, debug)
Messages should changes from Or more precisely::
debug < 0 ? 0 : 1 << min(sizeof(int)-1, debug)
Messages should changes from::
if (debug > 1) if (debug > 1)
printk(MSG_DEBUG "%s: ... printk(MSG_DEBUG "%s: ...
to
to::
if (np->msg_enable & NETIF_MSG_LINK) if (np->msg_enable & NETIF_MSG_LINK)
printk(MSG_DEBUG "%s: ... printk(MSG_DEBUG "%s: ...
The set of message levels is named 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
========= =================== ============
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
========= =================== ============
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment