Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
d9d6ef25 e98aa682

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