public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH blktests] nvme: test log page offsets
@ 2024-02-05 18:52 Keith Busch
  2024-02-05 22:30 ` Chaitanya Kulkarni
  2024-02-06  6:02 ` Shinichiro Kawasaki
  0 siblings, 2 replies; 8+ messages in thread
From: Keith Busch @ 2024-02-05 18:52 UTC (permalink / raw)
  To: linux-nvme, shinichiro.kawasaki; +Cc: Keith Busch

From: Keith Busch <kbusch@kernel.org>

I've encountered a device that fails catastrophically if the host
requests to an error log with a non-zero LPO. The fallout has been bad
enough to warrant a sanity check against this scenario.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 tests/nvme/051     | 26 ++++++++++++++++++++++++++
 tests/nvme/051.out |  2 ++
 2 files changed, 28 insertions(+)
 create mode 100755 tests/nvme/051
 create mode 100644 tests/nvme/051.out

diff --git a/tests/nvme/051 b/tests/nvme/051
new file mode 100755
index 0000000..ef30ad8
--- /dev/null
+++ b/tests/nvme/051
@@ -0,0 +1,26 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Keith Busch
+
+. tests/nvme/rc
+
+DESCRIPTION="Tests device support for log page offsets"
+CAN_BE_ZONED=1
+QUICK=1
+
+requires() {
+	_nvme_requires
+}
+
+test_device() {
+	echo "Running ${TEST_NAME}"
+
+	lpa=$(sudo nvme id-ctrl "${TEST_DEV}"  | grep lpa | cut -d":" -f 2 | xargs)
+	lpo=$((lpa & 0x4))
+
+	if [ $lpo -ne 0 ]; then
+		nvme get-log "${TEST_DEV}" --log-id=1 --log-len=128 --lpo=0x1000 > /dev/NULL
+	fi
+
+	echo "Test complete"
+}
diff --git a/tests/nvme/051.out b/tests/nvme/051.out
new file mode 100644
index 0000000..156f068
--- /dev/null
+++ b/tests/nvme/051.out
@@ -0,0 +1,2 @@
+Running nvme/051
+Test complete
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-07  5:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 18:52 [PATCH blktests] nvme: test log page offsets Keith Busch
2024-02-05 22:30 ` Chaitanya Kulkarni
2024-02-06  6:02 ` Shinichiro Kawasaki
2024-02-06  6:41   ` Keith Busch
2024-02-06 16:50     ` Keith Busch
2024-02-07  4:32     ` Shinichiro Kawasaki
2024-02-07  5:19       ` Chaitanya Kulkarni
2024-02-07  5:52       ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox