Page MenuHomeFreeBSD

Add Format NVM support to nvmecontrol
AbandonedPublic

Authored by chuck on Jul 1 2017, 12:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 1:50 AM
Unknown Object (File)
Wed, Apr 10, 12:42 AM
Unknown Object (File)
Tue, Apr 9, 12:42 PM
Unknown Object (File)
Thu, Mar 28, 3:51 PM
Unknown Object (File)
Dec 23 2023, 10:07 AM
Unknown Object (File)
Dec 13 2023, 6:19 AM
Unknown Object (File)
Nov 9 2023, 7:19 PM
Unknown Object (File)
Nov 8 2023, 2:47 PM

Details

Reviewers
chuck_tuffli.net
Group Reviewers
manpages
Summary

This gives the ability to do a low level format of a pre-existing NVMe Namespace. The Format NVM command allows setting the block size of the Namespace (e.g. 512B or 4KB), specifying the type of T10 Protection Information to use, or erasing the contents. Note that similar options exist when creating a Namespace via the Namespace Management command.

The command options allow directly specifying all 5 parameters given in the NVMe 1.3 spec.

Test Plan

Formatted a drive with different LBAF values and observed that the output from nvmecontrol identify updated appropriately.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Is this really format, or is it namespace provisioning? There's another set of name space provisioning patches that are also under review right now.

In D11433#236562, @imp wrote:

Is this really format, or is it namespace provisioning? There's another set of name space provisioning patches that are also under review right now.

Yes, this is actually Format NVM and not Namespace Management.

wblock added inline comments.
sbin/nvmecontrol/nvmecontrol.8
36

Please remember to bump .Dd.

138

Please start new sentences on new lines.

This section would be easier to read as a list (.Bl):

.Ss format
The format command allows a low level format of the NVM media.
Each of the options mirror the field names defined in the NVM Express
specification.
.Bl -tag -width 10n
.It Fl f
Choose the LBA Format.
Valid values are 0-15.
.It Fl m
Choose whether metadata is appended to the block (extended LBA) or sent
in a separate buffer.
.It Fl p
Select the end-to-end protection information (Type 0 - 3).
.It Fl l
Select whether the protection information is first (1) or last (0) in the
metadata.
.It Fl s
Select the type of low level format (none = 0, user erase = 1,
cryptographic erase = 2).

While complete, this interface is a total PITA. End to end protection type 2 is what again? Oh, I have to go look in the standard to understand all these parameters?
Can we at least have a description of what's going on here? A table for each of the magic numbers?

In D11433#238350, @imp wrote:

While complete, this interface is a total PITA. End to end protection type 2 is what again? Oh, I have to go look in the standard to understand all these parameters?
Can we at least have a description of what's going on here? A table for each of the magic numbers?

I'm not attached to this interface, and if it is going to be a pain to use, I'm happy to change it. Admittedly, the approach does require knowledge of the NVMe command. The thought was, by using raw values, the application doesn't need to change if the specification introduces a new parameter value.

Can you give me or point me to an example that would be a better model? Would the following be any better:
-b <block size in bytes>
-m <metadata size in bytes - default=0x0>
-s <option to specify separate metadata - default is extended LBA>
-p <T10 protection type - default is none, doc will have a description of each>
-l <option to specify protection information is first - default is location is last>
-e <option to do user data erase>
-E <option to do secure data erase>

chuck added a reviewer: chuck_tuffli.net.
chuck removed a subscriber: chuck.
chuck added a subscriber: mav.

Since @mav committed something similar, abandoning this review.