[nvmewin] Handling IO when Format NVM op is in progress
Judy Brock-SSI
judy.brock at ssi.samsung.com
Tue Jan 7 20:39:22 PST 2014
Hi,
Responses inline below in red - thanks.
-----Original Message-----
From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Kwok Kong
Sent: Tuesday, January 07, 2014 9:57 AM
To: nvmewin at lists.openfabrics.org
Subject: Re: [nvmewin] Handling IO when Format NVM op is in progress
I would agree with Barrett. What problem do you want to solve here ?
1) Bug-fixing current logic which does not in fact hide any LUNs before initiating the format NVM op. As per the thread I attached at the beginning of this revived thread, it has been confirmed that this logic is missing. So right now we are not providing any protection against the scenario we claim to want to guard against.
2) Simplification of the Windows driver. It is simpler logic to merely return an errors during format op like a real SCSI dev would than it is to wait for all the inquiries to come back down, in the meantime returning errors on new IOS that come in after the Format NVM ioctl is received but before the entire bus rescan has completed (we have no control over how long it will take Storport to do that btw) and thus the existing LUNS are not yet offlined, etc. - the whole fencing state machine is a lot more complicated if part of it depends on actions to be taken by Storport on the front end.
3) Compatibility with SCSI behavior - this is a SCSI miniport and thus inputs/outputs should behave pretty much the same as other SCSI miniports.
Why do you want to send IO to a device while you are doing a NVMe format ?
1) I don't necessarily want to. What I am saying is that the driver should not be in the business of orchestrating special behavior that is inconsistent with other SCSI-to-NVMe translations, emulations, etc. I am curious as to what the open-source Linux driver does. Also I am not necessarily saying IOs need go thru all the way to the device. Since our driver knows when a Format NVM op is in prog, it could easily cook the sense data to be returned. Either way we'd be closer to "normal" SCSI dev behavior.
Since a NVMe format may change the sector size and all data are gone, a NVMe format should behave as if a drive had been removed and a new drive was added.
It can accomplish that by signaling a Bus Change at the end of the Format Op.
I think the simplest procedure to do a NVMe format is to:
- offline the LUN (or remove the LUN from the system)
- NVMe format
- online the LUN
Do you see any problem with this simple approach ?
1. The offlining is overkill - returning NOT READY while format is in prog and Bus Change Detected at end of format op will accomplish what is desired.
2. The offlining is not taking place before the NVM format is launched in the current driver - see the originally-attached thread. So the current driver is broken any way we look at it - it's just a matter of the easiest way to fix it imo.
Have you a use case that this procedure does not work ?
Thanks
-Kwok
----------------------------------------------------------------------
Message: 1
Date: Tue, 7 Jan 2014 05:15:24 +0000
From: "Mayes, Barrett N" <barrett.n.mayes at intel.com<mailto:barrett.n.mayes at intel.com>>
To: Judy Brock-SSI <judy.brock at ssi.samsung.com<mailto:judy.brock at ssi.samsung.com>>,
"nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>" <nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>>
Subject: Re: [nvmewin] Handling IO when Format NVM op is in progress
Message-ID:
<B8DB29EA17EB2742AC3405C31A9B9EE9609824DF at ORSMSX106.amr.corp.intel.com<mailto:B8DB29EA17EB2742AC3405C31A9B9EE9609824DF at ORSMSX106.amr.corp.intel.com>>
Content-Type: text/plain; charset="us-ascii"
What problem do you want to solve by keeping the block device around during a format and allowing IO through so it can be failed with check condition?
Namespace not ready can't generically be translated to SCSI check condition/not ready/Format In Progress. The driver would need to know that a format command is outstanding so it could translate that correctly (for 1.0-based device support) since the namespace could be not ready for reasons other than a format in progress. If the driver already has to know a format is in progress, it could just fail commands without sending it to the device (so no need for the new failure code). But if that's the case, why _not_ hide the LUN until the format is complete. By hiding the LUN and bringing it back when the format is complete, you don't have to worry about handling IO and you also take care of the re-enumeration that has to happen when the format is complete (in the case of changing the LBA Format).
-Barrett
From: nvmewin-bounces at lists.openfabrics.org<mailto:nvmewin-bounces at lists.openfabrics.org> [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Judy Brock-SSI
Sent: Monday, January 06, 2014 8:09 PM
To: nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
Subject: [nvmewin] Handling IO when Format NVM op is in progress
All,
Many months ago, I initiated a thread (see attached) in which I argued that there were some holes in the current implementation of Format NVM ioctl passthru and in which I advocated for, among other things, the addition of logic to make sure pseudo-SCSI bus re-enumeration had fully taken place in the driver (such that Storport was notified that no "luns" were present) before the actual Format NVM op was launched.
I intuitively understand - and up to this point have unquestioningly agreed with - the basic assumption that the reason the namespaces must be removed/ "luns" disappeared prior to formatting is because "we cannot format a namespace while the OS is aware of its presence and could be potentially sending I/O to a stale namespace config (i.e. changing LBA/sector size)." (excerpt from attached thread).
The question has recently arisen in internal discussion however as to whether or not we really have to do this. It was pointed out that SCSI devices (real ones) are capable of receiving IO commands while SCSI format commands are in process. They will return the following error:
SCSI status = Check condition, sense code = NOT READY (0x2), additional sense code = LUN NOT READY (0x4), additional sense code qualifier = FORMAT IN PROGRESS (0x4)
Why then, instead of removing namespaces/luns, can our Windows driver not return the same error status a real SCSI drive would return in such a situation? One would assume that upper layers of the storage stack have plenty years of experience in knowing what to do when it sees that error.
As a point of comparison, there is no standard I am aware of which specifies that Storport miniports which support real SCSI devices, if they happen to provide a proprietary pass-thru to allow a SCSI format command to go through to a device, must cause all LUNS to appear offline prior to formatting,
One could even argue (and they have!) that these IO commands could even be allowed to go through to the NVMe device itself (as in the real SCSI case); NVMe 1.1 Technical Proposal 005 has defined a new format-in-progress status code that NVMe firmware will be able to return at some point in the future, current firmware could easily return NAMESPACE_NOT_READY and driver could translate to the above SCSI sense data, etc.
So ... here I stand, devil's advocate hat in hand, hoping to find out:
a) what the "back story" is on how this decision was ultimately made (the attached thread said a lot of discussion took place on the subject)
b) whether or not the diametrically-opposed alternative I am discussing above was thoroughly considered and if so, why it was rejected
c) whether the topic bears reconsidering at this point.
Thanks in advance for your collective consideration,
Judy
_______________________________________________
nvmewin mailing list
nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/nvmewin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20140108/de126764/attachment.html>
More information about the nvmewin
mailing list