On 8/9/23 07:13, Ankit Kumar wrote:
This patch enables support for protection information to nvme command
backend of io_uring_cmd ioengine. The patch only supports protection
information action bit set to 1, for read and write operation.
This adds 4 new ioengine specific options
* pi_act - Protection information action. Default: 1
* pi_chk - Can be set to GUARD, APPTAG or REFTAG
* apptag - Sets apptag field of command dword 15
* apptag_mask - Sets apptag_mask field of command dword 15
For pi_act=1, if namespace is formatted with metadata size equal to
protection information size, the nvme controller inserts and removes
protection information for write and read command respectively.
Added a check so that fio doesn't send metadata for such cases.
Storage tag support is not present, so return an error for that.
I think it's worth mentioning in the commit message that for the sake of
consistency these options are the same as the ones used by SPDK's
external ioengine.
Signed-off-by: Ankit Kumar <ankit.kumar@xxxxxxxxxxx>
---
HOWTO.rst | 32 ++++++++
engines/io_uring.c | 95 +++++++++++++++++++++-
engines/nvme.c | 112 +++++++++++++++++++++++---
engines/nvme.h | 191 ++++++++++++++++++++++++++++++++++++++++++++-
fio.1 | 32 ++++++++
5 files changed, 448 insertions(+), 14 deletions(-)
diff --git a/HOWTO.rst b/HOWTO.rst
index 6e0677f2..aa5a36bd 100644
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -2491,6 +2491,38 @@ with the caveat that when used on the command line, they must come after the
Size in bytes for separate metadata buffer per IO. Default: 0.
+.. option:: pi_act=int : [io_uring_cmd]
+
+ Action to take, when nvme namespace is formatted with protection
+ information. If this is set to 1 and namespace is formatted with
+ metadata size equal to 8 bytes, fio does not send or check for
s/8 bytes/protection information size/
+ protection information during write or read case respectively. If
+ this is set to 0, fio generates protection information for write case
+ and verifies for read case. Default: 1.
+
+.. option:: pi_chk=str[,str][,str] : [io_uring_cmd]
+
+ Controls the protection information check. This can take one or more
+ of these values.
+
+ **GUARD**
+ Enables protection information checking of guard field.
+ **REFTAG**
+ Enables protection information checking of logical block
+ reference tag field.
+ **APPTAG**
+ Enables protection information checking of application tag field.
+
Please add a note that the default is none.