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
638638
639639 See Documentation/admin-guide/serial-console.rst for more
640640 information. See
641− Documentation/networking/netconsole.txt for an
641+ Documentation/networking/netconsole.rst for an
642642 alternative.
643643
644644 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
5454 ``/dev/console`` is now character device 5,1.
5555
5656 (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.)
5858
5959 Here's an example that will use ``/dev/ttyS1`` (COM2) as the console.
6060 Replace the sample values as needed.
Documentation/networking/index.rst+1−0
@@ -80,6 +80,7 @@ Contents: · 79 unmodified lines
8080 mac80211-injection
8181 mpls-sysctl
8282 multiqueue
83+ netconsole
8384
8485 .. only:: subproject and html
8586
Documentation/networking/netconsole.rstrenamed from Documentation/networking/netconsole.txt+77−48
@@ -1,7 +1,16 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==========
4+Netconsole
5+==========
6+
17
28 started by Ingo Molnar <mingo@redhat.com>, 2001.09.17
9+
310 2.6 port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003
11+
412 IPv6 support by Cong Wang <xiyou.wangcong@gmail.com>, Jan 1 2013
13+
514 Extended console support by Tejun Heo <tj@kernel.org>, May 1 2015
615
716 Please send bug reports to Matt Mackall <mpm@selenic.com>
@@ -23,34 +32,34 @@ Sender and receiver configuration: · 15 unmodified lines
2332 ==================================
2433
2534 It takes a string configuration parameter "netconsole" in the
26−following format:
35+following format::
2736
2837 netconsole=[+][src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
2938
3039 where
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)
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)
3847
39−Examples:
48+Examples::
4049
4150 linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
4251
43− or
52+or::
4453
4554 insmod netconsole netconsole=@/,@10.0.0.2/
4655
47− or using IPv6
56+or using IPv6::
4857
4958 insmod netconsole netconsole=@/,@fd00:1:2:3::1/
5059
5160 It also supports logging to multiple remote agents by specifying
5261 parameters for the multiple agents separated by semicolons and the
53−complete string enclosed in "quotes", thusly:
62+complete string enclosed in "quotes", thusly::
5463
5564 modprobe netconsole netconsole="@/,@10.0.0.2/;@/eth1,6892@10.0.0.3/"
5665
@@ -67,14 +76,19 @@ for example: · 10 unmodified lines
6776
6877 On distributions using a BSD-based netcat version (e.g. Fedora,
6978 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::
7184
72− 'nc -u -l -p <port>' / 'nc -u -l <port>' or
73− 'netcat -u -l -p <port>' / 'netcat -u -l <port>'
85+ netcat -u -l -p <port>' / 'netcat -u -l <port>
7486
7587 3) socat
7688
77− 'socat udp-recv:<port> -'
89+::
90+
91+ socat udp-recv:<port> -
7892
7993 Dynamic reconfiguration:
8094 ========================
@@ -92,7 +106,7 @@ netconsole module (or kernel, if netconsole is built-in). · 11 unmodified lines
92106 Some examples follow (where configfs is mounted at the /sys/kernel/config
93107 mountpoint).
94108
95−To add a remote logging target (target names can be arbitrary):
109+To add a remote logging target (target names can be arbitrary)::
96110
97111 cd /sys/kernel/config/netconsole/
98112 mkdir target1
@@ -102,12 +116,13 @@ above) and are disabled by default -- they must first be enabled by writing · 3 unmodified lines
102116 "1" to the "enabled" attribute (usually after setting parameters accordingly)
103117 as described below.
104118
105−To remove a target:
119+To remove a target::
106120
107121 rmdir /sys/kernel/config/netconsole/othertarget/
108122
109123 The interface exposes these parameters of a netconsole target to userspace:
110124
125+ ============== ================================= ============
111126 enabled Is this target currently enabled? (read-write)
112127 extended Extended mode enabled (read-write)
113128 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
117132 remote_ip Remote agent's IP address (read-write)
118133 local_mac Local interface's MAC address (read-only)
119134 remote_mac Remote agent's MAC address (read-write)
135+ ============== ================================= ============
120136
121137 The "enabled" attribute is also used to control whether the parameters of
122138 a target can be updated or not -- you can modify the parameters of only
123139 disabled targets (i.e. if "enabled" is 0).
124140
125−To update a target's parameters:
141+To update a target's parameters::
126142
127143 cat enabled # check if enabled is 1
128144 echo 0 > enabled # disable the target (if required)
@@ -140,12 +156,12 @@ Extended console: · 11 unmodified lines
140156
141157 If '+' is prefixed to the configuration line or "extended" config file
142158 is set to 1, extended console support is enabled. An example boot
143−param follows.
159+param follows::
144160
145161 linux netconsole=+4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
146162
147163 Log messages are transmitted with extended metadata header in the
148−following format which is the same as /dev/kmsg.
164+following format which is the same as /dev/kmsg::
149165
150166 <level>,<sequnum>,<timestamp>,<contflag>;<message text>
151167
@@ -155,12 +171,12 @@ newline is used as the delimeter. · 3 unmodified lines
155171
156172 If a message doesn't fit in certain number of bytes (currently 1000),
157173 the message is split into multiple fragments by netconsole. These
158−fragments are transmitted with "ncfrag" header field added.
174+fragments are transmitted with "ncfrag" header field added::
159175
160176 ncfrag=<byte-offset>/<total-bytes>
161177
162178 For example, assuming a lot smaller chunk size, a message "the first
163−chunk, the 2nd chunk." may be split as follows.
179+chunk, the 2nd chunk." may be split as follows::
164180
165181 6,416,1758426,-,ncfrag=0/31;the first chunk,
166182 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
168184 Miscellaneous notes:
169185 ====================
170186
171−WARNING: the default target ethernet setting uses the broadcast
172−ethernet address to send packets, which can cause increased load on
173−other systems on the same ethernet segment.
187+.. Warning::
188+
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
174204
175−TIP: some LAN switches may be configured to suppress ethernet broadcasts
176−so it is advised to explicitly specify the remote agents' MAC addresses
177−from the config parameters passed to netconsole.
205+.. Tip::
178206
179−TIP: 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.
180211
181− ping -c 1 10.0.0.2 ; /sbin/arp -n | grep 10.0.0.2
212+.. note::
182213
183−TIP: in case the remote logging agent is on a separate LAN subnet than
184−the sender, it is suggested to try specifying the MAC address of the
185−default gateway (you may use /sbin/route -n to find it out) as the
186−remote MAC address instead.
214+ the network device (eth1 in the above case) can run any kind
215+ of other network traffic, netconsole is not intrusive. Netconsole
216+ might cause slight delays in other traffic if the volume of kernel
217+ messages is high, but should have no other impact.
187218
188−NOTE: the network device (eth1 in the above case) can run any kind
189−of other network traffic, netconsole is not intrusive. Netconsole
190−might cause slight delays in other traffic if the volume of kernel
191−messages is high, but should have no other impact.
219+.. note::
192220
193−NOTE: if you find that the remote logging agent is not receiving or
194−printing all messages from the sender, it is likely that you have set
195−the "console_loglevel" parameter (on the sender) to only send high
196−priority messages to the console. You can change this at runtime using:
221+ if you find that the remote logging agent is not receiving or
222+ printing all messages from the sender, it is likely that you have set
223+ the "console_loglevel" parameter (on the sender) to only send high
224+ priority messages to the console. You can change this at runtime using::
197225
198− dmesg -n 8
226+ dmesg -n 8
199227
200−or by specifying "debug" on the kernel command line at boot, to send
201−all kernel messages to the console. A specific value for this parameter
202−can also be set using the "loglevel" kernel boot option. See the
203−dmesg(8) man page and Documentation/admin-guide/kernel-parameters.rst for details.
228+ or by specifying "debug" on the kernel command line at boot, to send
229+ all kernel messages to the console. A specific value for this parameter
230+ can also be set using the "loglevel" kernel boot option. See the
231+ dmesg(8) man page and Documentation/admin-guide/kernel-parameters.rst
232+ for details.
204233
205234 Netconsole was designed to be as instantaneous as possible, to
206235 enable 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
302302 tristate "Network console logging support"
303303 ---help---
304304 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.
306306
307307 config NETCONSOLE_DYNAMIC
308308 bool "Dynamic reconfiguration of logging targets"
@@ -312,7 +312,7 @@ config NETCONSOLE_DYNAMIC · 3 unmodified lines
312312 This option enables the ability to dynamically reconfigure target
313313 parameters (interface, IP addresses, port numbers, MAC addresses)
314314 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.
316316
317317 config NETPOLL
318318 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
11501150 * gelic_net_poll_controller - artificial interrupt for netconsole etc.
11511151 * @netdev: interface device structure
11521152 *
1153− * see Documentation/networking/netconsole.txt
1153+ * see Documentation/networking/netconsole.rst
11541154 */
11551155 void gelic_net_poll_controller(struct net_device *netdev)
11561156 {
drivers/net/ethernet/toshiba/spider_net.c+1−1
@@ -1615,7 +1615,7 @@ spider_net_interrupt(int irq, void *ptr) · 1614 unmodified lines
16151615 * spider_net_poll_controller - artificial interrupt for netconsole etc.
16161616 * @netdev: interface device structure
16171617 *
1618− * see Documentation/networking/netconsole.txt
1618+ * see Documentation/networking/netconsole.rst
16191619 */
16201620 static void
16211621 spider_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