t/zbd: check device for unrestricted read support
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Tue, 6 Feb 2024 10:57:54 +0000 (19:57 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Wed, 7 Feb 2024 13:43:13 +0000 (08:43 -0500)
commit7d5a66e1be864ef16fb9e9b6e0b9234da1e2a199
treef28a6b02edb05d61b065419bbf3775bd22e9ef14
parent69c53a63667f914ebf7e7a85c83351d90a7e2bc8
t/zbd: check device for unrestricted read support

ZBD unit tests in t/zbd/test-zbd-support currently assume that the
drive that is being tested supports unrestricted reads, i.e. reads
that (partially or entirely) occur above the write pointer. This is
always the case with ZBD core code because Linux kernel rejects zoned
devices with restricted reads. However, libzbc ioengine does support
such devices.

The restricted/unrestricted reads feature is controlled by URSWRZ
device bit ("Unrestricted Reads of Sequential Write Required Zones")
which, depending on the device design, can be hard-coded to be reported
as 1 or 0 or it can be made configurable via MODE SET or SET FEATURES
commands. The unit tests need to behave correctly with any URSWRZ bit
value reported by the device if libzbc ioengine is used for testing.

Test #4 in the test script currently expects the device to have
unrestricted SWR zone reads. This test is guaranteed to fail if
the script is run against a drive that reports URSWRZ=0 with libzbc
ioengine.

Check if the drive has unrestricted read support disabled and process
the outcome of test #4 accordingly.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240206105755.214891-5-dmitry.fomichev@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
t/zbd/functions
t/zbd/test-zbd-support