linux-sg2042/drivers/net
Tejun Heo e2f15f9a79 netconsole: implement extended console support
printk logbuf keeps various metadata and optional key=value dictionary for
structured messages, both of which are stripped when messages are handed
to regular console drivers.

It can be useful to have this metadata and dictionary available to
netconsole consumers.  This obviously makes logging via netconsole more
complete and the sequence number in particular is useful in environments
where messages may be lost or reordered in transit - e.g.  when netconsole
is used to collect messages in a large cluster where packets may have to
travel congested hops to reach the aggregator.  The lost and reordered
messages can easily be identified and handled accordingly using the
sequence numbers.

printk recently added extended console support which can be selected by
setting CON_EXTENDED flag.  From console driver side, not much changes.
The only difference is that the text passed to the write callback is
formatted the same way as /dev/kmsg.

This patch implements extended console support for netconsole which can be
enabled by either prepending "+" to a netconsole boot param entry or
echoing 1 to "extended" file in configfs.  When enabled, netconsole
transmits extended log messages with headers identical to /dev/kmsg
output.

There's one complication due to message fragments.  netconsole limits the
maximum message size to 1k and messages longer than that are split into
multiple fragments.  As all extended console messages should carry
matching headers and be uniquely identifiable, each extended message
fragment carries full copy of the metadata and an extra header field to
identify the specific fragment.  The optional header is of the form
"ncfrag=OFF/LEN" where OFF is the byte offset into the message body and
LEN is the total length.

To avoid unnecessarily making printk format extended messages, Extended
netconsole is registered with printk when the first extended netconsole is
configured.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: David Miller <davem@davemloft.net>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Petr Mladek <pmladek@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-06-25 17:00:39 -07:00
..
appletalk
arcnet drivers/net: remove all references to obsolete Ethernet-HOWTO 2015-06-23 06:50:35 -07:00
bonding bonding: Display LACP info only to CAP_NET_ADMIN capable user 2015-06-23 03:11:52 -07:00
caif caif: remove unused struct member 2015-04-01 12:43:09 -04:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-06-24 02:58:51 -07:00
cris
dsa dsa: mv88x6xxx: Zero statistics counters 2015-06-23 06:37:17 -07:00
ethernet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
fddi fddi: print an address with %p format specifier rather than %x 2015-06-07 00:31:22 -07:00
hamradio netfilter: Remove spurios included of netfilter.h 2015-06-18 21:14:32 +02:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
ieee802154 at86rf230: cleanup start and stop callbacks 2015-06-16 18:55:11 +02:00
ipvlan ipvlan: Always set broadcast bit in multicast filter 2015-05-05 19:29:49 -04:00
irda irda: irda-usb: use msecs_to_jiffies for conversions 2015-05-25 17:39:21 -04:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
plip
ppp netfilter: Remove spurios included of netfilter.h 2015-06-18 21:14:32 +02:00
slip
team switchdev: add support for fdb add/del/dump via switchdev_port_obj ops. 2015-05-17 22:49:09 -04:00
usb cdc_ncm: Fix tx_bytes statistics 2015-05-22 14:26:31 -04:00
vmxnet3 vmxnet3: Changes for vmxnet3 adapter version 2 (fwd) 2015-06-23 06:26:01 -07:00
wan netfilter: Remove spurios included of netfilter.h 2015-06-18 21:14:32 +02:00
wimax
wireless Major changes: 2015-06-23 01:03:18 -07:00
xen-netback Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-06-24 02:58:51 -07:00
Kconfig geneve: add initial netdev driver for GENEVE tunnels 2015-05-13 15:59:13 -04:00
LICENSE.SRC
Makefile geneve: add initial netdev driver for GENEVE tunnels 2015-05-13 15:59:13 -04:00
Space.c
dummy.c
eql.c
geneve.c geneve: allow user to specify TOS info for tunnel frames 2015-06-01 17:05:04 -07:00
ifb.c act_mirred: Fix bogus header when redirecting from VLAN 2015-04-17 13:29:28 -04:00
loopback.c
macvlan.c macvlan: Propagate promiscuity setting to lower devices. 2015-05-04 00:14:13 -04:00
macvtap.c macvtap: Increase limit of macvtap queues 2015-06-23 06:14:04 -07:00
mdio.c
mii.c
netconsole.c netconsole: implement extended console support 2015-06-25 17:00:39 -07:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c PNP: net/sb1000: Use module_pnp_driver to register driver 2015-03-18 22:39:17 +01:00
sungem_phy.c
tun.c net: Pass kern from net_proto_family.create to sk_alloc 2015-05-11 10:50:17 -04:00
veth.c veth: set iflink to the peer veth 2015-04-02 14:05:01 -04:00
virtio_net.c virtio: document queue state logic 2015-04-06 16:44:24 -04:00
vxlan.c vxlan: release lock after each bucket in vxlan_cleanup 2015-05-27 13:33:21 -04:00
xen-netfront.c net/xen-netfront: Correct printf format in xennet_get_responses 2015-06-21 09:40:40 -07:00