1NVME-COMPARE(1) NVMe Manual NVME-COMPARE(1)
2
3
4
6 nvme-compare - Send an NVMe Compare command, provide results
7
9 nvme-compare <device> [--start-block=<slba> | -s <slba>]
10 [--block-count=<nlb> | -c <nlb>]
11 [--data-size=<size> | -z <size>]
12 [--metadata-size=<metasize> | -y <metasize>]
13 [--ref-tag=<reftag> | -r <reftag>]
14 [--data=<data-file> | -d <data-file>]
15 [--metadata=<meta> | -M <meta>]
16 [--prinfo=<prinfo> | -p <prinfo>]
17 [--app-tag-mask=<appmask> | -m <appmask>]
18 [--app-tag=<apptag> | -a <apptag>]
19 [--limited-retry | -l]
20 [--force-unit-access | -f]
21 [--dir-type=<type> | -T <type>]
22 [--dir-spec=<spec> | -S <spec>]
23 [--dsm=<dsm> | -D <dsm>]
24 [--show-command | -v]
25 [--dry-run | -w]
26 [--latency | -t]
27
29 The Compare command reads the logical blocks specified by the command
30 from the medium and compares the data read to a comparison data buffer
31 transferred as part of the command. If the data read from the
32 controller and the comparison data buffer are equivalent with no
33 miscompares, then the command completes successfully. If there is any
34 miscompare, the command completes with an error of Compare Failure. If
35 metadata is provided, then a comparison is also performed for the
36 metadata.
37
39 -s <slba>, --start-block=<slba>
40 64-bit address of the first block to access.
41
42 -c <nlb>, --block-count=<nlb>
43 Number of blocks to be accessed (zero-based).
44
45 -z <size>, --data-size=<size>
46 Size of data to be compared in bytes.
47
48 -y <metasize>, --metadata-size=<metasize>
49 Size of metadata to be trasnferred in bytes.
50
51 -r <reftag>, --ref-tag=<regtag>
52 Reference Tag for Protection Information
53
54 -d <data-file>, --data=<data-file>
55 Data file.
56
57 -M <meta>, --metadata=<meta>
58 Metadata file.
59
60 -p <prinfo>, --prinfo=<prinfo>
61 Protection Information and check field.
62
63 +
64
65 ┌────┬────────────────────────────┐
66 │ │ │
67 │Bit │ Description │
68 ├────┼────────────────────────────┤
69 │ │ │
70 │3 │ PRACT: Protection │
71 │ │ Information Action. When │
72 │ │ set to 1, PI is │
73 │ │ stripped/inserted on │
74 │ │ read/write when the block │
75 │ │ format’s metadata size is │
76 │ │ 8. When set to 0, metadata │
77 │ │ is passes. │
78 ├────┼────────────────────────────┤
79 │ │ │
80 │2:0 │ PRCHK: Protection │
81 │ │ Information Check: │
82 ├────┼────────────────────────────┤
83 │ │ │
84 │2 │ Set to 1 enables checking │
85 │ │ the guard tag │
86 ├────┼────────────────────────────┤
87 │ │ │
88 │1 │ Set to 1 enables checking │
89 │ │ the application tag │
90 ├────┼────────────────────────────┤
91 │ │ │
92 │0 │ Set to 1 enables checking │
93 │ │ the reference tag │
94 └────┴────────────────────────────┘
95
96 -m <appmask>, --app-tag-mask=<appmask>
97 App Tag Mask for Protection Information
98
99 -a <apptag>, --app-tag=<apptag>
100 App Tag for Protection Information
101
102 -l, --limited-retry
103 Number of limited attempts to media.
104
105 -f, --force-unit-access
106 FUA option to guarantee that data is stored to media.
107
108 -T <type>, --dir-type=<type>
109 Optional directive type. The nvme-cli only enforces the value be in
110 the defined range for the directive type, though the NVMe
111 specifcation (1.3a) defines only one directive, 01h, for write
112 stream idenfiers.
113
114 -S <spec>, --dir-spec=<spec>
115 Optional field for directive specifics. When used with write
116 streams, this value is defined to be the write stream identifier.
117 The nvme-cli will not validate the stream requested is within the
118 controller’s capabilities.
119
120 -D <dsm>, --dsm=<dsm>
121 The optional data set management attributes for this command. The
122 argument for this is the lower 16 bits of the DSM field in a write
123 command; the upper 16 bits of the field come from the directive
124 specific field, if used. This may be used to set attributes for the
125 LBAs being written, like access frequency, type, latency, among
126 other things, as well as yet to be defined types. Please consult
127 the NVMe specification for detailed breakdown of how to use this
128 field.
129
130 -v, --show-cmd
131 Print out the command to be sent.
132
133 -w, --dry-run
134 Do not actually send the command. If want to use --dry-run option,
135 --show-cmd option must be set. Otherwise --dry-run option will be
136 ignored.
137
138 -t, --latency
139 Print out the latency the IOCTL took (in us).
140
142 No examples yet.
143
145 Part of the nvme-user suite
146
147
148
149NVMe 04/24/2020 NVME-COMPARE(1)