From patchwork Wed Dec 21 10:34:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13078625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7642BC4332F for ; Wed, 21 Dec 2022 10:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbiLUKf3 (ORCPT ); Wed, 21 Dec 2022 05:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234495AbiLUKe7 (ORCPT ); Wed, 21 Dec 2022 05:34:59 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07A65C758 for ; Wed, 21 Dec 2022 02:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=4WoCl1SIQbDhatQ3/vSDaEL62NDZ5t6fuJwpEfQSHQE=; b=X1RK5iEb0GoqcyTQ+oHnHwgocx JOhAf7J4xUitzhwBb6VyXA+xeev6J00hODSDK4ROdu+ZsWIzo0Eafd0h1s8lBmEO5pLx8BVkw8jwf xKBYKVWB+qycrjVE6i9zFjlVLXlSx4YevE9oYuRTTyrCaCssRMR8TgF9q6CM8Evw+C9JZ3WswwCSL uRxyiaQMcF/ijRnCMRzw/jD5vXqutOPX54xVvSIZxFQxJKC6v5//fVECCIjQBJWTtRpydeFmRJBfY gMvlpxs4Y5Fzx48xp2VaeetUJo5J6sU2x0gXektRPu9WhFb4aXpIeCUXcyHTKBD8PWwr+oI5HXKRK 2akMzTPw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wQw-00DUqR-UZ; Wed, 21 Dec 2022 10:34:46 +0000 From: Luis Chamberlain To: osandov@fb.com, mcgrof@kernel.org Cc: joshi.k@samsung.com, j.granados@samsung.com, anuj20.g@samsung.com, ankit.kumar@samsung.com, vincent.fu@samsung.com, ming.lei@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 1/6] common/fio: add helpers using io-uring cmd engine Date: Wed, 21 Dec 2022 02:34:36 -0800 Message-Id: <20221221103441.3216600-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org> References: <20221221103441.3216600-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This will allow us to add tests which use the io-uring cmd engine, part of fio. They are inspired by the work by Anuj Gupta and Ankit Kumar which added sample fio files onto fio for this exact purpose. We can build on those to expand test coverage with elaborate tests. We don't specify the cmd to allow other types of io-uring cmd users to use this other than nvme. Signed-off-by: Luis Chamberlain --- common/fio | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/common/fio b/common/fio index bed76d555b2a..4da90804ed21 100644 --- a/common/fio +++ b/common/fio @@ -184,6 +184,53 @@ _run_fio_verify_io() { rm -f local*verify*state } +_run_fio_rand_iouring_cmd() { + _run_fio --bs=4k --rw=randread --numjobs="$(nproc)" \ + --ioengine=io_uring_cmd --iodepth=32 \ + --thread=1 --stonewall=1 \ + --name=reads "$@" +} + +_run_fio_verify_iouring_cmd_randwrite() { + _run_fio --bs=4k --rw=randwrite --numjobs="$(nproc)" \ + --ioengine=io_uring_cmd --iodepth=32 \ + --thread=1 --stonewall=1 \ + --sqthread_poll=1 --sqthread_poll_cpu=0 \ + --nonvectored=1 --registerfiles=1 \ + --verify=crc32c \ + --name=verify "$@" + rm -f local*verify*state +} + +_run_fio_verify_iouring_cmd_write_opts() { + _run_fio --bs=4k --rw=write --numjobs="$(nproc)" \ + --ioengine=io_uring_cmd --iodepth=32 \ + --thread=1 --stonewall=1 \ + --sqthread_poll=1 --sqthread_poll_cpu=0 \ + --nonvectored=1 --registerfiles=1 \ + --verify=crc32c \ + --name=verify "$@" + rm -f local*verify*state +} + +_run_fio_iouring_cmd_zone() { + _run_fio --rw=randread --numjobs="$(nproc)" \ + --ioengine=io_uring_cmd --iodepth=1 \ + --stonewall=1 \ + --zonemode=zbd \ + --name=reads "$@" +} + +_run_fio_verify_iouring_cmd_write_opts_zone() { + _run_fio --rw=randread --numjobs="$(nproc)" \ + --ioengine=io_uring_cmd --iodepth=1 \ + --stonewall=1 \ + --zonemode=zbd \ + --sqthread_poll=1 --registerfiles=1 --sqthread_poll_cpu=0 \ + --verify=crc32c \ + --name=verify "$@" +} + _fio_perf_report() { # If there is more than one group, we don't know what to report. if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then From patchwork Wed Dec 21 10:34:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13078623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0159C10F1B for ; Wed, 21 Dec 2022 10:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234512AbiLUKfZ (ORCPT ); Wed, 21 Dec 2022 05:35:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234517AbiLUKe7 (ORCPT ); Wed, 21 Dec 2022 05:34:59 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079EFBE26 for ; Wed, 21 Dec 2022 02:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=URJ/vSFYaxObSi1D6m14yyD3utnvo0w49uSE8LfCh+o=; b=QwmUTvFd8dIZxeYgOBJDQ6qydH 5WwG5p5SYalkAMwckDqdNtfw3az3OTs7kfUiDMxwh3VDw0jcxhVPLoH4nMsK+TJpnTEKK9V9B+wNI i+Igmsu4cZwkfC1blnD5+R7tCVO2lbSix2ngtQCtsaZ1OYGWTbUwYeh/hH0RJwCNofLnLedM7chWf fzoo8n6e4Xb/++vQM9IyJEPHuHwAaM3Y9ftz/Rea0Tg3fFk4EjfHVFEPpefFZarRy7cK2CG1Nl5Wf /HjxgKVyVDAR2moLxkkg/EZRPj54SFhKmLxlFqs3990WdQ7oKIdqXVHCuNQBnPUzXFRYLtwamiz3I JQr5nG8Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wQx-00DUqT-0D; Wed, 21 Dec 2022 10:34:47 +0000 From: Luis Chamberlain To: osandov@fb.com, mcgrof@kernel.org Cc: joshi.k@samsung.com, j.granados@samsung.com, anuj20.g@samsung.com, ankit.kumar@samsung.com, vincent.fu@samsung.com, ming.lei@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 2/6] tests/nvme: add new test for rand-read on the nvme character device Date: Wed, 21 Dec 2022 02:34:37 -0800 Message-Id: <20221221103441.3216600-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org> References: <20221221103441.3216600-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This does basic rand-read testing of the character device of a conventional NVMe drive. Signed-off-by: Luis Chamberlain --- tests/nvme/046 | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/nvme/046.out | 2 ++ 2 files changed, 44 insertions(+) create mode 100755 tests/nvme/046 create mode 100644 tests/nvme/046.out diff --git a/tests/nvme/046 b/tests/nvme/046 new file mode 100755 index 000000000000..3526ab9eedab --- /dev/null +++ b/tests/nvme/046 @@ -0,0 +1,42 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Luis Chamberlain +# +# This does basic sanity test for the nvme character device. This is a basic +# test and if it fails it is probably very likely other nvme character device +# tests would fail. +# +. tests/nvme/rc + +DESCRIPTION="basic rand-read io_uring_cmd engine for nvme-ns character device" +QUICK=1 + +requires() { + _nvme_requires + _have_fio +} + +device_requires() { + _require_test_dev_is_nvme +} + +test_device() { + echo "Running ${TEST_NAME}" + local ngdev=${TEST_DEV/nvme/ng} + local fio_args=( + --size=1M + --cmd_type=nvme + --filename="$ngdev" + --time_based + --runtime=10 + ) && + _run_fio_rand_iouring_cmd "${fio_args[@]}" >>"${FULL}" 2>&1 || + fail=true + + if [ -z "$fail" ]; then + echo "Test complete" + else + echo "Test failed" + return 1 + fi +} diff --git a/tests/nvme/046.out b/tests/nvme/046.out new file mode 100644 index 000000000000..2b5fa6af63b1 --- /dev/null +++ b/tests/nvme/046.out @@ -0,0 +1,2 @@ +Running nvme/046 +Test complete From patchwork Wed Dec 21 10:34:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13078624 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B584C3DA79 for ; Wed, 21 Dec 2022 10:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232901AbiLUKf1 (ORCPT ); Wed, 21 Dec 2022 05:35:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbiLUKe7 (ORCPT ); Wed, 21 Dec 2022 05:34:59 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20E6DB879 for ; Wed, 21 Dec 2022 02:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=EU5hx8EPY2ObYMvaGr18kG+q5W0YmfXi6zYNqgfxw38=; b=njzCA+s+lVBGhOzX3ixaON2sPC ljcxfWL9tPDvsdzQ67Dw3eEeZZXglY8neQtB1ZsGyJ8gdDIx1bqGhkd/0ldSVn75cR+oxakZQ/rtA YIrbTWe43lV/RY+PqtevtuIEwS8FMJZ+VifCRa7LMHSaPyPEeCFQwCmKTVCL01iC6EjtzOI3J+uvW mlmSWGuemFSghvQJF26p0eS1yd0dce+j9i3ds434Of/OyJCrkcBGQSI+d6q7AcEdV4IIGP1nZU03K hEhSEniCe5aDRyMrSKKJOlzLhQFabKcGYdCuW5ABLpwpOp/+7MlcRlAOqyQP+pZfq6C6cvV67pMWl DJLZaSBA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wQx-00DUqV-2r; Wed, 21 Dec 2022 10:34:47 +0000 From: Luis Chamberlain To: osandov@fb.com, mcgrof@kernel.org Cc: joshi.k@samsung.com, j.granados@samsung.com, anuj20.g@samsung.com, ankit.kumar@samsung.com, vincent.fu@samsung.com, ming.lei@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 3/6] tests/nvme: add new test for rand-write on the nvme character device Date: Wed, 21 Dec 2022 02:34:38 -0800 Message-Id: <20221221103441.3216600-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org> References: <20221221103441.3216600-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This does basic rand-write testing of the character device of a conventional NVMe drive. Signed-off-by: Luis Chamberlain --- tests/nvme/047 | 41 +++++++++++++++++++++++++++++++++++++++++ tests/nvme/047.out | 2 ++ 2 files changed, 43 insertions(+) create mode 100755 tests/nvme/047 create mode 100644 tests/nvme/047.out diff --git a/tests/nvme/047 b/tests/nvme/047 new file mode 100755 index 000000000000..8ba55b250bc5 --- /dev/null +++ b/tests/nvme/047 @@ -0,0 +1,41 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Luis Chamberlain +# +# This does basic random write test for the the convential nvme character +# device. + +. tests/nvme/rc + +DESCRIPTION="basic rand-write io_uring_cmd engine for nvme-ns character device" +QUICK=1 + +requires() { + _nvme_requires + _have_fio +} + +device_requires() { + _require_test_dev_is_nvme +} + +test_device() { + echo "Running ${TEST_NAME}" + local ngdev=${TEST_DEV/nvme/ng} + local fio_args=( + --size=1M + --cmd_type=nvme + --filename="$ngdev" + --time_based + --runtime=10 + ) && + _run_fio_verify_iouring_cmd_randwrite "${fio_args[@]}" >>"${FULL}" 2>&1 || + fail=true + + if [ -z "$fail" ]; then + echo "Test complete" + else + echo "Test failed" + return 1 + fi +} diff --git a/tests/nvme/047.out b/tests/nvme/047.out new file mode 100644 index 000000000000..915d0a2389ca --- /dev/null +++ b/tests/nvme/047.out @@ -0,0 +1,2 @@ +Running nvme/047 +Test complete From patchwork Wed Dec 21 10:34:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13078628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BF3DC3DA79 for ; Wed, 21 Dec 2022 10:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232647AbiLUKfc (ORCPT ); Wed, 21 Dec 2022 05:35:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbiLUKe4 (ORCPT ); Wed, 21 Dec 2022 05:34:56 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7DEEB1D6 for ; Wed, 21 Dec 2022 02:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=UTcKF+NrY00WDVRaxW5yqbHZcMTyx5ViwfKKPiqqTOU=; b=CE0X6oPvlpJwsUPsQWKf9Rt8RL TAk6K5kScXeoL27TuNzGtUwt1gT3s9yMeUvRFfIwBfHngkhmNY7LPYpmZL3xjIdEfnoXLLC3Xwm59 FyzSOAQm4+EdreEuK+XgveBr+jFfn9SLqVvw3t8Hm11sAHdH9Sk2dl/vAcHcjOlYVItg8YQEC15x9 7VZNf5PQhfXbKKsVOIq/uS+QcgVZwZqHyitxP3kvVhuSqjAZg2XitpUJHepEYZ68Sp9qoVJu/RWbc xrW9Ps4Xkk389HtKJW9xNcI9r7T16eb18VeyHEVEpocy9MJlzMxVExzcTN55Xi9lWTEyHmxspnfLB PAyspXzg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wQx-00DUqY-7D; Wed, 21 Dec 2022 10:34:47 +0000 From: Luis Chamberlain To: osandov@fb.com, mcgrof@kernel.org Cc: joshi.k@samsung.com, j.granados@samsung.com, anuj20.g@samsung.com, ankit.kumar@samsung.com, vincent.fu@samsung.com, ming.lei@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 4/6] tests/nvme: add new test for optimal write on the nvme character device Date: Wed, 21 Dec 2022 02:34:39 -0800 Message-Id: <20221221103441.3216600-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org> References: <20221221103441.3216600-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This does basic optimal write testing of the character device of a conventional NVMe drive. Signed-off-by: Luis Chamberlain --- tests/nvme/048 | 41 +++++++++++++++++++++++++++++++++++++++++ tests/nvme/048.out | 2 ++ 2 files changed, 43 insertions(+) create mode 100755 tests/nvme/048 create mode 100644 tests/nvme/048.out diff --git a/tests/nvme/048 b/tests/nvme/048 new file mode 100755 index 000000000000..94329d9ed764 --- /dev/null +++ b/tests/nvme/048 @@ -0,0 +1,41 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Luis Chamberlain +# +# This does basic optimal write test for the nvme character device. + +. tests/nvme/rc + +DESCRIPTION="basic optimal write io_uring_cmd engine for nvme-ns character device" +QUICK=1 +CAN_BE_ZONED=1 + +requires() { + _nvme_requires + _have_fio +} + +device_requires() { + _require_test_dev_is_nvme +} + +test_device() { + echo "Running ${TEST_NAME}" + local ngdev=${TEST_DEV/nvme/ng} + local fio_args=( + --size=1M + --cmd_type=nvme + --filename="$ngdev" + --time_based + --runtime=10 + ) && + _run_fio_verify_iouring_cmd_write_opts "${fio_args[@]}" >>"${FULL}" 2>&1 || + fail=true + + if [ -z "$fail" ]; then + echo "Test complete" + else + echo "Test failed" + return 1 + fi +} diff --git a/tests/nvme/048.out b/tests/nvme/048.out new file mode 100644 index 000000000000..65ffa47e34f1 --- /dev/null +++ b/tests/nvme/048.out @@ -0,0 +1,2 @@ +Running nvme/048 +Test complete From patchwork Wed Dec 21 10:34:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13078622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A674C4167B for ; Wed, 21 Dec 2022 10:35:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234613AbiLUKfY (ORCPT ); Wed, 21 Dec 2022 05:35:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234512AbiLUKe7 (ORCPT ); Wed, 21 Dec 2022 05:34:59 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04CCFB4B2 for ; Wed, 21 Dec 2022 02:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=Ie4STAP6HM92ceLYD32Qh78BNILArF+8brPl1l+A2ow=; b=utgBUg/YkYNgC4jSEUCfRMv249 oqzzgcmEgObZr/TOMlrDiBMMyPgrJBTVI/tnOZDUX1i6zXEnXA+iuozBVr0Ubavu8Hq0k/IXI7P3f Iy+idyHIiqeBTQs0eg8/g5Ao4mW/j3xP44uheJpaKm1OTNNb7u88ZRoUANPd+c7k6uw4nRnAz9ilt NNJ2ljN7pCm//JMtI8SwXuKDGY5je7LP/WGKTrDgRcxWbb3ouA8McytWULhbVNA6PhU2M+8vZIWcp KAYL/J0VEsMnGMfhepjPVjjHSG/rxQelCLJH/6I0e/xdhWySNCf80Ou4uFvQR61k24V5AN4YY/eB/ zeKEywPw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wQx-00DUqd-IK; Wed, 21 Dec 2022 10:34:47 +0000 From: Luis Chamberlain To: osandov@fb.com, mcgrof@kernel.org Cc: joshi.k@samsung.com, j.granados@samsung.com, anuj20.g@samsung.com, ankit.kumar@samsung.com, vincent.fu@samsung.com, ming.lei@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 5/6] tests/zbd: add new basic test for reading zone character device Date: Wed, 21 Dec 2022 02:34:40 -0800 Message-Id: <20221221103441.3216600-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org> References: <20221221103441.3216600-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This adds a basic test to read using fio against a ZNS character device. Signed-off-by: Luis Chamberlain --- tests/zbd/011 | 52 +++++++++++++++++++++++++++++++++++++++++++++++ tests/zbd/011.out | 2 ++ 2 files changed, 54 insertions(+) create mode 100755 tests/zbd/011 create mode 100644 tests/zbd/011.out diff --git a/tests/zbd/011 b/tests/zbd/011 new file mode 100755 index 000000000000..a4d46fcd6cd3 --- /dev/null +++ b/tests/zbd/011 @@ -0,0 +1,52 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Luis Chamberlain +# +# This does basic read test for the zone nvme character device. + +. tests/zbd/rc + +DESCRIPTION="basic read io_uring_cmd engine for zone nvme-ns character device" +QUICK=1 +CAN_BE_ZONED=1 + +requires() { + _have_fio +} + +fallback_device() { + _fallback_null_blk_zoned +} + +cleanup_fallback_device() { + _exit_null_blk +} + +test_device() { + echo "Running ${TEST_NAME}" + local -i bs + declare -a fio_args + local ngdev=${TEST_DEV/nvme/ng} + + _get_sysfs_variable "${TEST_DEV}" || return $? + bs=${SYSFS_VARS[$SV_PHYS_BLK_SIZE]} + _put_sysfs_variable + + fio_args=( + --bs="$bs" + --size=1024M + --cmd_type=nvme + --filename="$ngdev" + --time_based + --runtime=10 + ) && + _run_fio_iouring_cmd_zone "${fio_args[@]}" >>"${FULL}" 2>&1 || + fail=true + + if [ -z "$fail" ]; then + echo "Test complete" + else + echo "Test failed" + return 1 + fi +} diff --git a/tests/zbd/011.out b/tests/zbd/011.out new file mode 100644 index 000000000000..aec7f703938a --- /dev/null +++ b/tests/zbd/011.out @@ -0,0 +1,2 @@ +Running zbd/011 +Test complete From patchwork Wed Dec 21 10:34:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13078627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0CA3C41535 for ; Wed, 21 Dec 2022 10:35:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234448AbiLUKfb (ORCPT ); Wed, 21 Dec 2022 05:35:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232647AbiLUKe4 (ORCPT ); Wed, 21 Dec 2022 05:34:56 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81A9B7EE for ; Wed, 21 Dec 2022 02:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=nzxBFknUyv63x0KL3VxpLH2ImrgIgZnruN6+7qv0hh8=; b=J7WrXHJ0Pq5bSPSXm0vtaUVsfw aKVP0/4mh6HWqh+27nXl+/NCO3x5zdAvT71Pympkzbqf+GJK9xGuYpG7Wk6+GEs4+tzWFAiBrpInC 6XKjZ919gaiHZWU4xfxAjTbRcd5b0og9z1k9wrEdqfprigT75pg7wzCSvAXCWmn/WzmPhyVqURVr3 av5HCGq7g8ibuC1JMrQDQy7uN55Mp3yftt//CkQ6n422+rpQW4FB3RuJhuR0c61kBC+3lB9ej7C++ lbyG+yNjqEM0pXDuBwzdNfZvw2G9johFnnWd1MrDkWrm5wplrhO3ltN3noHX1mLVdEbM4MsiYrp1n ytoRqGdg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7wQx-00DUqf-MB; Wed, 21 Dec 2022 10:34:47 +0000 From: Luis Chamberlain To: osandov@fb.com, mcgrof@kernel.org Cc: joshi.k@samsung.com, j.granados@samsung.com, anuj20.g@samsung.com, ankit.kumar@samsung.com, vincent.fu@samsung.com, ming.lei@redhat.com, linux-block@vger.kernel.org Subject: [PATCH 6/6] tests/zbd: add new basic test for reading zone character device Date: Wed, 21 Dec 2022 02:34:41 -0800 Message-Id: <20221221103441.3216600-7-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221221103441.3216600-1-mcgrof@kernel.org> References: <20221221103441.3216600-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This adds a basic optimal write test using fio against a ZNS character device. Signed-off-by: Luis Chamberlain --- tests/zbd/012 | 50 +++++++++++++++++++++++++++++++++++++++++++++++ tests/zbd/012.out | 2 ++ 2 files changed, 52 insertions(+) create mode 100755 tests/zbd/012 create mode 100644 tests/zbd/012.out diff --git a/tests/zbd/012 b/tests/zbd/012 new file mode 100755 index 000000000000..474bcb07a27b --- /dev/null +++ b/tests/zbd/012 @@ -0,0 +1,50 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Luis Chamberlain +# +# This does basic optimal write test for the zone nvme character device. + +. tests/zbd/rc + +DESCRIPTION="basic optimal write using io_uring_cmd engine for zone nvme-ns character device" +QUICK=1 +CAN_BE_ZONED=1 + +requires() { + _have_fio +} + +fallback_device() { + _fallback_null_blk_zoned +} + +cleanup_fallback_device() { + _exit_null_blk +} + +test_device() { + echo "Running ${TEST_NAME}" + local -i bs + declare -a fio_args + local ngdev=${TEST_DEV/nvme/ng} + + _get_sysfs_variable "${TEST_DEV}" || return $? + bs=${SYSFS_VARS[$SV_PHYS_BLK_SIZE]} + _put_sysfs_variable + + fio_args=( + --bs="$bs" + --size=1024M + --cmd_type=nvme + --filename="$ngdev" + ) && + _run_fio_verify_iouring_cmd_write_opts_zone "${fio_args[@]}" >>"${FULL}" 2>&1 || + fail=true + + if [ -z "$fail" ]; then + echo "Test complete" + else + echo "Test failed" + return 1 + fi +} diff --git a/tests/zbd/012.out b/tests/zbd/012.out new file mode 100644 index 000000000000..8ff654950c5f --- /dev/null +++ b/tests/zbd/012.out @@ -0,0 +1,2 @@ +Running zbd/012 +Test complete