[PATCH blktests] common/nvme: reset def_adrfam for ipv4 case
Shin'ichiro Kawasaki
shinichiro.kawasaki at wdc.com
Fri Jan 16 21:04:59 PST 2026
From: Daniel Wagner <wagi at kernel.org>
When NVMET_TRTYPES specifies multiple transport types, blktests runs
each test case in the nvme group for each of the specified transport
types. When a test case is run for "fc" transport, it succeeds. However,
when following transport is "tcp" or "rdma", the test case fails.
This failure happens because the run for "fc" transport overrides the
global variable 'def_adrfam' with the value "fc". 'def_adrfam' is
initialized with "ipv4" when "common/nvme" is loaded, and it was assumed
that this value was not reused after the overwrite. However, since the
commit a16ac8e052d4 ("nvme/{002-031,033-038,040-045,047,048}: support
NMVET_TRTYPES"), the overwritten 'def_adrfam' is reused for other
transport types and the value "fc" causes failure for "tcp" or "rdma"
transports.
To ensure that 'def_adrfam' has correct values for "tcp" and "rdma"
transports even after test case runs for "fc" transport, initialize
the 'def_adrfam' with the value "ipv4". For the completeness, set "ipv4"
to 'def_adrfam' also when "nvme_adrfam" is specified.
Fixes: a16ac8e052d4 ("nvme/{002-031,033-038,040-045,047,048}: support NMVET_TRTYPES")
Link: https://github.com/linux-blktests/blktests/issues/217
Signed-off-by: Daniel Wagner <wagi at kernel.org>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
---
common/nvme | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/common/nvme b/common/nvme
index eed5db0..311b1b6 100644
--- a/common/nvme
+++ b/common/nvme
@@ -1190,6 +1190,7 @@ _nvme_requires() {
_have_driver nvme-tcp
_have_driver nvmet-tcp
_have_configfs
+ def_adrfam="ipv4"
;;
rdma)
_have_driver nvme-rdma
@@ -1201,6 +1202,7 @@ _nvme_requires() {
else
_have_driver siw
fi
+ def_adrfam="ipv4"
;;
fc)
_have_driver nvme-fc
@@ -1217,7 +1219,8 @@ _nvme_requires() {
def_adrfam="ipv6"
;;
ipv4)
- ;; # was already set
+ def_adrfam="ipv4"
+ ;;
fc)
def_adrfam="fc"
;;
--
2.52.0
More information about the Linux-nvme
mailing list