Skip to contentSkip to conversation

tests/nvme: Set clear_ids for passthru targets

PATCH Applied Alan Adamson 3 participants 6 messages Jul 5, 2022 – Jul 15, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/nvme: Set clear_ids for passthru targets

This allows to connect to passthru targets when the client and target are on the same host.

---
 tests/nvme/rc | 3 +++
 1 file changed, 3 insertions(+)
tests/nvme/rc +3 -0
index 4bebbc762cbb..5e50e69fb3f0 100644
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
 
 	_test_dev_nvme_ctrl > "${passthru_path}/device_path"
 	echo 1 > "${passthru_path}/enable"
+	if [ -f "${passthru_path}/clear_ids" ]; then
+		echo 1 > "${passthru_path}/clear_ids"
+	fi
 }
 
 _remove_nvmet_passhtru() {
Signature · 1 line
2.31.1
#1 lore raw
Quoted 13 lines · Alan Adamson

This allows to connect to passthru targets when the client and target are on the same host.

---
  tests/nvme/rc | 3 +++
  1 file changed, 3 insertions(+)
tests/nvme/rc +0 -0
index 4bebbc762cbb..5e50e69fb3f0 100644

tests/nvme/rc _create_nvmet_passthru() { · line 311

Quoted 9 lines
tests/nvme/rc +3 -0
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
 
  	_test_dev_nvme_ctrl > "${passthru_path}/device_path"
  	echo 1 > "${passthru_path}/enable"
+	if [ -f "${passthru_path}/clear_ids" ]; then
+		echo 1 > "${passthru_path}/clear_ids"
+	fi
  }
 
  _remove_nvmet_passhtru() {

without looking into the code, just wondering whether we need an explicit check to ensure that both host and target on the same machine something like checking nvme_trtype=loop ?

-ck

#2 lore raw
Quoted 26 lines · Chaitanya Kulkarni
Quoted 21 lines · Alan Adamson

This allows to connect to passthru targets when the client and target are on the same host.

---
 tests/nvme/rc | 3 +++
 1 file changed, 3 insertions(+)
tests/nvme/rc +3 -0
index 4bebbc762cbb..5e50e69fb3f0 100644
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
 
 	_test_dev_nvme_ctrl > "${passthru_path}/device_path"
 	echo 1 > "${passthru_path}/enable"
+	if [ -f "${passthru_path}/clear_ids" ]; then
+		echo 1 > "${passthru_path}/clear_ids"
+	fi
 }
 
Quoted 5 lines

tests/nvme/rc _create_nvmet_passthru() { · line 311

Quoted 1 line
tests/nvme/rc +0 -0
 _remove_nvmet_passhtru() {

without looking into the code, just wondering whether we need an explicit check to ensure that both host and target on the same machine something like checking nvme_trtype=loop ?

If nvme_trtype=loop, this code isn’t necessary because loop defaults to clear_ids, but it is necessary for tcp and rdma. The check is for necessary when running a pre 5.19 kernel where clear_ids isn’t present just to prevent a error message.

Alan

#3 lore raw
Quoted 36 lines · Alan Adamson
Quoted 27 lines · Chaitanya Kulkarni
Quoted 21 lines · Alan Adamson

This allows to connect to passthru targets when the client and target are on the same host.

---
tests/nvme/rc | 3 +++

1 file changed, 3 insertions(+)
tests/nvme/rc +3 -0
index 4bebbc762cbb..5e50e69fb3f0 100644
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
 
 	_test_dev_nvme_ctrl > "${passthru_path}/device_path"
 	echo 1 > "${passthru_path}/enable"
+	if [ -f "${passthru_path}/clear_ids" ]; then
+		echo 1 > "${passthru_path}/clear_ids"
+	fi
 }
 
Quoted 5 lines

tests/nvme/rc _create_nvmet_passthru() { · line 311

Quoted 1 line
tests/nvme/rc +0 -0
 _remove_nvmet_passhtru() {

without looking into the code, just wondering whether we need an explicit check to ensure that both host and target on the same machine something like checking nvme_trtype=loop ?

Quoted 6 lines

If nvme_trtype=loop, this code isn’t necessary because loop defaults to clear_ids, but it is necessary for tcp and rdma. The check is for necessary when running a pre 5.19 kernel where clear_ids isn’t present just to prevent a error message.

Alan

Any other comments or feedback?

Alan

#4 lore raw
Quoted 36 lines · Alan Adamson
Quoted 36 lines · Alan Adamson
Quoted 32 lines · Chaitanya Kulkarni
Quoted 13 lines · Alan Adamson

This allows to connect to passthru targets when the client and target are on the same host.

---
tests/nvme/rc | 3 +++

1 file changed, 3 insertions(+)
tests/nvme/rc +0 -0
index 4bebbc762cbb..5e50e69fb3f0 100644

tests/nvme/rc _create_nvmet_passthru() { · line 311

Quoted 9 lines
tests/nvme/rc +3 -0
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
 
 	_test_dev_nvme_ctrl > "${passthru_path}/device_path"
 	echo 1 > "${passthru_path}/enable"
+	if [ -f "${passthru_path}/clear_ids" ]; then
+		echo 1 > "${passthru_path}/clear_ids"
+	fi
 }
 
 _remove_nvmet_passhtru() {

without looking into the code, just wondering whether we need an explicit check to ensure that both host and target on the same machine something like checking nvme_trtype=loop ?

Quoted 8 lines
Quoted 6 lines

If nvme_trtype=loop, this code isn’t necessary because loop defaults to clear_ids, but it is necessary for tcp and rdma. The check is for necessary when running a pre 5.19 kernel where clear_ids isn’t present just to prevent a error message.

Alan

Any other comments or feedback?

I've applied the patch with an edit to replace single bracket to double brackets. Wish this edit is ok for you. Thanks!

Signature · 1 line
Shin'ichiro Kawasaki
#5 lore raw
Quoted 46 lines · Shinichiro Kawasaki
Quoted 41 lines · Alan Adamson
Quoted 41 lines · Alan Adamson
Quoted 27 lines · Chaitanya Kulkarni
Quoted 21 lines · Alan Adamson

This allows to connect to passthru targets when the client and target are on the same host.

---
tests/nvme/rc | 3 +++

1 file changed, 3 insertions(+)
tests/nvme/rc +3 -0
index 4bebbc762cbb..5e50e69fb3f0 100644
@@ -303,6 +303,9 @@ _create_nvmet_passthru() {
 
 	_test_dev_nvme_ctrl > "${passthru_path}/device_path"
 	echo 1 > "${passthru_path}/enable"
+	if [ -f "${passthru_path}/clear_ids" ]; then
+		echo 1 > "${passthru_path}/clear_ids"
+	fi
 }
 
Quoted 5 lines

tests/nvme/rc _create_nvmet_passthru() { · line 311

Quoted 1 line
tests/nvme/rc +0 -0
 _remove_nvmet_passhtru() {

without looking into the code, just wondering whether we need an explicit check to ensure that both host and target on the same machine something like checking nvme_trtype=loop ?

If nvme_trtype=loop, this code isn’t necessary because loop defaults to clear_ids, but it is necessary for tcp and rdma. The check is for necessary when running a pre 5.19 kernel where clear_ids isn’t present just to prevent a error message.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Alan

Any other comments or feedback?

I've applied the patch with an edit to replace single bracket to double brackets. Wish this edit is ok for you. Thanks!

Looks good.

Thanks!

Alan

Quoted 3 lines
Signature · 2 lines
-- 
Shin'ichiro Kawasaki