From: Yi Zhang <yi.zhang@redhat.com>
To: linux-block@vger.kernel.org
Cc: osandov@fb.com, ming.lei@redhat.com
Subject: [PATCH blktests] nvme: Add new test case about nvme rescan/reset/remove during IO
Date: Tue, 3 Sep 2019 16:17:52 +0800 [thread overview]
Message-ID: <20190903081752.463-1-yi.zhang@redhat.com> (raw)
Add one test to cover NVMe SSD rescan/reset/remove operation during
IO, the steps found several issues during my previous testing, check
them here:
http://lists.infradead.org/pipermail/linux-nvme/2017-February/008358.html
http://lists.infradead.org/pipermail/linux-nvme/2017-May/010259.html
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
---
tests/nvme/031 | 43 +++++++++++++++++++++++++++++++++++++++++++
tests/nvme/031.out | 2 ++
2 files changed, 45 insertions(+)
create mode 100755 tests/nvme/031
create mode 100644 tests/nvme/031.out
diff --git a/tests/nvme/031 b/tests/nvme/031
new file mode 100755
index 0000000..4113d12
--- /dev/null
+++ b/tests/nvme/031
@@ -0,0 +1,43 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2019 Yi Zhang <yi.zhang@redhat.com>
+#
+# Test nvme pci adapter rescan/reset/remove operation during I/O
+#
+# Regression test for bellow two commits:
+# http://lists.infradead.org/pipermail/linux-nvme/2017-May/010367.html
+# 986f75c876db nvme: avoid to use blk_mq_abort_requeue_list()
+# 806f026f9b90 nvme: use blk_mq_start_hw_queues() in nvme_kill_queues()
+
+. tests/nvme/rc
+
+DESCRIPTION="test nvme pci adapter rescan/reset/remove during I/O"
+TIMED=1
+
+requires() {
+ _have_fio
+}
+
+device_requires() {
+ _test_dev_is_nvme
+}
+
+test_device() {
+ echo "Running ${TEST_NAME}"
+
+ pdev="$(_get_pci_dev_from_blkdev)"
+
+ # start fio job
+ _run_fio_rand_io --filename="$TEST_DEV" --size=1g \
+ --ignore_error=EIO,ENXIO,ENODEV --group_reporting &> /dev/null &
+
+ # do rescan/reset/remove operation
+ echo 1 > /sys/bus/pci/devices/"${pdev}"/rescan
+ echo 1 > /sys/bus/pci/devices/"${pdev}"/reset
+ echo 1 > /sys/bus/pci/devices/"${pdev}"/remove
+ sleep .5
+ echo 1 > /sys/bus/pci/rescan
+ sleep 5
+
+ echo "Test complete"
+}
diff --git a/tests/nvme/031.out b/tests/nvme/031.out
new file mode 100644
index 0000000..ae902bd
--- /dev/null
+++ b/tests/nvme/031.out
@@ -0,0 +1,2 @@
+Running nvme/031
+Test complete
--
2.17.2
next reply other threads:[~2019-09-03 8:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 8:17 Yi Zhang [this message]
2019-09-04 18:21 ` [PATCH blktests] nvme: Add new test case about nvme rescan/reset/remove during IO Omar Sandoval
2019-09-07 18:23 ` Chaitanya Kulkarni
2019-09-09 9:29 ` Yi Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190903081752.463-1-yi.zhang@redhat.com \
--to=yi.zhang@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).