On Fri, Jan 29, 2021 at 10:15:40AM +0100, Klaus Jensen wrote: > From: Klaus Jensen <k.jen...@samsung.com> > > Add new data structures and types for the Simple Copy command. > > Signed-off-by: Klaus Jensen <k.jen...@samsung.com> > Reviewed-by: Minwoo Im <minwoo.im....@gmail.com> > Acked-by: Stefan Hajnoczi <stefa...@redhat.com> > --- > include/block/nvme.h | 45 ++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 43 insertions(+), 2 deletions(-) > > diff --git a/include/block/nvme.h b/include/block/nvme.h > index e4b918064df9..5977bcf0308a 100644 > --- a/include/block/nvme.h > +++ b/include/block/nvme.h > @@ -579,6 +579,7 @@ enum NvmeIoCommands { > NVME_CMD_COMPARE = 0x05, > NVME_CMD_WRITE_ZEROES = 0x08, > NVME_CMD_DSM = 0x09, > + NVME_CMD_COPY = 0x19, > NVME_CMD_ZONE_MGMT_SEND = 0x79, > NVME_CMD_ZONE_MGMT_RECV = 0x7a, > NVME_CMD_ZONE_APPEND = 0x7d, > @@ -724,6 +725,35 @@ typedef struct QEMU_PACKED NvmeDsmRange { > uint64_t slba; > } NvmeDsmRange; > > +enum { > + NVME_COPY_FORMAT_0 = 0x0, > +}; > + > +typedef struct NvmeCopyCmd { > + uint8_t opcode; > + uint8_t flags; > + uint16_t cid; > + uint32_t nsid; > + uint32_t rsvd2[4]; > + NvmeCmdDptr dptr; > + uint64_t sdlba; > + uint32_t cdw12; > + uint32_t cdw13;
Can we find better names for the fields within cdw's 12 and 13? Something like: uint8_t nr; uint8_t control[3]; uint16_t rsvd13; uint16_t dspec;