nvme verify命令就相当于大致执行了read命令,但是不会将disk内容传输到host,controller只做数据integrity校验,然后将结果告诉host。

Verify command can check the integrity of stored data and metadata. The Verify command is roughly equivalent to a Read command that discards the data and metadata after reading. The important behavior of Verify is that errors are reported if the data or metadata cannot be read without expending the time and resources required to return the data and metadata to the host.

The Verify command is simple: it does everything a normal read command does, except for returning the data to the host system. If a read command would return an error, a verify command will return the same error. If a read command would be successful, a verify command will be as well. This makes it possible to do a low-level scrub of the stored data without being bottlenecked by the host interface bandwidth.

The Verify command verifies integrity of stored information by reading data and metadata, if applicable, for the LBAs indicated without transferring any data or metadata to the host. A Verify operation consists of the controller actions (e.g., reading) that verify integrity of stored information during execution of a Verify command.

总结下:在没有verify command之前,如果想做数据integrity的校验,那么就需要下发read command,此时会涉及到host interface bandwidth等资源的消耗,开销较大;而verify command可以获取到数据integrity校验结果,但是无需像read command那样消耗资源。


参考资料:

  1. Changes in NVMe Revision 1.4
  2. NVMe 1.4 Specification Published: Further Optimizing Performance and Reliability