Current implementation of copy command, for namespace with end-to-end data protection enabled, always returns data integrity field check errors. For example, issuing with nvme-cli:
nvme copy --sdlba=25 --blocks=2,1,3 --slbs=1,37,50 --prinfow=5 --prinfor=5 --ref-tag=25 --expected-ref-tags=1,37,50 /dev/nvme0n1 Always returns End-to-end Reference Tag Check Error. To reproduce you may need to use upstream version of nvme-cli since there was a bug which prevented passing prinfow to a command, fixed in 2cf9825 commit. This patch set attempts to fix copy command for data protection enabled namespaces. Dmitry Tikhov (2): hw/nvme: refactor check of disabled dif hw/nvme: fix copy cmd for pi enabled namespaces hw/nvme/ctrl.c | 5 ++ hw/nvme/dif.c | 186 +++++++++++++++++++++++++++++++++---------- hw/nvme/dif.h | 3 + hw/nvme/trace-events | 4 +- 4 files changed, 155 insertions(+), 43 deletions(-) -- 2.35.1