[nvmewin] Patch with changes for Namespace Management

Robles, Raymond C raymond.c.robles at intel.com
Tue Mar 15 12:46:10 PDT 2016


Thanks Carolyn.

I agree with your decision to speed up the review of this patch (it’s been outstanding for quite a while now due to the several revisions). The minor, non-functional requests can be modified either at a later time or via each individual pull and update. There are several other patches in line, plus the WHQL “test run” to release a driver by mid-year.

Suman and Tom,

Once you have reviewed and approved this latest revision, let me know and I will push the patch.

Thanks,
Ray

From: Foster, Carolyn D
Sent: Monday, March 14, 2016 4:35 PM
To: suman.p at samsung.com; nvmewin at lists.openfabrics.org
Cc: Robles, Raymond C <raymond.c.robles at intel.com>; tru.nguyen at ssi.samsung.com; judy.brock at ssi.samsung.com; MANOJ THAPLIYAL <m.thapliyal at samsung.com>
Subject: RE: Re: [nvmewin] Patch with changes for Namespace Management

Hi All,
I have one final patch update, I tried to make minimal changes to speed up the review.  Suman I did not make your suggested changes because they were non-functional changes.  However, I was able to go back and update the code to resolve the issues with 0 namespaces.

I incorporated some additional comments that Tom had made, and they are included as follows:

nvmeInit.c:
Line 1814: Modified condition in function “NVMeInitCallback” from “<=” to “==”.
Line 1529/1635: Added a condition to check “NumKnownNamespaces == 0” to avoid calling identify ns if no namespaces are present.
nvmeStd.c: Line 3055/3059 – Added a condition to modify the DataBufferSize for all the combinations of CNS value.
nvmeStd.h: Line 83 - Added definition for 4K IDENTIFY_LIST_SIZE
nvmeStat.c: Line 484 – Added a condition to avoid filling NSID to 0 in case no namespaces are present.

Tom made an additional comment on issues with report luns, and I am not able to recreate the failure.

The password is intelnvme

Carolyn

From: SUMAN PRAKASH B [mailto:suman.p at samsung.com]
Sent: Tuesday, March 08, 2016 3:48 AM
To: Foster, Carolyn D <carolyn.d.foster at intel.com<mailto:carolyn.d.foster at intel.com>>; nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
Cc: Robles, Raymond C <raymond.c.robles at intel.com<mailto:raymond.c.robles at intel.com>>; tru.nguyen at ssi.samsung.com<mailto:tru.nguyen at ssi.samsung.com>; judy.brock at ssi.samsung.com<mailto:judy.brock at ssi.samsung.com>; MANOJ THAPLIYAL <m.thapliyal at samsung.com<mailto:m.thapliyal at samsung.com>>
Subject: Re: Re: [nvmewin] Patch with changes for Namespace Management


Hi Carolyn,



We have reviewed the code and the changes look good, apart from the following minor comment:

1) File: nvmeStd.c, Function:  NVMeIoctlNamespaceMgmt(), Line no: 3978

memset is not required as NVMeAllocatePool() will allocate memory for buffer and memset that buffer to zero.

Same is applicable for pRMT->pProcGroupTbl in NVMeEnumNumaCores() in nvmeInit.c, line no:370, which is not part of Intel's patch.



Anyway, we feel, if there is no other review comments from others, no need for Intel to submit updated patch after correcting the above. Samsung can make these changes when we submit our next patch after Intel's NS mgmt patch.



Thanks,

Suman



------- Original Message -------

Sender : Foster, Carolyn D<carolyn.d.foster at intel.com<mailto:carolyn.d.foster at intel.com>>

Date : Feb 26, 2016 21:57 (GMT+05:30)

Title : Re: [nvmewin] Patch with changes for Namespace Management


Hi all,
I am sending the updated patch incorporating feedback I received.  The changes are listed below, along with my comments about the feedback I did not address.  The password is intelnvme

Patch updates:

-          Server 2012 was failing to shut down because of mismatched calls to StorportDeviceBusy and StorportDeviceReady after delete or detach commands.

-          NVMeGetNamespaceStatusAndSlot(pDevExt, currentNSID, &lunId); moved inside the below condition.
   if (pNsMgmtDW10->SEL == NAMESPACE_MANAGEMENT_DELETE) { }

-          In function:  NVMeIoctlNamespaceMgmt - allocate memory for pNsCtrlsList and free the memory after command completion.

-          In the Namespace Detach/Delete path – removed unnecessary calls to StorportNotification

-          In functions NVMeCompletionNsAttachment and FormatNVMGetIdentify changed PRP preparation to size of Identify Namespace

-          In function NVMeSetFeaturesCompletion added check for SC==INVALID_NAMESPACE_OR_FORMAT

-          In function NVMeSetFeaturesCompletion For the case where NS Mgmt is not supported, nsStatus should be set to ATTACHED

-          In function NVMeSetFeaturesCompletion In the case where NS mgmt is not supported, nsStatus will be "INVALID"

Suggested feedback I did not incorporate:

-          I was not able to make any improvements to the driver handling for the zero attached namespace case.  If the feedback is that this must be implemented for this patch, I will need two more weeks.

-          pAE->DriverState.NumQueuesSet – I could not find any such field in the driver

-          Check should validate that the SCT is GENERIC_COMMAND_STATUS – I did not change this because I’d have to add a new else condition, and I could not commit to testing that kind of a change.

-          I didn’t make any of the suggested changes to the LBA RANGE buffer size, because again, I could not commit to testing them

-          It is safe to set SEL field  to NAMESPACE_MANAGEMENT_DELETE  in the pNsMgmtCmd structure – as far as I can see when stepping through the code we set this, line 4102 in nvmeStd.c

Carolyn

From: nvmewin-bounces at lists.openfabrics.org<mailto:nvmewin-bounces at lists.openfabrics.org> [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Foster, Carolyn D
Sent: Friday, January 15, 2016 4:57 PM
To: nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
Subject: [nvmewin] Patch with changes for Namespace Management

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.









[cid:image001.gif at 01D17EB8.A58F01B0]

[http://ext.samsung.net/mailcheck/SeenTimeChecker?do=22f8650517ba68655e9ebd4ee858fbd4c5713e275360f6b7b8a3fd6b4a260c0ed33a9d35f6e1735f20a30c65ae77ad69c7b41e955949e5c8a728c55b39cc59eacf878f9a26ce15a0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20160315/b756016b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 13168 bytes
Desc: image001.gif
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20160315/b756016b/attachment.gif>


More information about the nvmewin mailing list