]> git.baikalelectronics.ru Git - kernel.git/commit
net: add support for netdev notifier error injection
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Sat, 28 Nov 2015 12:45:28 +0000 (13:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Dec 2015 20:31:57 +0000 (15:31 -0500)
commit91ca4a782fe79965ab175a338c3ce849a970bd76
treeb8b5ccf5a9c21f47ef78f563ff8c6c734567be64
parent0500b8b47009d297d3df0efc97c4f3d81d31b0d8
net: add support for netdev notifier error injection

This module allows to insert errors in some of netdevice's notifier
events. All network drivers use these notifiers to signal various events
and to check if they are allowed, e.g. PRECHANGEMTU and CHANGEMTU
afterwards. Until recently I had to run failure tests by injecting
a custom module, but now this infrastructure makes it trivial to test
these failure paths. Some of the recent bugs I fixed were found using
this module.
Here's an example:
 $ cd /sys/kernel/debug/notifier-error-inject/netdev
 $ echo -22 > actions/NETDEV_CHANGEMTU/error
 $ ip link set eth0 mtu 1024
 RTNETLINK answers: Invalid argument

CC: Akinobu Mita <akinobu.mita@gmail.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: netdev <netdev@vger.kernel.org>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/fault-injection/notifier-error-inject.txt
lib/Kconfig.debug
lib/Makefile
lib/netdev-notifier-error-inject.c [new file with mode: 0644]