History

docs: networking: convert netconsole.txt to ReST

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

Mauro Carvalho Chehab committed 6 years ago

Commit d9d6ef21 parent e98aa687 files · +84 −54Browse files

Unified · Split

7 files
  1. Documentation/admin-guide/kernel-parameters.txt +1 −1
  2. Documentation/admin-guide/serial-console.rst +1 −1
  3. Documentation/networking/index.rst +1 −0
  4. Documentation/networking/netconsole.rst +77 −48
  5. drivers/net/Kconfig +2 −2
  6. drivers/net/ethernet/toshiba/ps3_gelic_net.c +1 −1
  7. drivers/net/ethernet/toshiba/spider_net.c +1 −1
Documentation/admin-guide/kernel-parameters.txt+1−1
@@ -638,7 +638,7 @@ · 637 unmodified lines
638 638
639 See Documentation/admin-guide/serial-console.rst for more639 See Documentation/admin-guide/serial-console.rst for more
640 information. See640 information. See
641 Documentation/networking/netconsole.txt for an641 Documentation/networking/netconsole.rst for an
642 alternative.642 alternative.
643 643
644 uart[8250],io,<addr>[,options]644 uart[8250],io,<addr>[,options]
Documentation/admin-guide/serial-console.rst+1−1
@@ -54,7 +54,7 @@ You will need to create a new device to use ``/dev/console``. The official · 53 unmodified lines
54``/dev/console`` is now character device 5,1.54``/dev/console`` is now character device 5,1.
55 55
56(You can also use a network device as a console. See56(You can also use a network device as a console. See
57``Documentation/networking/netconsole.txt`` for information on that.)57``Documentation/networking/netconsole.rst`` for information on that.)
58 58
59Here's an example that will use ``/dev/ttyS1`` (COM2) as the console.59Here's an example that will use ``/dev/ttyS1`` (COM2) as the console.
60Replace the sample values as needed.60Replace the sample values as needed.
Documentation/networking/index.rst+1−0
@@ -80,6 +80,7 @@ Contents: · 79 unmodified lines
80 mac80211-injection80 mac80211-injection
81 mpls-sysctl81 mpls-sysctl
82 multiqueue82 multiqueue
83 netconsole
83 84
84.. only:: subproject and html85.. only:: subproject and html
85 86
Documentation/networking/netconsole.rstrenamed from Documentation/networking/netconsole.txt+77−48
@@ -1,7 +1,16 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==========
4Netconsole
5==========
6
1 7
2started by Ingo Molnar <mingo@redhat.com>, 2001.09.178started by Ingo Molnar <mingo@redhat.com>, 2001.09.17
9
32.6 port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003102.6 port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003
11
4IPv6 support by Cong Wang <xiyou.wangcong@gmail.com>, Jan 1 201312IPv6 support by Cong Wang <xiyou.wangcong@gmail.com>, Jan 1 2013
13
5Extended console support by Tejun Heo <tj@kernel.org>, May 1 201514Extended console support by Tejun Heo <tj@kernel.org>, May 1 2015
6 15
7Please send bug reports to Matt Mackall <mpm@selenic.com>16Please send bug reports to Matt Mackall <mpm@selenic.com>
@@ -23,34 +32,34 @@ Sender and receiver configuration: · 15 unmodified lines
23==================================32==================================
24 33
25It takes a string configuration parameter "netconsole" in the34It takes a string configuration parameter "netconsole" in the
26following format:35following format::
27 36
28 netconsole=[+][src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]37 netconsole=[+][src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
29 38
30 where39 where
31 + if present, enable extended console support40 + if present, enable extended console support
32 src-port source for UDP packets (defaults to 6665)41 src-port source for UDP packets (defaults to 6665)
33 src-ip source IP to use (interface address)42 src-ip source IP to use (interface address)
34 dev network interface (eth0)43 dev network interface (eth0)
35 tgt-port port for logging agent (6666)44 tgt-port port for logging agent (6666)
36 tgt-ip IP address for logging agent45 tgt-ip IP address for logging agent
37 tgt-macaddr ethernet MAC address for logging agent (broadcast)46 tgt-macaddr ethernet MAC address for logging agent (broadcast)
38 47
39Examples:48Examples::
40 49
41 linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc50 linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
42 51
43 or52or::
44 53
45 insmod netconsole netconsole=@/,@10.0.0.2/54 insmod netconsole netconsole=@/,@10.0.0.2/
46 55
47 or using IPv656or using IPv6::
48 57
49 insmod netconsole netconsole=@/,@fd00:1:2:3::1/58 insmod netconsole netconsole=@/,@fd00:1:2:3::1/
50 59
51It also supports logging to multiple remote agents by specifying60It also supports logging to multiple remote agents by specifying
52parameters for the multiple agents separated by semicolons and the61parameters for the multiple agents separated by semicolons and the
53complete string enclosed in "quotes", thusly:62complete string enclosed in "quotes", thusly::
54 63
55 modprobe netconsole netconsole="@/,@10.0.0.2/;@/eth1,6892@10.0.0.3/"64 modprobe netconsole netconsole="@/,@10.0.0.2/;@/eth1,6892@10.0.0.3/"
56 65
@@ -67,14 +76,19 @@ for example: · 10 unmodified lines
67 76
68 On distributions using a BSD-based netcat version (e.g. Fedora,77 On distributions using a BSD-based netcat version (e.g. Fedora,
69 openSUSE and Ubuntu) the listening port must be specified without78 openSUSE and Ubuntu) the listening port must be specified without
70 the -p switch:79 the -p switch::
80
81 nc -u -l -p <port>' / 'nc -u -l <port>
82
83 or::
71 84
72 'nc -u -l -p <port>' / 'nc -u -l <port>' or85 netcat -u -l -p <port>' / 'netcat -u -l <port>
73 'netcat -u -l -p <port>' / 'netcat -u -l <port>'
74 86
753) socat873) socat
76 88
77 'socat udp-recv:<port> -'89::
90
91 socat udp-recv:<port> -
78 92
79Dynamic reconfiguration:93Dynamic reconfiguration:
80========================94========================
@@ -92,7 +106,7 @@ netconsole module (or kernel, if netconsole is built-in). · 11 unmodified lines
92Some examples follow (where configfs is mounted at the /sys/kernel/config106Some examples follow (where configfs is mounted at the /sys/kernel/config
93mountpoint).107mountpoint).
94 108
95To add a remote logging target (target names can be arbitrary):109To add a remote logging target (target names can be arbitrary)::
96 110
97 cd /sys/kernel/config/netconsole/111 cd /sys/kernel/config/netconsole/
98 mkdir target1112 mkdir target1
@@ -102,12 +116,13 @@ above) and are disabled by default -- they must first be enabled by writing · 3 unmodified lines
102"1" to the "enabled" attribute (usually after setting parameters accordingly)116"1" to the "enabled" attribute (usually after setting parameters accordingly)
103as described below.117as described below.
104 118
105To remove a target:119To remove a target::
106 120
107 rmdir /sys/kernel/config/netconsole/othertarget/121 rmdir /sys/kernel/config/netconsole/othertarget/
108 122
109The interface exposes these parameters of a netconsole target to userspace:123The interface exposes these parameters of a netconsole target to userspace:
110 124
125 ============== ================================= ============
111 enabled Is this target currently enabled? (read-write)126 enabled Is this target currently enabled? (read-write)
112 extended Extended mode enabled (read-write)127 extended Extended mode enabled (read-write)
113 dev_name Local network interface name (read-write)128 dev_name Local network interface name (read-write)
@@ -117,12 +132,13 @@ The interface exposes these parameters of a netconsole target to userspace: · 3 unmodified lines
117 remote_ip Remote agent's IP address (read-write)132 remote_ip Remote agent's IP address (read-write)
118 local_mac Local interface's MAC address (read-only)133 local_mac Local interface's MAC address (read-only)
119 remote_mac Remote agent's MAC address (read-write)134 remote_mac Remote agent's MAC address (read-write)
135 ============== ================================= ============
120 136
121The "enabled" attribute is also used to control whether the parameters of137The "enabled" attribute is also used to control whether the parameters of
122a target can be updated or not -- you can modify the parameters of only138a target can be updated or not -- you can modify the parameters of only
123disabled targets (i.e. if "enabled" is 0).139disabled targets (i.e. if "enabled" is 0).
124 140
125To update a target's parameters:141To update a target's parameters::
126 142
127 cat enabled # check if enabled is 1143 cat enabled # check if enabled is 1
128 echo 0 > enabled # disable the target (if required)144 echo 0 > enabled # disable the target (if required)
@@ -140,12 +156,12 @@ Extended console: · 11 unmodified lines
140 156
141If '+' is prefixed to the configuration line or "extended" config file157If '+' is prefixed to the configuration line or "extended" config file
142is set to 1, extended console support is enabled. An example boot158is set to 1, extended console support is enabled. An example boot
143param follows.159param follows::
144 160
145 linux netconsole=+4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc161 linux netconsole=+4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
146 162
147Log messages are transmitted with extended metadata header in the163Log messages are transmitted with extended metadata header in the
148following format which is the same as /dev/kmsg.164following format which is the same as /dev/kmsg::
149 165
150 <level>,<sequnum>,<timestamp>,<contflag>;<message text>166 <level>,<sequnum>,<timestamp>,<contflag>;<message text>
151 167
@@ -155,12 +171,12 @@ newline is used as the delimeter. · 3 unmodified lines
155 171
156If a message doesn't fit in certain number of bytes (currently 1000),172If a message doesn't fit in certain number of bytes (currently 1000),
157the message is split into multiple fragments by netconsole. These173the message is split into multiple fragments by netconsole. These
158fragments are transmitted with "ncfrag" header field added.174fragments are transmitted with "ncfrag" header field added::
159 175
160 ncfrag=<byte-offset>/<total-bytes>176 ncfrag=<byte-offset>/<total-bytes>
161 177
162For example, assuming a lot smaller chunk size, a message "the first178For example, assuming a lot smaller chunk size, a message "the first
163chunk, the 2nd chunk." may be split as follows.179chunk, the 2nd chunk." may be split as follows::
164 180
165 6,416,1758426,-,ncfrag=0/31;the first chunk,181 6,416,1758426,-,ncfrag=0/31;the first chunk,
166 6,416,1758426,-,ncfrag=16/31; the 2nd chunk.182 6,416,1758426,-,ncfrag=16/31; the 2nd chunk.
@@ -168,39 +184,52 @@ chunk, the 2nd chunk." may be split as follows. · 1 unmodified line
168Miscellaneous notes:184Miscellaneous notes:
169====================185====================
170 186
171WARNING: the default target ethernet setting uses the broadcast187.. Warning::
172ethernet address to send packets, which can cause increased load on188
173other systems on the same ethernet segment.189 the default target ethernet setting uses the broadcast
190 ethernet address to send packets, which can cause increased load on
191 other systems on the same ethernet segment.
192
193.. Tip::
194
195 some LAN switches may be configured to suppress ethernet broadcasts
196 so it is advised to explicitly specify the remote agents' MAC addresses
197 from the config parameters passed to netconsole.
198
199.. Tip::
200
201 to find out the MAC address of, say, 10.0.0.2, you may try using::
202
203 ping -c 1 10.0.0.2 ; /sbin/arp -n | grep 10.0.0.2
174 204
175TIP: some LAN switches may be configured to suppress ethernet broadcasts205.. Tip::
176so it is advised to explicitly specify the remote agents' MAC addresses
177from the config parameters passed to netconsole.
178 206
179TIP: to find out the MAC address of, say, 10.0.0.2, you may try using:207 in case the remote logging agent is on a separate LAN subnet than
208 the sender, it is suggested to try specifying the MAC address of the
209 default gateway (you may use /sbin/route -n to find it out) as the
210 remote MAC address instead.
180 211
181 ping -c 1 10.0.0.2 ; /sbin/arp -n | grep 10.0.0.2212.. note::
182 213
183TIP: in case the remote logging agent is on a separate LAN subnet than214 the network device (eth1 in the above case) can run any kind
184the sender, it is suggested to try specifying the MAC address of the215 of other network traffic, netconsole is not intrusive. Netconsole
185default gateway (you may use /sbin/route -n to find it out) as the216 might cause slight delays in other traffic if the volume of kernel
186remote MAC address instead.217 messages is high, but should have no other impact.
187 218
188NOTE: the network device (eth1 in the above case) can run any kind219.. note::
189of other network traffic, netconsole is not intrusive. Netconsole
190might cause slight delays in other traffic if the volume of kernel
191messages is high, but should have no other impact.
192 220
193NOTE: if you find that the remote logging agent is not receiving or221 if you find that the remote logging agent is not receiving or
194printing all messages from the sender, it is likely that you have set222 printing all messages from the sender, it is likely that you have set
195the "console_loglevel" parameter (on the sender) to only send high223 the "console_loglevel" parameter (on the sender) to only send high
196priority messages to the console. You can change this at runtime using:224 priority messages to the console. You can change this at runtime using::
197 225
198 dmesg -n 8226 dmesg -n 8
199 227
200or by specifying "debug" on the kernel command line at boot, to send228 or by specifying "debug" on the kernel command line at boot, to send
201all kernel messages to the console. A specific value for this parameter229 all kernel messages to the console. A specific value for this parameter
202can also be set using the "loglevel" kernel boot option. See the230 can also be set using the "loglevel" kernel boot option. See the
203dmesg(8) man page and Documentation/admin-guide/kernel-parameters.rst for details.231 dmesg(8) man page and Documentation/admin-guide/kernel-parameters.rst
232 for details.
204 233
205Netconsole was designed to be as instantaneous as possible, to234Netconsole was designed to be as instantaneous as possible, to
206enable the logging of even the most critical kernel bugs. It works235enable the logging of even the most critical kernel bugs. It works
drivers/net/Kconfig+2−2
@@ -302,7 +302,7 @@ config NETCONSOLE · 301 unmodified lines
302 tristate "Network console logging support"302 tristate "Network console logging support"
303 ---help---303 ---help---
304 If you want to log kernel messages over the network, enable this.304 If you want to log kernel messages over the network, enable this.
305 See <file:Documentation/networking/netconsole.txt> for details.305 See <file:Documentation/networking/netconsole.rst> for details.
306 306
307config NETCONSOLE_DYNAMIC307config NETCONSOLE_DYNAMIC
308 bool "Dynamic reconfiguration of logging targets"308 bool "Dynamic reconfiguration of logging targets"
@@ -312,7 +312,7 @@ config NETCONSOLE_DYNAMIC · 3 unmodified lines
312 This option enables the ability to dynamically reconfigure target312 This option enables the ability to dynamically reconfigure target
313 parameters (interface, IP addresses, port numbers, MAC addresses)313 parameters (interface, IP addresses, port numbers, MAC addresses)
314 at runtime through a userspace interface exported using configfs.314 at runtime through a userspace interface exported using configfs.
315 See <file:Documentation/networking/netconsole.txt> for details.315 See <file:Documentation/networking/netconsole.rst> for details.
316 316
317config NETPOLL317config NETPOLL
318 def_bool NETCONSOLE318 def_bool NETCONSOLE
drivers/net/ethernet/toshiba/ps3_gelic_net.c+1−1
@@ -1150,7 +1150,7 @@ static irqreturn_t gelic_card_interrupt(int irq, void *ptr) · 1149 unmodified lines
1150 * gelic_net_poll_controller - artificial interrupt for netconsole etc.1150 * gelic_net_poll_controller - artificial interrupt for netconsole etc.
1151 * @netdev: interface device structure1151 * @netdev: interface device structure
1152 *1152 *
1153 * see Documentation/networking/netconsole.txt1153 * see Documentation/networking/netconsole.rst
1154 */1154 */
1155void gelic_net_poll_controller(struct net_device *netdev)1155void gelic_net_poll_controller(struct net_device *netdev)
1156{1156{
drivers/net/ethernet/toshiba/spider_net.c+1−1
@@ -1615,7 +1615,7 @@ spider_net_interrupt(int irq, void *ptr) · 1614 unmodified lines
1615 * spider_net_poll_controller - artificial interrupt for netconsole etc.1615 * spider_net_poll_controller - artificial interrupt for netconsole etc.
1616 * @netdev: interface device structure1616 * @netdev: interface device structure
1617 *1617 *
1618 * see Documentation/networking/netconsole.txt1618 * see Documentation/networking/netconsole.rst
1619 */1619 */
1620static void1620static void
1621spider_net_poll_controller(struct net_device *netdev)1621spider_net_poll_controller(struct net_device *netdev)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t