Skip to content

Commit 7e31d82

Browse files
mitaChristoph Hellwig
authored andcommitted
Documentation: nvme: add an example for nvme fault injection
This adds an example of how to inject errors into admin commands. Suggested-by: Thomas Tai <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Minwoo Im <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent f79d5fd commit 7e31d82

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

Documentation/fault-injection/nvme-fault-injection.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,59 @@ R13: ffff88011a3c9680 R14: 0000000000000000 R15: 0000000000000000
114114
cpu_startup_entry+0x6f/0x80
115115
start_secondary+0x187/0x1e0
116116
secondary_startup_64+0xa5/0xb0
117+
118+
Example 3: Inject an error into the 10th admin command
119+
------------------------------------------------------
120+
121+
echo 100 > /sys/kernel/debug/nvme0/fault_inject/probability
122+
echo 10 > /sys/kernel/debug/nvme0/fault_inject/space
123+
echo 1 > /sys/kernel/debug/nvme0/fault_inject/times
124+
nvme reset /dev/nvme0
125+
126+
Expected Result:
127+
128+
After NVMe controller reset, the reinitialization may or may not succeed.
129+
It depends on which admin command is actually forced to fail.
130+
131+
Message from dmesg:
132+
133+
nvme nvme0: resetting controller
134+
FAULT_INJECTION: forcing a failure.
135+
name fault_inject, interval 1, probability 100, space 1, times 1
136+
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.2.0-rc2+ #2
137+
Hardware name: MSI MS-7A45/B150M MORTAR ARCTIC (MS-7A45), BIOS 1.50 04/25/2017
138+
Call Trace:
139+
<IRQ>
140+
dump_stack+0x63/0x85
141+
should_fail+0x14a/0x170
142+
nvme_should_fail+0x38/0x80 [nvme_core]
143+
nvme_irq+0x129/0x280 [nvme]
144+
? blk_mq_end_request+0xb3/0x120
145+
__handle_irq_event_percpu+0x84/0x1a0
146+
handle_irq_event_percpu+0x32/0x80
147+
handle_irq_event+0x3b/0x60
148+
handle_edge_irq+0x7f/0x1a0
149+
handle_irq+0x20/0x30
150+
do_IRQ+0x4e/0xe0
151+
common_interrupt+0xf/0xf
152+
</IRQ>
153+
RIP: 0010:cpuidle_enter_state+0xc5/0x460
154+
Code: ff e8 8f 5f 86 ff 80 7d c7 00 74 17 9c 58 0f 1f 44 00 00 f6 c4 02 0f 85 69 03 00 00 31 ff e8 62 aa 8c ff fb 66 0f 1f 44 00 00 <45> 85 ed 0f 88 37 03 00 00 4c 8b 45 d0 4c 2b 45 b8 48 ba cf f7 53
155+
RSP: 0018:ffffffff88c03dd0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffdc
156+
RAX: ffff9dac25a2ac80 RBX: ffffffff88d53760 RCX: 000000000000001f
157+
RDX: 0000000000000000 RSI: 000000002d958403 RDI: 0000000000000000
158+
RBP: ffffffff88c03e18 R08: fffffff75e35ffb7 R09: 00000a49a56c0b48
159+
R10: ffffffff88c03da0 R11: 0000000000001b0c R12: ffff9dac25a34d00
160+
R13: 0000000000000006 R14: 0000000000000006 R15: ffffffff88d53760
161+
cpuidle_enter+0x2e/0x40
162+
call_cpuidle+0x23/0x40
163+
do_idle+0x201/0x280
164+
cpu_startup_entry+0x1d/0x20
165+
rest_init+0xaa/0xb0
166+
arch_call_rest_init+0xe/0x1b
167+
start_kernel+0x51c/0x53b
168+
x86_64_start_reservations+0x24/0x26
169+
x86_64_start_kernel+0x74/0x77
170+
secondary_startup_64+0xa4/0xb0
171+
nvme nvme0: Could not set queue count (16385)
172+
nvme nvme0: IO queues not created

0 commit comments

Comments
 (0)