From patchwork Wed Sep 30 18:54:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810137 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62A9A174A for ; Wed, 30 Sep 2020 19:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F147206A1 for ; Wed, 30 Sep 2020 19:14:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="ZQOD/b/n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729890AbgI3TOu (ORCPT ); Wed, 30 Sep 2020 15:14:50 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37978 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729872AbgI3TOt (ORCPT ); Wed, 30 Sep 2020 15:14:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tJSHvT1QhRVl+G04VHp6oB+MDJJauXzKMIhMmzCIDDM=; b=ZQOD/b/n4WQ66CxWM/hXXEMnhK 0NYEsye4QqL616Iw5u2GZboX3lty9Lq8lZODHVzOUhB+y/DLrbg7HypDABv4UYvUlcUw5kqtbTiMH QLIUfPGgkbYILPEtkuOAkxbd58IF+JnPtt5OAh1kSlSdaMjQqdd3P1l+y9GbDHGSDI9IqkJoEge6w XA1uld3DMwjGPmttwaMbphFCu3uoTSoe24ac18NwOnAtu1tOlzQfhK0TdNMeMFr1cIL2c6TRidfjJ WuW3uazKXx+d2/mmmJ18YzLhdNXvzGB5I4MQiry+tHnJ/tw/glq2TuPpcm5DaT3Wq/lPAuxpHLn9U IfEC3Vbw==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFE-0000ux-52; Wed, 30 Sep 2020 12:54:32 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030L-6Z; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe , Chaitanya Kulkarni Date: Wed, 30 Sep 2020 12:54:12 -0600 Message-Id: <20200930185422.11494-2-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, sbates@raithlin.com, logang@deltatee.com, Chaitanya.Kulkarni@wdc.com, chaitanya.kulkarni@wdc.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 01/11] common/fio: Remove state file in common helper X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Instead of each individual test removing this file, just do it in the common helper. Signed-off-by: Logan Gunthorpe Reviewed-by: Chaitanya Kulkarni --- common/fio | 1 + tests/nvme/010 | 1 - tests/nvme/011 | 1 - tests/nvme/012 | 1 - tests/nvme/013 | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/fio b/common/fio index 8bfad4238dda..94c65c107a14 100644 --- a/common/fio +++ b/common/fio @@ -181,6 +181,7 @@ _run_fio_rand_io() { _run_fio_verify_io() { _run_fio --name=verify --rw=randwrite --direct=1 --ioengine=libaio --bs=4k \ --iodepth=16 --verify=crc32c "$@" + rm -f local*verify*state } _fio_perf_report() { diff --git a/tests/nvme/010 b/tests/nvme/010 index 9d96d7803be3..0188e842213e 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -52,7 +52,6 @@ test() { losetup -d "${loop_dev}" rm "${file_path}" - rm -f local*verify*state echo "Test complete" } diff --git a/tests/nvme/011 b/tests/nvme/011 index 06dc568fb6ea..543dbe840874 100755 --- a/tests/nvme/011 +++ b/tests/nvme/011 @@ -48,7 +48,6 @@ test() { _remove_nvmet_port "${port}" rm "${file_path}" - rm -f local-write-and-verify*state echo "Test complete" } diff --git a/tests/nvme/012 b/tests/nvme/012 index 8110430e49d4..1dbd59804ed7 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -63,7 +63,6 @@ test() { losetup -d "${loop_dev}" - rm -f local*verify*state rm "${file_path}" rm -fr "${mount_dir}" diff --git a/tests/nvme/013 b/tests/nvme/013 index 176b11b9ccb5..df7f23e69252 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -58,7 +58,6 @@ test() { _remove_nvmet_subsystem "${subsys_name}" _remove_nvmet_port "${port}" - rm -f local*verify*state rm "${file_path}" rm -fr "${mount_dir}" From patchwork Wed Sep 30 18:54:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810151 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41FD8139A for ; Wed, 30 Sep 2020 19:14:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20AEA20709 for ; Wed, 30 Sep 2020 19:14:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="N40fcAv7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729992AbgI3TO5 (ORCPT ); Wed, 30 Sep 2020 15:14:57 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37998 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729936AbgI3TO5 (ORCPT ); Wed, 30 Sep 2020 15:14:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jmZbySZXjmmi8+BukunACpKuNnADqVJZ1o4R+xzQg+E=; b=N40fcAv78b/blRHBFQYip0COej g6RB480BZooR2bMyuinVdWeMW1oRMnxaTl1evqDkqSmk/6Z/EvqACVHNlU1VZvKZvZlAcxvIs85xu CkFUi0Dx2tfwqW7I42N4Wb6I54wkefoRTe+377YPLq1gSZJLWGmi0poVqyzLYA7F/5KhA381m43J7 B8LldDmMJYKN74phHMAVYq+d7fCO7z2tZmzHpDicuFhche8NI8uNOgtLiRm1XMBB90aZti8/AfefW J7XgCoup8FBfXfC0koE9TQjQdSr36HXa0tIw1UEPzUDPsg1c/FEpys6E7fjPGVOTaTc3OQXbXKUd/ dCEM/K0g==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFE-0000uy-4y; Wed, 30 Sep 2020 12:54:29 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030O-CH; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:13 -0600 Message-Id: <20200930185422.11494-3-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 02/11] common/xfs: Create common helper to check for XFS support X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Two nvme tests create and mount XFS filesystems and check for mkfs.xfs. They should also check for XFS support in the kernel so create a common helper for this. Signed-off-by: Logan Gunthorpe --- common/rc | 8 ++++++++ common/xfs | 11 +++++++++++ tests/nvme/012 | 6 ++++-- tests/nvme/013 | 4 +++- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 common/xfs diff --git a/common/rc b/common/rc index cdc0150ea5ea..44cb218c2fac 100644 --- a/common/rc +++ b/common/rc @@ -181,6 +181,14 @@ _have_tracepoint() { return 0 } +_have_fs() { + modprobe "$1" >/dev/null 2>&1 + if [[ ! -d "/sys/fs/$1" ]]; then + SKIP_REASON="kernel does not support filesystem $1" + return 1 + fi +} + _test_dev_is_rotational() { [[ $(cat "${TEST_DEV_SYSFS}/queue/rotational") -ne 0 ]] } diff --git a/common/xfs b/common/xfs new file mode 100644 index 000000000000..d1a603b8c7b5 --- /dev/null +++ b/common/xfs @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2017 Omar Sandoval +# +# fio helper functions. + +. common/shellcheck + +_have_xfs() { + _have_fs xfs && _have_program mkfs.xfs +} diff --git a/tests/nvme/012 b/tests/nvme/012 index 1dbd59804ed7..1d8d8e3cc271 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -5,14 +5,16 @@ # Test mkfs with data verification for block device backed ns. . tests/nvme/rc +. common/xfs DESCRIPTION="run mkfs and data verification fio job on NVMeOF block device-backed ns" TIMED=1 requires() { _nvme_requires - _have_program mkfs.xfs && _have_program fio && \ - _have_modules loop + _have_xfs + _have_program fio + _have_modules loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/013 b/tests/nvme/013 index df7f23e69252..3819a2730d9b 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -5,13 +5,15 @@ # Test mkfs with data verification for file backed ns. . tests/nvme/rc +. common/xfs DESCRIPTION="run mkfs and data verification fio job on NVMeOF file-backed ns" TIMED=1 requires() { _nvme_requires - _have_program mkfs.xfs && _have_fio + _have_xfs + _have_fio _require_nvme_trtype_is_fabrics } From patchwork Wed Sep 30 18:54:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810133 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1EEFC112E for ; Wed, 30 Sep 2020 19:14:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB85220709 for ; Wed, 30 Sep 2020 19:14:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="e8n/Ppuj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725814AbgI3TOs (ORCPT ); Wed, 30 Sep 2020 15:14:48 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37974 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729851AbgI3TOs (ORCPT ); Wed, 30 Sep 2020 15:14:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6OG5y6dqCpzubmOr4AhBg3Vthy6MFMXRPZfk6ASRz7I=; b=e8n/PpujXwHewttFCTN3g05e2l 6OZDOjEX6w+spQNqUrxngwO7wQr6U8JegQtm3CNycebzK9K1oz0Rn/ujWVSUt0Vsw6z7yU8ksQAbd SppQ2oWufp6hMOM3QEAHgEjf0f93LtIOH6wt7cmv74yXXp3AZqdZF/g7RSJ9015cq+tExFYazNzdE cUkv7b6GGnil3Qe0zXwJmHggt+K4vOZ7MV4AUmNbqazo/zhLIKqOa3bKDjWsfRGjB4vdYvcro7NLE VWsSIZ7u5Hx278ASVBhz18YWSo5vBSR3cR81xtNMZ/TmkMcNV6hipqiGCchZkhrrFlVyuJpYgsT4w ly/wudNQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFE-0000uz-4y; Wed, 30 Sep 2020 12:54:31 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030R-G2; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:14 -0600 Message-Id: <20200930185422.11494-4-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 03/11] common/xfs: Create common helper to verify block device with xfs X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Make a common helper from the code in tests nvme/012 and nvme/013 to run an fio verify on a XFS file system backed by the specified block device. While we are at it, all the output is redirected to $FULL instead of /dev/null. Signed-off-by: Logan Gunthorpe --- common/xfs | 22 ++++++++++++++++++++++ tests/nvme/012 | 14 +------------- tests/nvme/013 | 14 +------------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/common/xfs b/common/xfs index d1a603b8c7b5..210c924cdd41 100644 --- a/common/xfs +++ b/common/xfs @@ -9,3 +9,25 @@ _have_xfs() { _have_fs xfs && _have_program mkfs.xfs } + +_xfs_mkfs_and_mount() { + local bdev=$1 + local mount_dir=$2 + + mkdir -p "${mount_dir}" + umount "${mount_dir}" + mkfs.xfs -l size=32m -f "${bdev}" + mount "${bdev}" "${mount_dir}" +} + +_xfs_run_fio_verify_io() { + local mount_dir="/mnt/blktests" + local bdev=$1 + + _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 + + _run_fio_verify_io --size=950m --directory="${mount_dir}/" + + umount "${mount_dir}" >> "${FULL}" 2>&1 + rm -fr "${mount_dir}" +} diff --git a/tests/nvme/012 b/tests/nvme/012 index 1d8d8e3cc271..a13cd08ce6bf 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -26,12 +26,9 @@ test() { local port local nvmedev local loop_dev - local mount_dir="/mnt/blktests" local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - mkdir -p "${mount_dir}" > /dev/null 2>&1 - truncate -s 1G "${file_path}" loop_dev="$(losetup -f --show "${file_path}")" @@ -47,15 +44,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - umount ${mount_dir} > /dev/null 2>&1 - - mkfs.xfs -l size=32m -f /dev/"${nvmedev}n1" > /dev/null 2>&1 - - mount /dev/"${nvmedev}n1" "${mount_dir}" - - _run_fio_verify_io --size=950m --directory="${mount_dir}/" - - umount "${mount_dir}" > /dev/null 2>&1 + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" @@ -66,7 +55,6 @@ test() { losetup -d "${loop_dev}" rm "${file_path}" - rm -fr "${mount_dir}" echo "Test complete" } diff --git a/tests/nvme/013 b/tests/nvme/013 index 3819a2730d9b..1ac725ea83f2 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -24,13 +24,10 @@ test() { local port local nvmedev - local mount_dir="/mnt/blktests/" local file_path="${TMPDIR}/img" local subsys_name="blktests-subsystem-1" - mkdir -p "${mount_dir}" > /dev/null 2>&1 - truncate -s 1G "${file_path}" _create_nvmet_subsystem "${subsys_name}" "${file_path}" \ @@ -44,15 +41,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - umount ${mount_dir} > /dev/null 2>&1 - - mkfs.xfs -l size=32m -f /dev/"${nvmedev}n1" > /dev/null 2>&1 - - mount /dev/"${nvmedev}n1" "${mount_dir}" - - _run_fio_verify_io --size=800m --directory="${mount_dir}/" - - umount "${mount_dir}" > /dev/null 2>&1 + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" @@ -61,7 +50,6 @@ test() { _remove_nvmet_port "${port}" rm "${file_path}" - rm -fr "${mount_dir}" echo "Test complete" } From patchwork Wed Sep 30 18:54:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810141 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B0611668 for ; Wed, 30 Sep 2020 19:14:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D32E220709 for ; Wed, 30 Sep 2020 19:14:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="Pj37EpSN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729872AbgI3TOw (ORCPT ); Wed, 30 Sep 2020 15:14:52 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37982 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729893AbgI3TOv (ORCPT ); Wed, 30 Sep 2020 15:14:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2H5pnlIGgr783fyjVRGozSxgfc3nLB2Pz4M+rb66lZs=; b=Pj37EpSNa2rGo+bkeVxQVt/lHZ YvgAIygg6kAhcQUut4fpdoEh1xL8+JjCdUxIoBtGo9oGFGbZMTfrSV79mqYEvar4JTYih0L46TgyB DCIooj0+Nm97IvpOOCHXLj0T95L5UycDJhB0ExREbefSAs/qaiOGix6ecvUsh0U5DGAx8ayMhb8dm K3gzQb5z3Yid3p4BqZIrACx/pL4Zn0gqq9Wz7Nsga2hRgV+/cOH+mVzmHnjyHG/dS+DEWM8RVmCGB vlAieXSoLQFPjljcNmrPWf52Y+R58iON0oNNZyfzdYjlGQKoNtzb/w5b7XSQmRjTuLwwmCNkTc0DA 72J7zO/g==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFE-0000v0-4y; Wed, 30 Sep 2020 12:54:30 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030U-J2; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:15 -0600 Message-Id: <20200930185422.11494-5-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 04/11] nvme: Search for specific subsysnqn in _find_nvme_loop_dev X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This ensures we find the correct nvme loop device if others exist on a given system (which is generally not expected on test systems). Additionally, this will be required in the upcomming test nvme/037 which will have controllers racing with ones being destroyed. Signed-off-by: Logan Gunthorpe --- tests/nvme/004 | 2 +- tests/nvme/005 | 2 +- tests/nvme/008 | 2 +- tests/nvme/009 | 2 +- tests/nvme/010 | 2 +- tests/nvme/011 | 2 +- tests/nvme/012 | 2 +- tests/nvme/013 | 2 +- tests/nvme/014 | 2 +- tests/nvme/015 | 2 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/020 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 2 +- tests/nvme/rc | 7 ++++--- 23 files changed, 26 insertions(+), 25 deletions(-) diff --git a/tests/nvme/004 b/tests/nvme/004 index dfca79aab20c..4b0b7ae50a5e 100755 --- a/tests/nvme/004 +++ b/tests/nvme/004 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" blktests-subsystem-1 local nvmedev - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "blktests-subsystem-1") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/005 b/tests/nvme/005 index 0d5801868bc0..9f3e388dc695 100755 --- a/tests/nvme/005 +++ b/tests/nvme/005 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" blktests-subsystem-1 local nvmedev - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "blktests-subsystem-1") udevadm settle diff --git a/tests/nvme/008 b/tests/nvme/008 index 8616617ad398..219fe9b0ca6a 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/009 b/tests/nvme/009 index e91d79065cb1..2814c79164ee 100755 --- a/tests/nvme/009 +++ b/tests/nvme/009 @@ -33,7 +33,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/010 b/tests/nvme/010 index 0188e842213e..150a4e540f3e 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/011 b/tests/nvme/011 index 543dbe840874..4bfe9af084e4 100755 --- a/tests/nvme/011 +++ b/tests/nvme/011 @@ -35,7 +35,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/012 b/tests/nvme/012 index a13cd08ce6bf..c4e75b09796a 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -40,7 +40,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/013 b/tests/nvme/013 index 1ac725ea83f2..265b6968fd34 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/014 b/tests/nvme/014 index e3c70364e332..48f8caaec0b3 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/015 b/tests/nvme/015 index 46fa4f605749..e33cfde5d72e 100755 --- a/tests/nvme/015 +++ b/tests/nvme/015 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/018 b/tests/nvme/018 index 6d7934d09d99..7f407da2ce19 100755 --- a/tests/nvme/018 +++ b/tests/nvme/018 @@ -35,7 +35,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/019 b/tests/nvme/019 index 486b5acff713..8259e2e0c157 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -39,7 +39,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/020 b/tests/nvme/020 index c8053f440e2e..16fdfcc94918 100755 --- a/tests/nvme/020 +++ b/tests/nvme/020 @@ -35,7 +35,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/021 b/tests/nvme/021 index f543a1d8fd92..fb77f9cbd99f 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/022 b/tests/nvme/022 index e824ed31f6f0..62c4690e35fe 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/023 b/tests/nvme/023 index bdef3dc8abca..bce21b56c9f1 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -37,7 +37,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/024 b/tests/nvme/024 index 78f779e8a08a..ffec36cf3333 100755 --- a/tests/nvme/024 +++ b/tests/nvme/024 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/025 b/tests/nvme/025 index 223430965d7e..3d3f01bc45fd 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/026 b/tests/nvme/026 index 7f82284d9c57..2f5607793cd3 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/027 b/tests/nvme/027 index da96e6c5008d..53f06646a3d0 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/028 b/tests/nvme/028 index f826b67623f1..3d9084f18636 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -34,7 +34,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/029 b/tests/nvme/029 index 5bed9b8e70ae..960e5f5a63bf 100755 --- a/tests/nvme/029 +++ b/tests/nvme/029 @@ -70,7 +70,7 @@ test() { _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" - nvmedev="$(_find_nvme_dev)" + nvmedev=$(_find_nvme_dev "${subsys_name}") cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" diff --git a/tests/nvme/rc b/tests/nvme/rc index 4c5b2e8edf0d..dfa57a299625 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -273,12 +273,13 @@ _remove_nvmet_subsystem_from_port() { } _find_nvme_dev() { + local subsys=$1 + local subsysnqn local dev - local transport for dev in /sys/class/nvme/nvme*; do dev="$(basename "$dev")" - transport="$(cat "/sys/class/nvme/${dev}/transport")" - if [[ "$transport" == "${nvme_trtype}" ]]; then + subsysnqn="$(cat "/sys/class/nvme/${dev}/subsysnqn")" + if [[ "$subsysnqn" == "$subsys" ]]; then echo "$dev" for ((i = 0; i < 10; i++)); do if [[ -e /sys/block/$dev/uuid && From patchwork Wed Sep 30 18:54:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810131 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C9E2112E for ; Wed, 30 Sep 2020 19:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 455CC20709 for ; Wed, 30 Sep 2020 19:14:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="KK11XwRL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729865AbgI3TOr (ORCPT ); Wed, 30 Sep 2020 15:14:47 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37970 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbgI3TOr (ORCPT ); Wed, 30 Sep 2020 15:14:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bzjNTcoiLhUgERqUAyZo5rx6zkhqOtriV/S0uELJa2Y=; b=KK11XwRLGOHjGJ8QkJt+uNjaKr 7WiKVaU9h+8+Ff0BaRrSoRa4rvJQSoMWM3TPeYzlFRFn4yQ8PAt78ZCYaEtKattI4gi2zrTJymmj6 nsQlV94R2dEFnDEh1QCaANT5Rsp+D5EA1S+PW56RpN4drfp6goRYhTngWCax6QSaqnV+st5487zPZ Du3X0Kp3CXyLSc35mFZRhT5VVN5SKaOkFojYP9E8KBggk4Wi6Z89pyDT9uZPVPznXLQLIhPDjFrOX pAG7wpUUu4bFimtFzBkrA56SYLGoCBLAgMTijtI9eKHTC1vYhDqdfKBDNSySAfpoi6UkjweUE2hWb pEBjlQTA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFL-0000uw-24; Wed, 30 Sep 2020 12:54:35 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030X-MX; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:16 -0600 Message-Id: <20200930185422.11494-6-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 05/11] nvme: Add common helpers for passthru tests X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add some simple helpers to setup a passthru target that passes through to a nvme test device. Signed-off-by: Logan Gunthorpe --- tests/nvme/rc | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/tests/nvme/rc b/tests/nvme/rc index dfa57a299625..1ea23308a3f7 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -73,6 +73,17 @@ _require_nvme_trtype_is_fabrics() { return 0 } +_test_dev_nvme_ctrl() { + local dev + + dev=$(cat "${TEST_DEV_SYSFS}/device/dev") + echo "/dev/char/${dev}" +} + +_test_dev_nvme_nsid() { + cat "${TEST_DEV_SYSFS}/nsid" +} + _cleanup_nvmet() { local dev local port @@ -257,6 +268,27 @@ _remove_nvmet_subsystem() { rmdir "${subsys_path}" } +_create_nvmet_passthru() { + local nvmet_subsystem="$1" + local subsys_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}" + local passthru_path="${subsys_path}/passthru" + + mkdir -p "${subsys_path}" + printf 1 > "${subsys_path}/attr_allow_any_host" + + printf "%s" "$(_test_dev_nvme_ctrl)" > "${passthru_path}/device_path" + printf 1 > "${passthru_path}/enable" +} + +_remove_nvmet_passhtru() { + local nvmet_subsystem="$1" + local subsys_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}" + local passthru_path="${subsys_path}/passthru" + + printf 0 > "${passthru_path}/enable" + rmdir "${subsys_path}" +} + _add_nvmet_subsys_to_port() { local port="$1" local nvmet_subsystem="$2" @@ -292,6 +324,50 @@ _find_nvme_dev() { done } +_find_nvme_passthru_loop_dev() { + local subsys=$1 + local nsid + local dev + + dev=$(_find_nvme_dev "${subsys}") + nsid=$(_test_dev_nvme_nsid) + echo "/dev/${dev}n${nsid}" +} + +_nvmet_passthru_target_setup() { + local subsys_name=$1 + + _create_nvmet_passthru "${subsys_name}" + port="$(_create_nvmet_port "loop")" + _add_nvmet_subsys_to_port "${port}" "${subsys_name}" + + echo "$port" +} + +_nvmet_passthru_target_connect() { + local trtype=$1 + local subsys_name=$2 + + _nvme_connect_subsys "${trtype}" "${subsys_name}" + nsdev=$(_find_nvme_passthru_loop_dev "${subsys_name}") + + # The following tests can race with the creation + # of the device so ensure the block device exists + # before continuing + while [ ! -b "${nsdev}" ]; do sleep 1; done + + echo "${nsdev}" +} + +_nvmet_passthru_target_cleanup() { + local port=$1 + local subsys_name=$2 + + _remove_nvmet_subsystem_from_port "${port}" "${subsys_name}" + _remove_nvmet_port "${port}" + _remove_nvmet_passhtru "${subsys_name}" +} + _filter_discovery() { sed -n -r -e "s/Generation counter [0-9]+/Generation counter X/" \ -e '/Discovery Log Number|Log Entry|trtype|subnqn/p' From patchwork Wed Sep 30 18:54:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810139 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99D08139A for ; Wed, 30 Sep 2020 19:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76607206A1 for ; Wed, 30 Sep 2020 19:14:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="bwsWTfFj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729912AbgI3TOv (ORCPT ); Wed, 30 Sep 2020 15:14:51 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37980 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729872AbgI3TOu (ORCPT ); Wed, 30 Sep 2020 15:14:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AypN6BiW5IZls5gXpg36zLOXH+Gz+gN2WSrQr0Ie4nM=; b=bwsWTfFjsUOMn+Fx8u+4+wJzNI 27bEpULOOQr5ECY0uEppTVtEGqDngvKfBO5vavk0t/JhSdU0isc9dkF/0ZKVRu+EqyEDaNWyRQcYA iC4C2AWh4+lSLeA2bdSJj7483YBzS40fWK2goweEpLNwdfYNnFCqHFxW0qIuh2QZGlJr49wlkO9a6 mnbIisuc2GKdh8UuBCAvbu6oC+I5eGTw1xTFLUZfdIJXMwoZh5hUXbWXfN3IGnBBy9mttGdxuifh9 U39tPmZyHx+xlOLTqRfTsFc0UkATCPYtiUqpGxayewl2DLn8kRQyovCeXBLD3jtPNjhp8//vhmc9I ZVUFeQtA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFK-0000ux-OD; Wed, 30 Sep 2020 12:54:35 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030a-PW; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:17 -0600 Message-Id: <20200930185422.11494-7-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 06/11] nvme/033: Simple test to create and connect to a passthru target X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This tests creates and connects to a passthru controller backed by a test NVMe namespace. It then verifies that some common fields in id-ctrl and id-ns are the same in the target and the orginial device. Signed-off-by: Logan Gunthorpe --- tests/nvme/033 | 67 ++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/033.out | 7 +++++ 2 files changed, 74 insertions(+) create mode 100755 tests/nvme/033 create mode 100644 tests/nvme/033.out diff --git a/tests/nvme/033 b/tests/nvme/033 new file mode 100755 index 000000000000..c6a3f7feb50e --- /dev/null +++ b/tests/nvme/033 @@ -0,0 +1,67 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. + +. tests/nvme/rc + +DESCRIPTION="create and connect to an NVMeOF target with a passthru controller" +QUICK=1 + +requires() { + _nvme_requires + _have_kernel_option NVME_TARGET_PASSTHRU +} + +nvme_info() { + local ns=$1 + + nvme id-ctrl "${ns}" | grep -E '^(vid|sn|mn|fr) ' + nvme id-ns "${ns}" | grep -E '^(nsze|ncap) ' +} + +compare_dev_info() { + local passthru_dev=$1 + local testdev_info + local passthru_info + + testdev_info=$(nvme_info "${TEST_DEV}") + passthru_info=$(nvme_info "${passthru_dev}") + + cat >> "${FULL}" <<- EOF + + Test Device ${TEST_DEV} Info: + $testdev_info + + Passthru Device ${passthru_dev} Info: + $passthru_info + + EOF + + diff -u <(echo "${testdev_info}") <(echo "${passthru_info}") + if [[ "${testdev_info}" != "${passthru_info}" ]]; then + echo "ERROR: Device information does not match! (See ${FULL})" + fi +} + +test_device() { + local subsys="blktests-subsystem-1" + local nsdev + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + port=$(_nvmet_passthru_target_setup "${subsys}") + + _nvme_discover "${nvme_trtype}" | _filter_discovery + + nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") + + compare_dev_info "${nsdev}" + + _nvme_disconnect_subsys "${subsys}" + _nvmet_passthru_target_cleanup "${port}" "${subsys}" + + echo "Test complete" +} diff --git a/tests/nvme/033.out b/tests/nvme/033.out new file mode 100644 index 000000000000..6f45a1d5ec1d --- /dev/null +++ b/tests/nvme/033.out @@ -0,0 +1,7 @@ +Running nvme/033 +Discovery Log Number of Records 1, Generation counter X +=====Discovery Log Entry 0====== +trtype: loop +subnqn: blktests-subsystem-1 +NQN:blktests-subsystem-1 disconnected 1 controller(s) +Test complete From patchwork Wed Sep 30 18:54:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810145 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16138139A for ; Wed, 30 Sep 2020 19:14:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5C3E20709 for ; Wed, 30 Sep 2020 19:14:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="ZsyQXwAG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729978AbgI3TOy (ORCPT ); Wed, 30 Sep 2020 15:14:54 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37990 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729951AbgI3TOy (ORCPT ); Wed, 30 Sep 2020 15:14:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dRhTU5egtsuAbRoCt9iZRQVEqJW0euthW3iPPBDaKV8=; b=ZsyQXwAGVI87wmdTxjr9wYGN+N yWHejzrpTR59R3WvoTrdOFStHQtfY4QoS6BXXAB/ExGLW9KTLeTA9+26x+WusBL+9TyFfGTwyMSMC ZgMl2pdnkMOGLnlyWcwGO9vr6tHUWQoJNmBd2zQ5l+GwawtWrKfjCfjB8+FCoQoZo2zlhA0DnB5HA mJkvToFgbDsh5yAePhRlPTlLf/t1BIBWRjoNoudrVOOQL608/ZRDNvP7Xx1uY38MdUq98QzFJ7XlP ktqnNVG510V8JLxtmllA+XDhsHIgkmc7ZB9hO6STFQJLitl2sI/B4OEx4yV+7PUeEmhdgNG5mZht5 ORMORCdg==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFK-0000uy-3T; Wed, 30 Sep 2020 12:54:34 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFD-00030d-Tp; Wed, 30 Sep 2020 12:54:27 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:18 -0600 Message-Id: <20200930185422.11494-8-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 07/11] nvme/034: Add test for passthru data verification X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Similar to test nvme/010 and nvme/011 but for a passthru controller Signed-off-by: Logan Gunthorpe --- tests/nvme/034 | 35 +++++++++++++++++++++++++++++++++++ tests/nvme/034.out | 3 +++ 2 files changed, 38 insertions(+) create mode 100755 tests/nvme/034 create mode 100644 tests/nvme/034.out diff --git a/tests/nvme/034 b/tests/nvme/034 new file mode 100755 index 000000000000..f92e5e20865b --- /dev/null +++ b/tests/nvme/034 @@ -0,0 +1,35 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. + +. tests/nvme/rc + +DESCRIPTION="run data verification fio job on an NVMeOF passthru controller" +TIMED=1 + +requires() { + _nvme_requires + _have_kernel_option NVME_TARGET_PASSTHRU + _have_fio +} + +test_device() { + local subsys="blktests-subsystem-1" + local ctrldev + local nsdev + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + port=$(_nvmet_passthru_target_setup "${subsys}") + nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") + + _run_fio_verify_io --size=950m --filename="${nsdev}" + + _nvme_disconnect_subsys "${subsys}" + _nvmet_passthru_target_cleanup "${port}" "${subsys}" + + echo "Test complete" +} diff --git a/tests/nvme/034.out b/tests/nvme/034.out new file mode 100644 index 000000000000..0a7bd2f90dae --- /dev/null +++ b/tests/nvme/034.out @@ -0,0 +1,3 @@ +Running nvme/034 +NQN:blktests-subsystem-1 disconnected 1 controller(s) +Test complete From patchwork Wed Sep 30 18:54:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ECAD112E for ; Wed, 30 Sep 2020 19:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B0E220709 for ; Wed, 30 Sep 2020 19:14:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="n81CGoUH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729851AbgI3TOt (ORCPT ); Wed, 30 Sep 2020 15:14:49 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37976 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729872AbgI3TOt (ORCPT ); Wed, 30 Sep 2020 15:14:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=usviiWmZ0kC5VegpKwKjP6cu1fNBAkz/nKsk5i9RRWY=; b=n81CGoUHMZW+KfyHCKvSbtdmfx WIm6mMgdYIF7wsYAMw2RNTRRIS56sR8rZ/B7RS0nRMhRGtCuZNXwraw8SsdW0K7VQ3rdKseih9Jhz n3gxJ6d/2LQZxtg5Z8uFv8QZ5wGeYNYG8CXt3hd5gN636/B2+v66xpLxBRSE2fPJR2bZz4X7yk6vX mXIz3NQv8nzfn/L5z8a+HziVg5QKBpfYVok2oyF1DOJf+jQftgxvWYCRB5FEY1xBa18jBf49Eoxcz Wlhc1DWGkUUMwRpE0fZz5cXvtkOaj0/MVeg8yjPjO2DxF2+OMJn4/r4kuhSW6tIOZHbXVRX4qjKhl hQ4sMs1g==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFJ-0000uz-Nt; Wed, 30 Sep 2020 12:54:34 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFE-00030g-2z; Wed, 30 Sep 2020 12:54:28 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:19 -0600 Message-Id: <20200930185422.11494-9-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 08/11] nvme/035: Add test to verify passthru controller with a filesystem X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This is a similar test as nvme/012 and nvme/013, except with a passthru controller. Signed-off-by: Logan Gunthorpe --- tests/nvme/035 | 37 +++++++++++++++++++++++++++++++++++++ tests/nvme/035.out | 3 +++ 2 files changed, 40 insertions(+) create mode 100755 tests/nvme/035 create mode 100644 tests/nvme/035.out diff --git a/tests/nvme/035 b/tests/nvme/035 new file mode 100755 index 000000000000..ee78a7586f35 --- /dev/null +++ b/tests/nvme/035 @@ -0,0 +1,37 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. + +. tests/nvme/rc +. common/xfs + +DESCRIPTION="run mkfs and data verification fio job on an NVMeOF passthru controller" +TIMED=1 + +requires() { + _nvme_requires + _have_kernel_option NVME_TARGET_PASSTHRU + _have_xfs + _have_fio +} + +test_device() { + local subsys="blktests-subsystem-1" + local ctrldev + local nsdev + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + port=$(_nvmet_passthru_target_setup "${subsys}") + nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") + + _xfs_run_fio_verify_io "${nsdev}" + + _nvme_disconnect_subsys "${subsys}" + _nvmet_passthru_target_cleanup "${port}" "${subsys}" + + echo "Test complete" +} diff --git a/tests/nvme/035.out b/tests/nvme/035.out new file mode 100644 index 000000000000..a6027138fbe4 --- /dev/null +++ b/tests/nvme/035.out @@ -0,0 +1,3 @@ +Running nvme/035 +NQN:blktests-subsystem-1 disconnected 1 controller(s) +Test complete From patchwork Wed Sep 30 18:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C596139A for ; Wed, 30 Sep 2020 19:14:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 258ED20708 for ; Wed, 30 Sep 2020 19:14:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="Zhgon41v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729951AbgI3TOz (ORCPT ); Wed, 30 Sep 2020 15:14:55 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37994 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729936AbgI3TOz (ORCPT ); Wed, 30 Sep 2020 15:14:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Nm9S1mrD71DL+fV1grCBmg3CM4YNMP/hpGKwYK5ic38=; b=Zhgon41vYRIv7JpaosEyZWpwXU BxzPjIpzu+p6hL/FhVvwErAuGEFVQ2yKh/fKXWYSbrBaKGtESDDsK3cPwl9gop8X4E7jllxDUGZnj o+qaPxRA/A3e3ZMgC4Sf2lu7Np3ZDrTFCdR8hD8CcaJwsLD6VymloW6cuEg9b68pWvzPnI+Ibopnh 6Xq/jfPezMMcxPBQ2Tg+bIN+GuwriJSdkIu2f5b7ORnCZRSlVtM8qile23pev+sItcjhK3NFKNtgf G1o4uZ0E7AG8HWWqJHNtXU2oXF35wVDCILeHqBrDLU+r5R9xCRkaX9SYe+RKRF+/PrLmog6RsdhGy kO5SHbhA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFI-0000uw-B8; Wed, 30 Sep 2020 12:54:32 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFE-00030j-7g; Wed, 30 Sep 2020 12:54:28 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:20 -0600 Message-Id: <20200930185422.11494-10-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 09/11] nvme/036: Add test for testing reset command on nvme-passthru X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Similar to test 022 but for passthru controllers. Signed-off-by: Logan Gunthorpe --- tests/nvme/036 | 37 +++++++++++++++++++++++++++++++++++++ tests/nvme/036.out | 3 +++ 2 files changed, 40 insertions(+) create mode 100755 tests/nvme/036 create mode 100644 tests/nvme/036.out diff --git a/tests/nvme/036 b/tests/nvme/036 new file mode 100755 index 000000000000..8218c6538dfd --- /dev/null +++ b/tests/nvme/036 @@ -0,0 +1,37 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. + +. tests/nvme/rc + +DESCRIPTION="test NVMe reset command on an NVMeOF target with a passthru controller" +QUICK=1 + +requires() { + _nvme_requires + _have_kernel_option NVME_TARGET_PASSTHRU +} + +test_device() { + local subsys="blktests-subsystem-1" + local ctrldev + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + port=$(_nvmet_passthru_target_setup "${subsys}") + nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") + + ctrldev=$(_find_nvme_dev "${subsys}") + + if ! nvme reset "/dev/${ctrldev}" >> "$FULL" 2>&1; then + echo "ERROR: reset failed" + fi + + _nvme_disconnect_subsys "${subsys}" + _nvmet_passthru_target_cleanup "${port}" "${subsys}" + + echo "Test complete" +} diff --git a/tests/nvme/036.out b/tests/nvme/036.out new file mode 100644 index 000000000000..d294f8646b20 --- /dev/null +++ b/tests/nvme/036.out @@ -0,0 +1,3 @@ +Running nvme/036 +NQN:blktests-subsystem-1 disconnected 1 controller(s) +Test complete From patchwork Wed Sep 30 18:54:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810149 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59F81112E for ; Wed, 30 Sep 2020 19:14:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DD7C20708 for ; Wed, 30 Sep 2020 19:14:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="liTAEk7v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729994AbgI3TO4 (ORCPT ); Wed, 30 Sep 2020 15:14:56 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37996 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729992AbgI3TO4 (ORCPT ); Wed, 30 Sep 2020 15:14:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JVPaqWSpQ5haRzwQ/xrH0Kw+7eTy8s+uTMUVQHnv9sU=; b=liTAEk7vbHwbclVv0TjqEyGnfk IOE0oop9x89iqYHY77x9K3JVKe+CficHyMNtvyAUjfXybhaTMP3wv/nf+7vt0VKNxhx0vHMMvfW71 sz1rOBHXrJnDzOtsEf3TTBC6JkF+SfoLRnOPJw4B4qZPG4SG+MY94Q5EKAk3jKOwR+zBS71sJ1m8U jjSeJnRVTfdPDQOlTHohEw+t+P1jWTnb4dYmGNJkYz7sj6JLpS8cg9DGa+FancyeJDwtpeHDqyBMq gFh9mw5tdabEBXdALBjpJMe2qmoPKOp0mMnFoJ+Et/MnNwwuuChRvcCYuSecvqA5gHKnwcS73vdiU o7/Uho+g==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFI-0000v0-AJ; Wed, 30 Sep 2020 12:54:32 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFE-00030m-C9; Wed, 30 Sep 2020 12:54:28 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:21 -0600 Message-Id: <20200930185422.11494-11-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 10/11] nvme/037: Add test which loops passthru connect and disconnect X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Similar to test nvme/031 except for passthru controllers. Note: it's normal to get I/O errors in this test as when the controller disconnects it races with the partition table read. Signed-off-by: Logan Gunthorpe --- tests/nvme/037 | 35 +++++++++++++++++++++++++++++++++++ tests/nvme/037.out | 2 ++ 2 files changed, 37 insertions(+) create mode 100755 tests/nvme/037 create mode 100644 tests/nvme/037.out diff --git a/tests/nvme/037 b/tests/nvme/037 new file mode 100755 index 000000000000..fc6c21343652 --- /dev/null +++ b/tests/nvme/037 @@ -0,0 +1,35 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. + +. tests/nvme/rc + +DESCRIPTION="test deletion of NVMeOF passthru controllers immediately after setup" + +requires() { + _nvme_requires + _have_kernel_option NVME_TARGET_PASSTHRU +} + +test_device() { + local subsys="blktests-subsystem-" + local iterations=10 + local ctrldev + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + + for ((i = 0; i < iterations; i++)); do + port=$(_nvmet_passthru_target_setup "${subsys}${i}") + nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" \ + "${subsys}${i}") + + _nvme_disconnect_subsys "${subsys}${i}" >>"${FULL}" 2>&1 + _nvmet_passthru_target_cleanup "${port}" "${subsys}${i}" + done + + echo "Test complete" +} diff --git a/tests/nvme/037.out b/tests/nvme/037.out new file mode 100644 index 000000000000..eaf903d0520e --- /dev/null +++ b/tests/nvme/037.out @@ -0,0 +1,2 @@ +Running nvme/037 +Test complete From patchwork Wed Sep 30 18:54:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 11810143 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B841112E for ; Wed, 30 Sep 2020 19:14:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D999220709 for ; Wed, 30 Sep 2020 19:14:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="OUtQk0w6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729893AbgI3TOx (ORCPT ); Wed, 30 Sep 2020 15:14:53 -0400 Received: from ale.deltatee.com ([204.191.154.188]:37984 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729936AbgI3TOw (ORCPT ); Wed, 30 Sep 2020 15:14:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UpWM+yjj8ziy97ndQzgM2ZJFF0WlYfaYMS3RABD6FHI=; b=OUtQk0w6VLrF2XMMJhvoxhd58D WxJk162Ct6437Xt2MV9Vcsxa6lNuZtmreRU4E2BvOebfWncRcu2Tr9kAOCLgwFcws5mrc/bOVzDEJ ZsAw9ZDMgaUiJSLihuQSS2cKlW4HTOSryFYk1dDsZ6b5ogP3ubn/BOr/t18qaknYSSfW+a7onDZ6L 35b4nga9qlsWzQArvALcnM3q+31UzrzH4Gx5wjboHLutCWdHzPo4IWCWylqVM/OiHyjHly1rnDAYD QLfjTKal6SD3IhKQjUK4PmFPML6PnF/XRoap2lzae+heRrxp7tY28ZRjGDq9XnK+aWCUXJlLY7pE7 BAfuSLJw==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNhFH-0000uy-Au; Wed, 30 Sep 2020 12:54:31 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kNhFE-00030p-Hp; Wed, 30 Sep 2020 12:54:28 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Omar Sandoval Cc: Sagi Grimberg , Chaitanya Kulkarni , Stephen Bates , Logan Gunthorpe Date: Wed, 30 Sep 2020 12:54:22 -0600 Message-Id: <20200930185422.11494-12-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930185422.11494-1-logang@deltatee.com> References: <20200930185422.11494-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, osandov@osandov.com, sagi@grimberg.me, Chaitanya.Kulkarni@wdc.com, sbates@raithlin.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH blktests v2 11/11] nvme/038: Test removal of un-enabled subsystem and ports X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Test that we can remove a subsystem that has not been enabled by passthru or any ns. Do the same for ports while we are at it. This was an issue in the original passthru patches and is not commonly tested. So this test will ensure we don't regress this. Signed-off-by: Logan Gunthorpe --- tests/nvme/038 | 36 ++++++++++++++++++++++++++++++++++++ tests/nvme/038.out | 2 ++ 2 files changed, 38 insertions(+) create mode 100755 tests/nvme/038 create mode 100644 tests/nvme/038.out diff --git a/tests/nvme/038 b/tests/nvme/038 new file mode 100755 index 000000000000..24f02d4ad4d1 --- /dev/null +++ b/tests/nvme/038 @@ -0,0 +1,36 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. +# +# Test that we can remove a subsystem that has not been enabled by +# passthru or any ns. Do the same for ports while we are at it. +# +# This was an issue in the original passthru patches and is +# not commonly tested. So this test will ensure we don't regress this. +# +. tests/nvme/rc + +DESCRIPTION="test deletion of NVMeOF subsystem without enabling" +QUICK=1 + +requires() { + _nvme_requires +} + +test() { + local subsys_path="${NVMET_CFS}/subsystems/blktests-subsystem-1" + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + + mkdir -p "${subsys_path}" + rmdir "${subsys_path}" + + port=$(_create_nvmet_port loop) + _remove_nvmet_port "${port}" + + echo "Test complete" +} diff --git a/tests/nvme/038.out b/tests/nvme/038.out new file mode 100644 index 000000000000..06bc98022c33 --- /dev/null +++ b/tests/nvme/038.out @@ -0,0 +1,2 @@ +Running nvme/038 +Test complete