Skip to content

Commit 926b890

Browse files
igawkawasaki
authored andcommitted
common/nvme: reset def_adrfam for ipv4 case
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 a16ac8e ("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: a16ac8e ("nvme/{002-031,033-038,040-045,047,048}: support NMVET_TRTYPES") Link: #217 Signed-off-by: Daniel Wagner <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent b2dc1ec commit 926b890

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

common/nvme

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ _nvme_requires() {
11901190
_have_driver nvme-tcp
11911191
_have_driver nvmet-tcp
11921192
_have_configfs
1193+
def_adrfam="ipv4"
11931194
;;
11941195
rdma)
11951196
_have_driver nvme-rdma
@@ -1201,6 +1202,7 @@ _nvme_requires() {
12011202
else
12021203
_have_driver siw
12031204
fi
1205+
def_adrfam="ipv4"
12041206
;;
12051207
fc)
12061208
_have_driver nvme-fc
@@ -1217,7 +1219,8 @@ _nvme_requires() {
12171219
def_adrfam="ipv6"
12181220
;;
12191221
ipv4)
1220-
;; # was already set
1222+
def_adrfam="ipv4"
1223+
;;
12211224
fc)
12221225
def_adrfam="fc"
12231226
;;

0 commit comments

Comments
 (0)