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