Thread (6 messages) 6 messages, 2 authors, 2025-02-04

Re: [PATCH v2 blktests 2/2] nvme/059: add atomic write tests

From: Shinichiro Kawasaki <hidden>
Date: 2025-01-31 12:50:42
Also in: linux-nvme, linux-scsi

On Jan 28, 2025 / 15:50, Alan Adamson wrote:
Tests basic atomic write functionality using NVMe devices
that support the AWUN and AWUPF Controller Atomic Parameters
and NAWUN and NAWUPF Namespace Atomic Parameters.

Testing areas include:

- Verify sysfs atomic write attributes are consistent with
  atomic write capablities advertised by the NVMe HW.

- Verify the atomic write paramters of statx are correct using
  xfs_io.

- Perform a pwritev2() (with and without RWF_ATOMIC flag) using
  xfs_io:
    - maximum byte size (atomic_write_unit_max_bytes)
    - a write larger than atomic_write_unit_max_bytes
These test contests are smallre than those in scsi/009. Is it intentional?
No "minimum byte size" test, and no "a write smaller than
atomic_write_unit_min_bytes" test.
quoted hunk ↗ jump to hunk
Signed-off-by: Alan Adamson <redacted>
---
 tests/nvme/059     | 151 +++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/059.out |  10 +++
 2 files changed, 161 insertions(+)
 create mode 100755 tests/nvme/059
 create mode 100644 tests/nvme/059.out
diff --git a/tests/nvme/059 b/tests/nvme/059
new file mode 100755
index 000000000000..032f793e222d
--- /dev/null
+++ b/tests/nvme/059
@@ -0,0 +1,151 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2025 Oracle and/or its affiliates
+#
+# Test NVMe Atomic Writes
+
+. tests/nvme/rc
+. common/xfs
+
+DESCRIPTION="test atomic writes"
+QUICK=1
+
+requires() {
+	_nvme_requires
+	_have_program nvme
+	_have_xfs_io_atomic_write
+}
+
+device_requires() {
+	_require_test_dev_sysfs queue/atomic_write_max_bytes
+	if (( $(< "${TEST_DEV_SYSFS}"/queue/atomic_write_max_bytes) == 0 )); then
+		SKIP_REASONS+=("${TEST_DEV} does not support atomic write")
+		return 1
+	fi
+}
As I commented for the other patch, I suggest to factor out the check in
device_requires().
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help