[PATCH blktests v1 1/2] nvme/rc: add reconnect-delay argument only for fabrics transports

Daniel Wagner dwagner at suse.de
Mon Mar 4 08:13:02 PST 2024


The loop transport is also considered a fabric transport. But not
connect options are supported, in particular the reconnect-delay option.

nvme-cli can't figure this out as the kernel reports the option support
for all transports (union). Thus, we have to filter out this option for
this loop transport in blktests.

Signed-off-by: Daniel Wagner <dwagner at suse.de>
---
 tests/nvme/rc | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 2d6ebeab2f6f..5facbe8f2d2f 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -122,13 +122,25 @@ _require_nvme_test_img_size() {
 	return 0
 }
 
-_require_nvme_trtype() {
+_is_nvme_trtype() {
 	local trtype
+
 	for trtype in "$@"; do
 		if [[ "${nvme_trtype}" == "$trtype" ]]; then
 			return 0
 		fi
 	done
+
+	return 1
+}
+
+_require_nvme_trtype() {
+	local trtype
+
+	if _is_nvme_trtype "$@"; then
+		return 0
+	fi
+
 	SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test")
 	return 1
 }
@@ -513,7 +525,8 @@ _nvme_connect_subsys() {
 	if [[ -n "${keep_alive_tmo}" ]]; then
 		ARGS+=(--keep-alive-tmo="${keep_alive_tmo}")
 	fi
-	if [[ -n "${reconnect_delay}" ]]; then
+	if ! _is_nvme_trtype loop &&
+	   [[ -n "${reconnect_delay}" ]]; then
 		ARGS+=(--reconnect-delay="${reconnect_delay}")
 	fi
 	if [[ -n "${ctrl_loss_tmo}" ]]; then
-- 
2.44.0




More information about the Linux-nvme mailing list