aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/fault-injection
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2015-11-28 07:45:28 -0500
committerDavid S. Miller <davem@davemloft.net>2015-12-01 15:31:57 -0500
commit02fff96a79775b7adc34eb599fc6b0476ccda520 (patch)
treeb8b5ccf5a9c21f47ef78f563ff8c6c734567be64 /Documentation/fault-injection
parent27a70af3f4cf633a1b86c0ac7b426e2fe16ad2e5 (diff)
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>
Diffstat (limited to 'Documentation/fault-injection')
-rw-r--r--Documentation/fault-injection/notifier-error-inject.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/fault-injection/notifier-error-inject.txt b/Documentation/fault-injection/notifier-error-inject.txt
index 09adabef513f..71e638a4c497 100644
--- a/Documentation/fault-injection/notifier-error-inject.txt
+++ b/Documentation/fault-injection/notifier-error-inject.txt
@@ -10,6 +10,7 @@ modules that can be used to test the following notifiers.
10 * PM notifier 10 * PM notifier
11 * Memory hotplug notifier 11 * Memory hotplug notifier
12 * powerpc pSeries reconfig notifier 12 * powerpc pSeries reconfig notifier
13 * Netdevice notifier
13 14
14CPU notifier error injection module 15CPU notifier error injection module
15----------------------------------- 16-----------------------------------
@@ -87,6 +88,29 @@ Possible pSeries reconfig notifier events to be failed are:
87 * PSERIES_DRCONF_MEM_ADD 88 * PSERIES_DRCONF_MEM_ADD
88 * PSERIES_DRCONF_MEM_REMOVE 89 * PSERIES_DRCONF_MEM_REMOVE
89 90
91Netdevice notifier error injection module
92----------------------------------------------
93This feature is controlled through debugfs interface
94/sys/kernel/debug/notifier-error-inject/netdev/actions/<notifier event>/error
95
96Netdevice notifier events which can be failed are:
97
98 * NETDEV_REGISTER
99 * NETDEV_CHANGEMTU
100 * NETDEV_CHANGENAME
101 * NETDEV_PRE_UP
102 * NETDEV_PRE_TYPE_CHANGE
103 * NETDEV_POST_INIT
104 * NETDEV_PRECHANGEMTU
105 * NETDEV_PRECHANGEUPPER
106
107Example: Inject netdevice mtu change error (-22 == -EINVAL)
108
109 # cd /sys/kernel/debug/notifier-error-inject/netdev
110 # echo -22 > actions/NETDEV_CHANGEMTU/error
111 # ip link set eth0 mtu 1024
112 RTNETLINK answers: Invalid argument
113
90For more usage examples 114For more usage examples
91----------------------- 115-----------------------
92There are tools/testing/selftests using the notifier error injection features 116There are tools/testing/selftests using the notifier error injection features