]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: fix dsm, dspec wrong usage
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Fri, 11 Feb 2022 07:02:18 +0000 (16:02 +0900)
committerSteven Seungcheol Lee <sc108.lee@samsung.com>
Fri, 11 Feb 2022 11:13:40 +0000 (20:13 +0900)
dsm is 8bits on Command Dword13 [07:00]
dspec should issued on nvme_io_args.dspec

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Documentation/nvme-compare.txt
Documentation/nvme-read.txt
Documentation/nvme-write.txt
nvme.c

index 4f651627754136291b8ea0cee66fbb2a18c1f92b..f082a33e1a3684e027ea57829df48d4dbef645f8 100644 (file)
@@ -118,15 +118,14 @@ metadata is passes.
 
 -D <dsm>::
 --dsm=<dsm>::
-       The optional data set management attributes for this command. The
-       argument for this is the lower 16 bits of the DSM field in a write
-       command; the upper 16 bits of the field come from the directive
+       The optional data set management attributes for this command. The argument
+       for this is the least significant 8 bits of the DSM field in a write
+       command; the most significant 16 bits of the field come from the directive
        specific field, if used. This may be used to set attributes for
        the LBAs being written, like access frequency, type, latency,
        among other things, as well as yet to be defined types. Please
        consult the NVMe specification for detailed breakdown of how to
        use this field.
-
 -v::
 --show-cmd::
        Print out the command to be sent.
index 2d641371138c6e5b24862c2555df0a624ef3c280..8565431cc5bd757d3d683affab557561ee373aa0 100644 (file)
@@ -107,9 +107,9 @@ metadata is passes.
 
 -D <dsm>::
 --dsm=<dsm>::
-       The optional data set management attributes for this command. The
-       argument for this is the lower 16 bits of the DSM field in a write
-       command; the upper 16 bits of the field come from the directive
+       The optional data set management attributes for this command. The argument
+       for this is the least significant 8 bits of the DSM field in a write
+       command; the most significant 16 bits of the field come from the directive
        specific field, if used. This may be used to set attributes for
        the LBAs being written, like access frequency, type, latency,
        among other things, as well as yet to be defined types. Please
index c730c92b84b480a593dc67d26c96dd994896703e..4ac46e030bc9db3c8428c58880c98113ecb3ae9d 100644 (file)
@@ -115,9 +115,9 @@ metadata is passes.
 
 -D <dsm>::
 --dsm=<dsm>::
-       The optional data set management attributes for this command. The
-       argument for this is the lower 16 bits of the DSM field in a write
-       command; the upper 16 bits of the field come from the directive
+       The optional data set management attributes for this command. The argument
+       for this is the least significant 8 bits of the DSM field in a write
+       command; the most significant 16 bits of the field come from the directive
        specific field, if used. This may be used to set attributes for
        the LBAs being written, like access frequency, type, latency,
        among other things, as well as yet to be defined types. Please
diff --git a/nvme.c b/nvme.c
index c4d1be352d5ebf4d135dda64011d116d87d8d0b6..cc48aea9753b4c1833f32cf9c1718e171537576a 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -6056,7 +6056,7 @@ static int submit_io(int opcode, char *command, const char *desc,
        const char *dry = "show command instead of sending";
        const char *dtype = "directive type (for write-only)";
        const char *dspec = "directive specific (for write-only)";
-       const char *dsm = "dataset management attributes (lower 16 bits)";
+       const char *dsm = "dataset management attributes (lower 8 bits)";
        const char *storage_tag_check = "This bit specifies the Storage Tag field shall be " \
                "checked as part of end-to-end data protection processing";
        const char *storage_tag = "storage tag, CDW2 and CDW3 (00:47) bits "\
@@ -6073,9 +6073,9 @@ static int submit_io(int opcode, char *command, const char *desc,
                char  *data;
                char  *metadata;
                __u8  prinfo;
-               __u8 dtype;
+               __u8  dtype;
                __u16 dspec;
-               __u16 dsmgmt;
+               __u dsmgmt;
                __u16 app_tag_mask;
                __u16 app_tag;
                __u64 storage_tag;
@@ -6123,7 +6123,7 @@ static int submit_io(int opcode, char *command, const char *desc,
                OPT_FLAG("storage-tag-check", 'C', &cfg.storage_tag_check, storage_tag_check),
                OPT_BYTE("dir-type",          'T', &cfg.dtype,             dtype),
                OPT_SHRT("dir-spec",          'S', &cfg.dspec,             dspec),
-               OPT_SHRT("dsm",               'D', &cfg.dsmgmt,            dsm),
+               OPT_BYTE("dsm",               'D', &cfg.dsmgmt,            dsm),
                OPT_FLAG("show-command",      'v', &cfg.show,              show),
                OPT_FLAG("dry-run",           'w', &cfg.dry_run,           dry),
                OPT_FLAG("latency",           't', &cfg.latency,           latency),
@@ -6292,8 +6292,8 @@ static int submit_io(int opcode, char *command, const char *desc,
                .slba           = cfg.start_block,
                .nlb            = cfg.block_count,
                .control        = control,
-               .dsm            = dsmgmt,
-               .dspec          = 0,
+               .dsm            = cfg.dsmgmt,
+               .dspec          = cfg.dspec,
                .reftag         = cfg.ref_tag,
                .apptag         = cfg.app_tag,
                .appmask        = cfg.app_tag_mask,