* [PATCH blktests] common/nvme: reset def_adrfam for ipv4 case
@ 2026-01-17 5:04 Shin'ichiro Kawasaki
2026-01-24 12:31 ` Shinichiro Kawasaki
0 siblings, 1 reply; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-01-17 5:04 UTC (permalink / raw)
To: linux-nvme; +Cc: Daniel Wagner, Shin'ichiro Kawasaki
From: Daniel Wagner <wagi@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@kernel.org>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH blktests] common/nvme: reset def_adrfam for ipv4 case
2026-01-17 5:04 [PATCH blktests] common/nvme: reset def_adrfam for ipv4 case Shin'ichiro Kawasaki
@ 2026-01-24 12:31 ` Shinichiro Kawasaki
0 siblings, 0 replies; 2+ messages in thread
From: Shinichiro Kawasaki @ 2026-01-24 12:31 UTC (permalink / raw)
To: linux-nvme@lists.infradead.org; +Cc: Daniel Wagner
On Jan 17, 2026 / 14:04, Shin'ichiro Kawasaki wrote:
> From: Daniel Wagner <wagi@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@kernel.org>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
FYI, I applied this patch.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-24 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-17 5:04 [PATCH blktests] common/nvme: reset def_adrfam for ipv4 case Shin'ichiro Kawasaki
2026-01-24 12:31 ` Shinichiro Kawasaki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox