[nvmewin] Patch with changes for Namespace Management

Foster, Carolyn D carolyn.d.foster at intel.com
Fri Jan 15 15:57:26 PST 2016


Hi all,
This patch includes changes to support Namespace Management updates from the NVMe specification 1.2.  This patch implements some fixes for handling non-continuous namespaces, adds handling for attached and detached namespaces, and implements new IOCTLs to create, delete, attach and detach namespaces.

I have made a detailed overview of the changes in the text file in the attached zip file, the contents are also copied here below.

Password is intelnvme


Please let me know if you have any questions.

Carolyn Foster



This patch includes changes to support Namespace management, including create, delete,
attach and detach namespace operations.  The new functionality in this patch was tested
using proprietary tools.  We tested on Server 2008 R2, Server 2012 R2 and Windows 8.1


******************
Design Assumptions
******************

1. The numbering of namespaces need not be consecutive.
2. The namespace ID can be any number between 1 and 2^32.
3. A namespace is considered "active" only when it is created and attached to this controller.
4. A detached namespace, or one that is just created but not yet attached is considered "inactive".
5. A non-existent, or deleted namespace is considered "invalid".
6. An active namespace will result in one (and only one) "Online" LUN.
7. Assuming single-host, and single-controller NVMe system.

*********************
Architecture Overview
*********************

There are four new IOCTLs for namespace management, Create, Delete, Attach and Detach.  An attached
namespace will result in a visible LUN to the Windows OS.  The LUN extension table has been updated
to have a Namespace status:

typedef enum _NS_STATUS
{
    INVALID = 0,    //Namespace ID does not exist (not known to controller).
    INACTIVE,       //Namespace is created, but not attached to controller.
    ATTACHED        //Namespace is created and attached to controller.
} NS_STATUS;

In order to properly build the LUN extension table during initialization, we made changes to identify
all namespaces, and to determine each namespace's status.  These changes include new states in the
Init State Machine NVMeRnningWaitOnListAttachedNs and NVMeRunningWaitOnListExistingNs.  The updated
state machine steps are as follows:

1. Send an Identify Namespace command with CNS set to 02h. This should return a list of all active (created and attached) namespaces.
2. Go through the list and update LUN extension entries accordingly, one entry for each namespace. Set all LUN status to online.
3. Send an Identify Namespace command with CNS set to 10h. This should return a list of all existing namespaces in the system, active and inactive.
4. Go through the list.
5. If a corresponding LUN entry exists, skip this step, as this must have been an active namespace that was covered in previous steps.
LUN extension entries are populated as follows:

When a namespace is created:
- namespaceId is set.
- nsStatus is set to "INACTIVE"
- slotStatus is set to "FREE"
- identifyData is partially set

When a namespace is attached:
- drive is pulled for namespace identify
- identifyData is set accordingly
- nsStatus is set to "ATTACHED"
- slotStatus is set to "ONLINE"
- ReadOnly is set to FALSE

When a namespace is detached:
- nsStatus is set to "INACTIVE"
- slotStatus is set to "FREE"
- ReadOnly is set to TRUE

When a namespace is deleted:
- The entire LUN extension entry is set to 0.

There are also new reasons for the LUN to be offline:

typedef enum _LUN_OFFLINE_REASON
{
    NOT_OFFLINE,
    FORMAT_IN_PROGRESS,
    DETACH_IN_PROGRESS,
    DELETE_IN_PROGRESS
    // Add more as needed
} LUN_OFFLINE_REASON;

When delete or detach requests are made, the driver will call StorportDeviceBusy to pause incoming requests,
and the LUN is marked as offline with the appropriate reason.  When a user tries to delete an attached namespace,
the driver will first send a detach command, and then the delete command.

*****************
Known Limitations
*****************

1. If no namepsaces are present, the driver will fail to load.
2. If an error happens on any one namespace during initialization the driver will fail to load.

The handling for these two scenarios could be strengthened and improved, which we did not get to in this patch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20160115/6e282642/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IntelNamespaceManagementV1.zip
Type: application/x-zip-compressed
Size: 222253 bytes
Desc: IntelNamespaceManagementV1.zip
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20160115/6e282642/attachment.bin>


More information about the nvmewin mailing list