engines:nvme: fill command fields as per pi check bits
A message that is not in the archive (sent off-list or not yet received): CGME20230911110620epcas5p20ba906dcc78e21b1936dd37e5b5a1090@epcas5p2.samsung.com
cover E2E PI two small fixes for io_uring passthru engine.
1. The fio verify cannot work when end to end data protection is enabled This issue is only when nvme namespace has extended logical blocks, as the PI portion of data buffer conflicts with any specified verify option. Disallow verify for this case.
2. There is no need to fill LBA reference and application tag in the command if the relevant bits for PI check is not set.
Ankit Kumar (2):
engines:io_uring_cmd: disallow verify for e2e pi with extended blocks engines:nvme: fill command fields as per pi check bits
engines/io_uring.c | 14 ++++++++++++++ engines/nvme.c | 15 ++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/2 engines:io_uring_cmd: disallow verify for e2e pi with extended blocks
For extended logical block sizes we cannot use verify when end to end data protection checks are enabled. The CRC field in PI section of data buffer creates conflict during verify phase.
The verify check is also redundant as end to end data protection already ensures data integrity. So disallow use of verify for this case.
--- engines/io_uring.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
engines/io_uring.c +14 -0
@@ -18,6 +18,7 @@#include "../lib/memalign.h" #include "../lib/fls.h" #include "../lib/roundup.h" +#include "../verify.h" #ifdef ARCH_HAVE_IOURING
@@ -1299,6 +1300,19 @@ static int fio_ioring_cmd_open_file(struct thread_data *td, struct fio_file *f)return 1 ; } } + +/* +* For extended logical block sizes we cannot use verify when +* end to end data protection checks are enabled, as the PI +* section of data buffer conflicts with verify. +*/ +if (data->ms && data->pi_type && data->lba_ext && + td->o.verify !=VERIFY_NONE ) { +log_err ("%s: for extended LBA, verify cannot be used when E2E data protection is enabled\n" , + f->file_name); +td_verror (td,EINVAL ,"fio_ioring_cmd_open_file" ); +return 1 ; + } }if (!ld || !o->registerfiles)return generic_open_file (td, f);
Signature · 1 line
2.25.1
PATCH 2/2 engines:nvme: fill command fields as per pi check bits
In reply to Ankit KumarFill the application and reference tag field for read and write command only when pi_chk has the relevant bit set.
--- engines/nvme.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
engines/nvme.c +10 -5
@@ -415,19 +415,24 @@ void fio_nvme_pi_fill(struct nvme_uring_cmd *cmd, struct io_u *io_u,case NVME_NS_DPS_PI_TYPE2 :switch (data->guard_type) {case NVME_NVM_NS_16B_GUARD : - cmd->cdw14 = (__u32 )slba; +if (opts->io_flags &NVME_IO_PRINFO_PRCHK_REF ) + cmd->cdw14 = (__u32 )slba;break ;case NVME_NVM_NS_64B_GUARD : - cmd->cdw14 = (__u32 )slba; - cmd->cdw3 = ((slba >>32 ) &0xffff ); +if (opts->io_flags &NVME_IO_PRINFO_PRCHK_REF ) { + cmd->cdw14 = (__u32 )slba; + cmd->cdw3 = ((slba >>32 ) &0xffff ); + }break ;default :break ; } - cmd->cdw15 = (opts->apptag_mask <<16 | opts->apptag); +if (opts->io_flags &NVME_IO_PRINFO_PRCHK_APP ) + cmd->cdw15 = (opts->apptag_mask <<16 | opts->apptag);break ;case NVME_NS_DPS_PI_TYPE3 : - cmd->cdw15 = (opts->apptag_mask <<16 | opts->apptag); +if (opts->io_flags &NVME_IO_PRINFO_PRCHK_APP ) + cmd->cdw15 = (opts->apptag_mask <<16 | opts->apptag);break ;case NVME_NS_DPS_PI_NONE :break ;
Signature · 1 line
2.25.1
Jens Axboe
AppliedRe: [PATCH 0/2] E2E PI two small fixes for io_uring passthru engine.
In reply to Ankit KumarQuoted 6 lines · Ankit Kumar
1. The fio verify cannot work when end to end data protection is enabled This issue is only when nvme namespace has extended logical blocks, as the PI portion of data buffer conflicts with any specified verify option. Disallow verify for this case.
2. There is no need to fill LBA reference and application tag in the command if the relevant bits for PI check is not set.
Applied, thanks.
Signature · 1 line
Jens Axboe