All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krishna Kanth Reddy <krish.reddy@samsung.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, Ankit Kumar <ankit.kumar@samsung.com>,
	Krishna Kanth Reddy <krish.reddy@samsung.com>
Subject: [PATCH 9/9] Add a new test case to test the copy operation.
Date: Tue,  1 Dec 2020 17:10:34 +0530	[thread overview]
Message-ID: <20201201114034.8307-10-krish.reddy@samsung.com> (raw)
In-Reply-To: <20201201114034.8307-1-krish.reddy@samsung.com>

From: Ankit Kumar <ankit.kumar@samsung.com>

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
---
 t/zbd/functions        |  9 +++++++
 t/zbd/test-zbd-support | 54 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/t/zbd/functions b/t/zbd/functions
index 1a64a215..52eb697d 100644
--- a/t/zbd/functions
+++ b/t/zbd/functions
@@ -26,6 +26,15 @@ blkzone_reports_capacity() {
 		"${blkzone}" report -c 1 -o 0 "${dev}" | grep -q 'cap '
 }
 
+# Check whether or not $1 (/dev/...) supports copy operation
+check_copy_support() {
+	local copy_support
+
+	copy_support=$(<"/sys/block/$(basename "${1}")/queue/max_copy_sectors")
+
+	[[ "$copy_support" -gt 0 ]]
+}
+
 # Whether or not $1 (/dev/...) is a NVME ZNS device.
 is_nvme_zns() {
 	local s
diff --git a/t/zbd/test-zbd-support b/t/zbd/test-zbd-support
index acde3b3a..0857034d 100755
--- a/t/zbd/test-zbd-support
+++ b/t/zbd/test-zbd-support
@@ -948,6 +948,60 @@ test49() {
     check_read $((capacity * 2)) || return $?
 }
 
+# Sequential write, copy and read test
+test50() {
+    local i off opts=() size
+
+    if ! $(check_copy_support "$dev"); then
+	echo "$dev doesn't support copy operation" \
+	     >>"${logfile}.${test_number}"
+	return 0
+    fi
+
+    for ((i=0;i<8;i++)); do
+	[ -n "$is_zbd" ] &&
+	    reset_zone "$dev" $((first_sequential_zone_sector +
+				 i*sectors_per_zone))
+    done
+
+    size=$((zone_size * 8))
+    zonesize=$((zone_size * 1))
+    off=$((first_sequential_zone_sector * 512))
+    dest_off=$((off + zone_size * 16))
+    capacity=$(total_zone_capacity 8 $off $dev)
+
+    # Start with writing to 8 zones (0 - 7).
+    opts+=("--name=$dev" "--filename=$dev" "--thread=1" "--direct=1")
+    opts+=("--offset=${off}" "--size=$size" "--ioengine=libaio" "--rw=write" "--bs=16K")
+    opts+=("--buffer_pattern=0xdeadbeef" "--iodepth=32")
+    opts+=("--zonemode=zbd" "--group_reporting=1")
+    "$(dirname "$0")/../../fio" "${opts[@]}" >> "${logfile}.${test_number}" 2>&1 ||
+	    return $?
+    check_written $capacity || return $?
+
+    # Next, run copy operation. 8 ranges per copy operation and each range is 16K.
+    # Loop around the source and destination offset
+    opts=()
+    opts+=("--name=$dev" "--filename=$dev" "--thread=1" "--direct=1")
+    opts+=("--offset=${off}" "--size=$size" "--ioengine=sctl" "--rw=copy" "--bs=16K")
+    opts+=("--iodepth=1" "--num_range=8")
+    opts+=("--dest_offset=${dest_off}" "--loops=2")
+    opts+=("--zonemode=zbd" "--zonesize=${zonesize}" "--group_reporting=1")
+    run_fio "${opts[@]}" >> "${logfile}.${test_number}" 2>&1 || return $?
+
+    # read and verify the copied data pattern. Cannot run with zonemode=zbd
+    off=$((first_sequential_zone_sector * 512 + zone_size * 16))
+
+    opts=()
+    opts+=("--name=$dev" "--filename=$dev" "--thread=1" "--direct=1")
+    opts+=("--offset=${off}" "--size=$size" "--ioengine=libaio" "--rw=read" "--bs=4K")
+    opts+=("--iodepth=32" "--group_reporting=1")
+    opts+=("--do_verify=1" "--verify=pattern" "--verify_pattern=0xdeadbeef")
+    run_fio "${opts[@]}" >> "${logfile}.${test_number}" 2>&1 || return $?
+    check_read $capacity || return $?
+}
+
+
 tests=()
 dynamic_analyzer=()
 reset_all_zones=
-- 
2.17.1



      parent reply	other threads:[~2020-12-01 11:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201201114048epcas5p3e12de26128ce442bbe8406082eaccde9@epcas5p3.samsung.com>
2020-12-01 11:40 ` [PATCH 0/9] v1 Patchset : Simple Copy Command support Krishna Kanth Reddy
     [not found]   ` <CGME20201201114051epcas5p4b9c67cd0ad4b55fc9334dfde59ae349c@epcas5p4.samsung.com>
2020-12-01 11:40     ` [PATCH 1/9] Adding the necessary ddir changes to introduce copy operation Krishna Kanth Reddy
     [not found]   ` <CGME20201201114054epcas5p2cf4bff491f02c4a29a386ae44d5e42c7@epcas5p2.samsung.com>
2020-12-01 11:40     ` [PATCH 2/9] Introducing new offsets for the " Krishna Kanth Reddy
     [not found]   ` <CGME20201201114057epcas5p1aa9d8e1a56197e55251191a0a5985e3d@epcas5p1.samsung.com>
2020-12-01 11:40     ` [PATCH 3/9] Added support for printing of stats and estimate time for " Krishna Kanth Reddy
     [not found]   ` <CGME20201201114100epcas5p2f02995779f5172f711cc6ad3d362d50a@epcas5p2.samsung.com>
2020-12-01 11:40     ` [PATCH 4/9] Adding a new " Krishna Kanth Reddy
     [not found]   ` <CGME20201201114103epcas5p1bbf3d8ca05252935c14fed68f44dab2d@epcas5p1.samsung.com>
2020-12-01 11:40     ` [PATCH 5/9] Added the changes for copy operation support in FIO Krishna Kanth Reddy
     [not found]   ` <CGME20201201114105epcas5p4b99d6a66a543152a377461875aedf342@epcas5p4.samsung.com>
2020-12-01 11:40     ` [PATCH 6/9] New ioctl based synchronous IO engine. Only supports copy command Krishna Kanth Reddy
     [not found]   ` <CGME20201201114107epcas5p4694adc6b50a123a06a06411393395636@epcas5p4.samsung.com>
2020-12-01 11:40     ` [PATCH 7/9] Example configuration for simple " Krishna Kanth Reddy
     [not found]   ` <CGME20201201114110epcas5p34032161c14f467576734346712d0c3db@epcas5p3.samsung.com>
2020-12-01 11:40     ` [PATCH 8/9] Support copy operation for zoned block devices Krishna Kanth Reddy
2020-12-01 12:11       ` Damien Le Moal
2020-12-10 14:14         ` Krishna Kanth Reddy
2020-12-11  0:37           ` Damien Le Moal
     [not found]   ` <CGME20201201114113epcas5p328eabe564e0bda24c29e285bba8d8fd2@epcas5p3.samsung.com>
2020-12-01 11:40     ` Krishna Kanth Reddy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201201114034.8307-10-krish.reddy@samsung.com \
    --to=krish.reddy@samsung.com \
    --cc=ankit.kumar@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.