diff mbox series

[blktests,v5,2/5] common/nvme: add digest options to __nvme_connect_subsys()

Message ID 20241206135120.5141-3-aaptel@nvidia.com (mailing list archive)
State New
Headers show
Series Add support to run against arbitrary targets | expand

Commit Message

Aurelien Aptel Dec. 6, 2024, 1:51 p.m. UTC
This commit lets tests connect nvme subsystems with data and header
digest.

Signed-off-by: Aurelien Aptel <aaptel@nvidia.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
---
 common/nvme | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Chaitanya Kulkarni Dec. 9, 2024, 7:19 a.m. UTC | #1
On 12/6/24 05:51, Aurelien Aptel wrote:
> This commit lets tests connect nvme subsystems with data and header
> digest.
>
> Signed-off-by: Aurelien Aptel<aaptel@nvidia.com>
> Reviewed-by: Daniel Wagner<dwagner@suse.de>
> ---


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck
diff mbox series

Patch

diff --git a/common/nvme b/common/nvme
index 887da4d..d909d42 100644
--- a/common/nvme
+++ b/common/nvme
@@ -271,6 +271,8 @@  _nvme_connect_subsys() {
 	local reconnect_delay=""
 	local ctrl_loss_tmo=""
 	local no_wait=false
+	local hdr_digest=false
+	local data_digest=false
 	local port
 	local i
 	local -a ARGS
@@ -329,6 +331,14 @@  _nvme_connect_subsys() {
 				no_wait=true
 				shift 1
 				;;
+			--hdr-digest)
+				hdr_digest=true
+				shift 1
+				;;
+			--data-digest)
+				data_digest=true
+				shift 1
+				;;
 			*)
 				echo "WARNING: unknown argument: $1"
 				shift
@@ -380,6 +390,12 @@  _nvme_connect_subsys() {
 	if [[ -n "${ctrl_loss_tmo}" ]]; then
 		ARGS+=(--ctrl-loss-tmo="${ctrl_loss_tmo}")
 	fi
+	if [[ ${hdr_digest} = true ]]; then
+		ARGS+=(--hdr-digest)
+	fi
+	if [[ ${data_digest} = true ]]; then
+		ARGS+=(--data-digest)
+	fi
 	ARGS+=(-o json)
 	connect=$(nvme connect "${ARGS[@]}" 2> /dev/null)