From mikeb at bustrace.com Tue Sep 2 15:56:28 2014 From: mikeb at bustrace.com (Mike Berhan) Date: Tue, 2 Sep 2014 16:56:28 -0600 Subject: [nvmewin] StorPortInitializePerfOpts Issue Message-ID: <002801cfc701$21c0ec60$6542c520$@bustrace.com> The NVMe OFA BugZilla database does not appear to be used. Should bug submissions simply be posted to the reflector? While capturing NVMe<->Storport traffic, I found a spec compliance issue in the NVMeInitialize() routine where it enables optimization of storport DPCs. The code in question is: PERF_CONFIGURATION_DATA perfData = {0}; Status = StorPortInitializePerfOpts(pAE, TRUE, &perfData); ASSERT(STOR_STATUS_SUCCESS == Status); if (STOR_STATUS_SUCCESS == Status) { /* Allow optimization of storport DPCs */ if (perfData.Flags & STOR_PERF_DPC_REDIRECTION) { perfData.Flags = STOR_PERF_DPC_REDIRECTION; } Status = StorPortInitializePerfOpts(pAE, FALSE, &perfData); ASSERT(STOR_STATUS_SUCCESS == Status); } The problem is that the Version and Size fields, of the PERF_CONFIGURATION_DATA structure, are not set for the query or the setting of the performance optimizations. You might expect the initial query to fail, since the fields are not set, but it succeeds. Here is the return data from the query: Local var @ 0xffffd001c58d3f38 Type _PERF_CONFIGURATION_DATA +0x000 Version : 0 +0x004 Size : 0 +0x008 Flags : 3 +0x00c ConcurrentChannels : 0 +0x010 FirstRedirectionMessageNumber : 0 +0x014 LastRedirectionMessageNumber : 0 +0x018 DeviceNode : 0 +0x01c Reserved : 0 +0x020 MessageTargets : (null) So the STOR_PERF_DPC_REDIRECTION flag was set even though the Version/Size fields were not set. I'm assuming this is for legacy compatibility. The main concern is that the WDK specifically states that STOR_PERF_DPC_REDIRECTION is only valid when Version is >=2. Here is how Microsoft's AHCI driver handles the same DPC optimization for reference. I've highlighted the lines in question that are missing from the NVMe driver. PERF_CONFIGURATION_DATA perfConfigData = {0}; // // Query perf optimization information // perfConfigData.Version = STOR_PERF_VERSION; perfConfigData.Size = sizeof(PERF_CONFIGURATION_DATA); status = StorPortInitializePerfOpts(AdapterExtension, TRUE, &perfConfigData); // // Turn on DPC Redirection if it's supported. // if ((status == STOR_STATUS_SUCCESS) && ((perfConfigData.Flags & STOR_PERF_DPC_REDIRECTION) != 0)) { AhciZeroMemory((PCHAR)&perfConfigData, sizeof(PERF_CONFIGURATION_DATA)); perfConfigData.Version = STOR_PERF_VERSION; perfConfigData.Size = sizeof(PERF_CONFIGURATION_DATA); perfConfigData.Flags = STOR_PERF_DPC_REDIRECTION; status = StorPortInitializePerfOpts(AdapterExtension, FALSE, &perfConfigData); NT_ASSERT(status == STOR_STATUS_SUCCESS); } Mike Berhan busTRACE Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alex.Chang at pmcs.com Tue Sep 2 22:28:42 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Wed, 3 Sep 2014 05:28:42 +0000 Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Message-ID: Hi Suman and Judy, Just in case you did not notice our patch had been pushed in. Please let me know when your patch will be ready for review/test. Thank you very much, Alex From: Alex Chang Sent: Thursday, August 28, 2014 4:13 PM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Dear all, Thank you for reviewing/testing the patch from PMC. The patch had been pushed into the source base and a new tag called "Patch#27_SCSI_Compliance_N_SRB_Ext_Fixes" had been created under tags directory. Samsung is scheduled to submit next patch after re-basing with most current sources in the repository. Hi Suman and Judy, You may send out your patch when it's available for the community to review and test. Thanks, Alex nvmewin mailing list nvmewin at lists.openfabrics.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From judy.brock at ssi.samsung.com Thu Sep 4 09:43:06 2014 From: judy.brock at ssi.samsung.com (Judy Brock-SSI) Date: Thu, 4 Sep 2014 16:43:06 +0000 Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes In-Reply-To: References: Message-ID: <36E8D38D6B771A4BBDB1C0D800158A516B64C2E8@SSIEXCH-MB3.ssi.samsung.com> Hi Alex, We have re-based our changes to latest OFA branch. We are in the process of testing this driver and will be resubmitting our patch shortly. Thanks, Judy From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Alex Chang Sent: Tuesday, September 02, 2014 10:29 PM To: nvmewin at lists.openfabrics.org Subject: Re: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Hi Suman and Judy, Just in case you did not notice our patch had been pushed in. Please let me know when your patch will be ready for review/test. Thank you very much, Alex From: Alex Chang Sent: Thursday, August 28, 2014 4:13 PM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Dear all, Thank you for reviewing/testing the patch from PMC. The patch had been pushed into the source base and a new tag called "Patch#27_SCSI_Compliance_N_SRB_Ext_Fixes" had been created under tags directory. Samsung is scheduled to submit next patch after re-basing with most current sources in the repository. Hi Suman and Judy, You may send out your patch when it's available for the community to review and test. Thanks, Alex nvmewin mailing list nvmewin at lists.openfabrics.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alex.Chang at pmcs.com Thu Sep 4 09:45:11 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Thu, 4 Sep 2014 16:45:11 +0000 Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes In-Reply-To: <36E8D38D6B771A4BBDB1C0D800158A516B64C2E8@SSIEXCH-MB3.ssi.samsung.com> References: <36E8D38D6B771A4BBDB1C0D800158A516B64C2E8@SSIEXCH-MB3.ssi.samsung.com> Message-ID: Excellent! Thank you, Judy. Alex From: Judy Brock-SSI [mailto:judy.brock at ssi.samsung.com] Sent: Thursday, September 04, 2014 9:43 AM To: Alex Chang; nvmewin at lists.openfabrics.org Subject: RE: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Hi Alex, We have re-based our changes to latest OFA branch. We are in the process of testing this driver and will be resubmitting our patch shortly. Thanks, Judy From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Alex Chang Sent: Tuesday, September 02, 2014 10:29 PM To: nvmewin at lists.openfabrics.org Subject: Re: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Hi Suman and Judy, Just in case you did not notice our patch had been pushed in. Please let me know when your patch will be ready for review/test. Thank you very much, Alex From: Alex Chang Sent: Thursday, August 28, 2014 4:13 PM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From PMC For SCSI Compliance And SRB Ext Fixes Dear all, Thank you for reviewing/testing the patch from PMC. The patch had been pushed into the source base and a new tag called "Patch#27_SCSI_Compliance_N_SRB_Ext_Fixes" had been created under tags directory. Samsung is scheduled to submit next patch after re-basing with most current sources in the repository. Hi Suman and Judy, You may send out your patch when it's available for the community to review and test. Thanks, Alex nvmewin mailing list nvmewin at lists.openfabrics.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From suman.p at samsung.com Fri Sep 5 06:56:04 2014 From: suman.p at samsung.com (SUMAN PRAKASH B) Date: Fri, 05 Sep 2014 13:56:04 +0000 (GMT) Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 201409051928872_V0UVOUUB.gif Type: image/gif Size: 13168 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: scsicompliance.txt Type: application/octet-stream Size: 163552 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SamsungPatch1_v4_09052014.zip Type: application/octet-stream Size: 176171 bytes Desc: not available URL: From Alex.Chang at pmcs.com Fri Sep 5 08:31:01 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Fri, 5 Sep 2014 15:31:01 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <28663_1409925369_5409C0F9_28663_719_1_EE.2B.04938.5F0C9045@epcpsbgx1.samsung.com> References: <28663_1409925369_5409C0F9_28663_719_1_EE.2B.04938.5F0C9045@epcpsbgx1.samsung.com> Message-ID: Thank you, Suman. Hi all, Please review the patch and provide feedback as soon as possible. I will start collecting approvals on September 18. Thank you! Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it's called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to '1' first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don't need both - we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to '0' and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn - http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFC8E3.9B5BCD90] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Fri Sep 5 12:04:31 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Fri, 5 Sep 2014 19:04:31 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <28663_1409925369_5409C0F9_28663_719_1_EE.2B.04938.5F0C9045@epcpsbgx1.samsung.com> References: <28663_1409925369_5409C0F9_28663_719_1_EE.2B.04938.5F0C9045@epcpsbgx1.samsung.com> Message-ID: Hi all, In case you wonder the password is samsung123. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it's called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to '1' first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don't need both - we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to '0' and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn - http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFC901.6F96FC70] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Fri Sep 5 13:53:45 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Fri, 5 Sep 2014 20:53:45 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <28663_1409925369_5409C0F9_28663_719_1_EE.2B.04938.5F0C9045@epcpsbgx1.samsung.com> References: <28663_1409925369_5409C0F9_28663_719_1_EE.2B.04938.5F0C9045@epcpsbgx1.samsung.com> Message-ID: Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be "PSTOR_DEVICE_CAPABILITIES_EX" instead of "PSTOR_DEVICE_CAPABILITIES". Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it's called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to '1' first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don't need both - we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to '0' and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn - http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFC90E.DD500DD0] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Mon Sep 8 07:51:31 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Mon, 8 Sep 2014 14:51:31 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <65.B9.04938.2629D045@epcpsbgx1.samsung.com> References: <65.B9.04938.2629D045@epcpsbgx1.samsung.com> Message-ID: Yes, please do so. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFCB39.93BE7260] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Tue Sep 9 17:21:14 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Wed, 10 Sep 2014 00:21:14 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <65.B9.04938.2629D045@epcpsbgx1.samsung.com> References: <65.B9.04938.2629D045@epcpsbgx1.samsung.com> Message-ID: Hi all, If you haven’t review/test the patch, please do so and provide your feedback at your earliest convenience such that Suman can revise patch. Thank you! Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFCC52.52249EF0] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Thu Sep 11 12:45:48 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Thu, 11 Sep 2014 19:45:48 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <65.B9.04938.2629D045@epcpsbgx1.samsung.com> References: <65.B9.04938.2629D045@epcpsbgx1.samsung.com> Message-ID: Hi Suman, If there is no more feedback by the end of today, could you please revise your patch and send it out sometime tomorrow? Thank you very much, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFCDBE.2C22C430] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD000.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD000.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From suman.p at samsung.com Fri Sep 12 04:57:26 2014 From: suman.p at samsung.com (SUMAN PRAKASH B) Date: Fri, 12 Sep 2014 11:57:26 +0000 (GMT) Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Message-ID: <09.21.05230.6AFD2145@epcpsbgx3.samsung.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 201409121730433_XOK0LK7C.gif Type: image/gif Size: 13168 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SamsungPatch1_v5_09122014.zip Type: application/octet-stream Size: 176200 bytes Desc: not available URL: From Alex.Chang at pmcs.com Fri Sep 12 07:50:28 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Fri, 12 Sep 2014 14:50:28 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: <30127_1410523049_5412DFA9_30127_16833_1_78.21.05230.6AFD2145@epcpsbgx3.samsung.com> References: <30127_1410523049_5412DFA9_30127_16833_1_78.21.05230.6AFD2145@epcpsbgx3.samsung.com> Message-ID: Dear all, Please review/test the patch and provide your feedback at your earliest convenience. I plan to collect approvals next Wednesday. Thank you! Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 12, 2014 4:57 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: RE: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Alex, I have revised the patch with the following 2 corrections - a. nvmesnti.c - castings of PSCSI_REQUEST_BLOCK for StorPortGetScatterGatherList are missing in the following lines 1727,2068,5225,5285,5396,5464 and 5635. b. nvmestd.c - In line#1083, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Please find attached the revised patch. Password is samsung123. Thanks all for reviewing. Regards, Suman ------- Original Message ------- Sender : Alex Chang Date : Sep 12, 2014 00:45 (GMT+05:00) Title : RE: RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, If there is no more feedback by the end of today, could you please revise your patch and send it out sometime tomorrow? Thank you very much, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFCE5E.138A1D60] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ~WRD171.jpg Type: image/jpeg Size: 823 bytes Desc: ~WRD171.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Wed Sep 17 08:01:46 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Wed, 17 Sep 2014 15:01:46 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: References: <30127_1410523049_5412DFA9_30127_16833_1_78.21.05230.6AFD2145@epcpsbgx3.samsung.com> Message-ID: Hi Parag and Carolyn, I am finalizing the tests on the patch now. If you approve it, please let me know as soon as possible. Thank you! Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Alex Chang Sent: Friday, September 12, 2014 7:50 AM To: suman.p at samsung.com; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Dear all, Please review/test the patch and provide your feedback at your earliest convenience. I plan to collect approvals next Wednesday. Thank you! Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 12, 2014 4:57 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: RE: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Alex, I have revised the patch with the following 2 corrections - a. nvmesnti.c - castings of PSCSI_REQUEST_BLOCK for StorPortGetScatterGatherList are missing in the following lines 1727,2068,5225,5285,5396,5464 and 5635. b. nvmestd.c - In line#1083, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Please find attached the revised patch. Password is samsung123. Thanks all for reviewing. Regards, Suman ------- Original Message ------- Sender : Alex Chang> Date : Sep 12, 2014 00:45 (GMT+05:00) Title : RE: RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, If there is no more feedback by the end of today, could you please revise your patch and send it out sometime tomorrow? Thank you very much, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang> Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFD24D.858AE1E0] [Image removed by sender.] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 823 bytes Desc: image002.jpg URL: From parag.sheth at seagate.com Wed Sep 17 11:40:31 2014 From: parag.sheth at seagate.com (Parag Sheth) Date: Wed, 17 Sep 2014 11:40:31 -0700 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: References: <30127_1410523049_5412DFA9_30127_16833_1_78.21.05230.6AFD2145@epcpsbgx3.samsung.com> Message-ID: Hi Alex, Yes I did review the changes and they look good. Although I was not able to test them as my test system is down. But looking at the changes - there should not be any problem. Thanks Parag SHeth On Wed, Sep 17, 2014 at 8:01 AM, Alex Chang wrote: > Hi Parag and Carolyn, > > I am finalizing the tests on the patch now. If you approve it, please let > me know as soon as possible. > > Thank you! > > Alex > > > > *From:* nvmewin-bounces at lists.openfabrics.org [mailto: > nvmewin-bounces at lists.openfabrics.org] *On Behalf Of *Alex Chang > *Sent:* Friday, September 12, 2014 7:50 AM > *To:* suman.p at samsung.com; nvmewin at lists.openfabrics.org > *Cc:* cpgs . > *Subject:* Re: [nvmewin] Samsung Patch for Random bug fixes - Resubmit > > > > Dear all, > > Please review/test the patch and provide your feedback at your earliest > convenience. I plan to collect approvals next Wednesday. > > Thank you! > > Alex > > > > *From:* SUMAN PRAKASH B [mailto:suman.p at samsung.com ] > > *Sent:* Friday, September 12, 2014 4:57 AM > *To:* Alex Chang; nvmewin at lists.openfabrics.org > *Cc:* cpgs . > *Subject:* Re: RE: RE: Samsung Patch for Random bug fixes - Resubmit > > > > Content-Type: text/plain; charset=UTF-8 > > Content-Transfer-Encoding: 8bit > > Date: %%SENT_DATE%% > > Subject: Suspect Message Quarantined > > > > > > > > WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: > > > > %%DESC%% > > > > The full message and the attachment have been stored in the quarantine. > > > > The identifier for this message is '%%QID%%'. > > > > Access the quarantine at: > > https://puremessage.pmc-sierra.bc.ca:28443/ > > > > For more information on PMC's Anti-Spam system: > > http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ > > > > IT Services > > PureMessage Admin > > > > Hi Alex, > > > > I have revised the patch with the following 2 corrections - > > > > a. nvmesnti.c - castings of PSCSI_REQUEST_BLOCK for > StorPortGetScatterGatherList are missing in the following > lines 1727,2068,5225,5285,5396,5464 and 5635. > > b. nvmestd.c - In line#1083, the casting should be > “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. > > > > Please find attached the revised patch. Password is *samsung123*. > > > > Thanks all for reviewing. > > > > Regards, > > Suman > > > > ------- *Original Message* ------- > > *Sender* : Alex Chang > > *Date* : Sep 12, 2014 00:45 (GMT+05:00) > > *Title* : RE: RE: Samsung Patch for Random bug fixes - Resubmit > > > > > > Hi Suman, > > If there is no more feedback by the end of today, could you please revise > your patch and send it out sometime tomorrow? > > Thank you very much, > > Alex > > > > *From:* SUMAN PRAKASH B [mailto:suman.p at samsung.com ] > > *Sent:* Monday, September 08, 2014 4:26 AM > *To:* Alex Chang; nvmewin at lists.openfabrics.org > *Cc:* cpgs . > *Subject:* Re: RE: Samsung Patch for Random bug fixes - Resubmit > > > > Hi Alex, > > > > Is it OK if I take these 2 observations as review comments and update the > Samsung patch once I get review comments from others too? > > > > Thanks, > > Suman > > > > ------- *Original Message* ------- > > *Sender* : Alex Chang > > *Date* : Sep 06, 2014 01:53 (GMT+05:00) > > *Title* : RE: Samsung Patch for Random bug fixes - Resubmit > > > > > > Hi Suman, > > I diffed between your patch and the most current source and found the > castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList > are missing in the following lines of nvmesnti.c: > > 1727,2068,5225,5285,5396,5464 and 5635. > > The reason I added the casting is to fix warning level issue that we need > to use W3 and treat warnings as errors. Could you please add them back and > make sure you added changes on top of the most current sources? > > In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES > _EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the > warning level to W3 and treat warnings as errors, you will see the > compiling error. > > Thanks, > Alex > > > > *From:* SUMAN PRAKASH B [mailto:suman.p at samsung.com ] > > *Sent:* Friday, September 05, 2014 6:56 AM > *To:* nvmewin at lists.openfabrics.org > *Cc:* Alex Chang; cpgs at samsung.com > *Subject:* Samsung Patch for Random bug fixes - Resubmit > > > > Content-Type: text/plain; charset=UTF-8 > > Content-Transfer-Encoding: 8bit > > Date: %%SENT_DATE%% > > Subject: Suspect Message Quarantined > > > > > > > > WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: > > > > %%DESC%% > > > > The full message and the attachment have been stored in the quarantine. > > > > The identifier for this message is '%%QID%%'. > > > > Access the quarantine at: > > https://puremessage.pmc-sierra.bc.ca:28443/ > > > > For more information on PMC's Anti-Spam system: > > http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ > > > > IT Services > > PureMessage Admin > > > > Hi Everyone, > > > > We have a patch for the following random bug fixes. We have merged our > changes over OFA Revision 106. > > > > 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should > have a return value of type BOOLEAN that can be checked to see if it was > successful or not. > > > > 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have > a return value that can be checked to see if it was successful or not. > Right now, wherever it’s called from the code forges ahead regardless of > whether it succeeded or failed. > > > > 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before > setting to 0. > The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to > make sure that CSTS.RDY is set to ‘1’ first. This check has to be included > in this routine. Since it is not, there are many paths in the driver where > there is no prior check for this condition: > a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter > b) NVMeNormalShutdown -> NVMeResetAdapter > c) NVMeAdapterControlPowerDown -> NVMeResetAdapter > d) NVMeSynchronizeReset -> NVMeResetAdapter > > 4) Memory corruption while creating inquiry response data - In > SntiTranslateStandardInquiryPage(), the following line of code is accessing > a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): > pStdInquiry->Reserved3[0] = RESERVED_FIELD; > > 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is > redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine > NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. > > 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to > 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to > become 0 because right after it does so, it calls NVMeResetAdapter which > does the exact same thing. > > 7) Write Buffer implementation correction. > a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and > DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. > b. Set the SRB Status value for NVMe command failure condition in > SntiCompletionCallbackRoutine. > c. Prepare the Firmware Activate Command and issue the command in case of > DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. > d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer > command. > > 8) Enabling Eject option in the taskbar. > > > > 9) StorPortGetScatterGatherList() - The second parameter pSrb is > typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it > will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is > already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. > > > > 10) SntiTranslateReadCapacity10() - When the disk capacity is more than > 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command > should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is > greater than the DWORD unit. This specification is, of course, considered > in SCSI translation code. However 'minus 1' code which should not be > applied in this case is executed. This makes device capacity to be 2TB > (0xFFFF FFFE x 0x200 = 2047.99GB). > > > > 11) SntiTranslateRequestSense() - No need to separately get pSenseData for > win7 and Win8. The GET_DATA_BUFFER will be defined to > (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. > > > > 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, > SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be > number of dwords - 1 value. > > > > 13) NVMeProcessPublicIoctl() - For > IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 > value is corrected to be number of dwords - 1 value. > > > > 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in > our setup (please find attached the scsicompliance test failure log) > a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. > b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. > c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. > > > > for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel > and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in > this patch. > for c), the implementation is not as per NVMe-SCSI translation > specification. But even if we follow the specification, we don t get a > uniqueid. So Judy has proposed to change the SCSI Name format so that we > get unique id for each device. This proposal in pending for 30 day review. > Once review is complete and approved, We will include the modifications in > the next Samsung patch. > > > > 15) Invalid return value for NVMeAdapterControl > NVMeAdapterControl miniport routine - sometimes returns illegal value. > WDK specifies that the driver must always return ScsiAdapterControlSuccess. > However, depending on execution, the driver may currently return > ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter > control types. > As per msdn – > http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx > > > 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. > > > > *Unit tests:* > Tested the following on Win7 and Windows 2012R2. > > - Executed NVMe SCSI compliance tests > > - Executed IOmeter > > - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. > > - Hot plug > > > > Thanks, > > Suman > > > > > > > > > > [image: Image removed by sender.] > > _______________________________________________ > nvmewin mailing list > nvmewin at lists.openfabrics.org > > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openfabrics.org_mailman_listinfo_nvmewin&d=AAICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=QOwFo5M7MYyQeT06CcSuSQHSUdSO20xC9GZe6-T9Svk&m=j6D7ZI8F3Aa9SQlZWxJK4uUxNG1P29bbv3b3SZpOxbE&s=fcwM8_-rqRoV3MS8sC6SAATWyb_X3bUXyS32PXOQqCE&e= > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 823 bytes Desc: not available URL: From carolyn.d.foster at intel.com Wed Sep 17 15:57:11 2014 From: carolyn.d.foster at intel.com (Foster, Carolyn D) Date: Wed, 17 Sep 2014 22:57:11 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: References: <30127_1410523049_5412DFA9_30127_16833_1_78.21.05230.6AFD2145@epcpsbgx3.samsung.com> Message-ID: Hi Alex, we approve the patch. Thanks, Carolyn From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Parag Sheth Sent: Wednesday, September 17, 2014 11:41 AM To: Alex Chang Cc: nvmewin at lists.openfabrics.org; suman.p at samsung.com; cpgs . Subject: Re: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Hi Alex, Yes I did review the changes and they look good. Although I was not able to test them as my test system is down. But looking at the changes - there should not be any problem. Thanks Parag SHeth On Wed, Sep 17, 2014 at 8:01 AM, Alex Chang > wrote: Hi Parag and Carolyn, I am finalizing the tests on the patch now. If you approve it, please let me know as soon as possible. Thank you! Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Alex Chang Sent: Friday, September 12, 2014 7:50 AM To: suman.p at samsung.com; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Dear all, Please review/test the patch and provide your feedback at your earliest convenience. I plan to collect approvals next Wednesday. Thank you! Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 12, 2014 4:57 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: RE: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Alex, I have revised the patch with the following 2 corrections - a. nvmesnti.c - castings of PSCSI_REQUEST_BLOCK for StorPortGetScatterGatherList are missing in the following lines 1727,2068,5225,5285,5396,5464 and 5635. b. nvmestd.c - In line#1083, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Please find attached the revised patch. Password is samsung123. Thanks all for reviewing. Regards, Suman ------- Original Message ------- Sender : Alex Chang> Date : Sep 12, 2014 00:45 (GMT+05:00) Title : RE: RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, If there is no more feedback by the end of today, could you please revise your patch and send it out sometime tomorrow? Thank you very much, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang> Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFD290.086CDEF0] [Image removed by sender.] _______________________________________________ nvmewin mailing list nvmewin at lists.openfabrics.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openfabrics.org_mailman_listinfo_nvmewin&d=AAICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=QOwFo5M7MYyQeT06CcSuSQHSUdSO20xC9GZe6-T9Svk&m=j6D7ZI8F3Aa9SQlZWxJK4uUxNG1P29bbv3b3SZpOxbE&s=fcwM8_-rqRoV3MS8sC6SAATWyb_X3bUXyS32PXOQqCE&e= -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 823 bytes Desc: image002.jpg URL: From Alex.Chang at pmcs.com Wed Sep 17 17:32:33 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Thu, 18 Sep 2014 00:32:33 +0000 Subject: [nvmewin] Samsung Patch for Random bug fixes - Resubmit In-Reply-To: References: <30127_1410523049_5412DFA9_30127_16833_1_78.21.05230.6AFD2145@epcpsbgx3.samsung.com> Message-ID: Thank you, Carolyn and Parag. Alex From: Foster, Carolyn D [mailto:carolyn.d.foster at intel.com] Sent: Wednesday, September 17, 2014 3:57 PM To: Parag Sheth; Alex Chang Cc: nvmewin at lists.openfabrics.org; suman.p at samsung.com; cpgs . Subject: RE: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Hi Alex, we approve the patch. Thanks, Carolyn From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Parag Sheth Sent: Wednesday, September 17, 2014 11:41 AM To: Alex Chang Cc: nvmewin at lists.openfabrics.org; suman.p at samsung.com; cpgs . Subject: Re: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Hi Alex, Yes I did review the changes and they look good. Although I was not able to test them as my test system is down. But looking at the changes - there should not be any problem. Thanks Parag SHeth On Wed, Sep 17, 2014 at 8:01 AM, Alex Chang > wrote: Hi Parag and Carolyn, I am finalizing the tests on the patch now. If you approve it, please let me know as soon as possible. Thank you! Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Alex Chang Sent: Friday, September 12, 2014 7:50 AM To: suman.p at samsung.com; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: [nvmewin] Samsung Patch for Random bug fixes - Resubmit Dear all, Please review/test the patch and provide your feedback at your earliest convenience. I plan to collect approvals next Wednesday. Thank you! Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 12, 2014 4:57 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: RE: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Alex, I have revised the patch with the following 2 corrections - a. nvmesnti.c - castings of PSCSI_REQUEST_BLOCK for StorPortGetScatterGatherList are missing in the following lines 1727,2068,5225,5285,5396,5464 and 5635. b. nvmestd.c - In line#1083, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Please find attached the revised patch. Password is samsung123. Thanks all for reviewing. Regards, Suman ------- Original Message ------- Sender : Alex Chang> Date : Sep 12, 2014 00:45 (GMT+05:00) Title : RE: RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, If there is no more feedback by the end of today, could you please revise your patch and send it out sometime tomorrow? Thank you very much, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Monday, September 08, 2014 4:26 AM To: Alex Chang; nvmewin at lists.openfabrics.org Cc: cpgs . Subject: Re: RE: Samsung Patch for Random bug fixes - Resubmit Hi Alex, Is it OK if I take these 2 observations as review comments and update the Samsung patch once I get review comments from others too? Thanks, Suman ------- Original Message ------- Sender : Alex Chang> Date : Sep 06, 2014 01:53 (GMT+05:00) Title : RE: Samsung Patch for Random bug fixes - Resubmit Hi Suman, I diffed between your patch and the most current source and found the castings of PSCSI_REQUEST_BLOCK I added for StorPortGetScatterGatherList are missing in the following lines of nvmesnti.c: 1727,2068,5225,5285,5396,5464 and 5635. The reason I added the casting is to fix warning level issue that we need to use W3 and treat warnings as errors. Could you please add them back and make sure you added changes on top of the most current sources? In line#1083 of nvmestd.c, the casting should be “PSTOR_DEVICE_CAPABILITIES_EX” instead of “PSTOR_DEVICE_CAPABILITIES”. Again, if you changes the warning level to W3 and treat warnings as errors, you will see the compiling error. Thanks, Alex From: SUMAN PRAKASH B [mailto:suman.p at samsung.com] Sent: Friday, September 05, 2014 6:56 AM To: nvmewin at lists.openfabrics.org Cc: Alex Chang; cpgs at samsung.com Subject: Samsung Patch for Random bug fixes - Resubmit Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin Hi Everyone, We have a patch for the following random bug fixes. We have merged our changes over OFA Revision 106. 1) Handling return value for NVMeWaitForCtrlRDY. NVMeWaitForCtrlRDY should have a return value of type BOOLEAN that can be checked to see if it was successful or not. 2) Handling return value for NVMeCompleteCmd. NVMeCompleteCmd should have a return value that can be checked to see if it was successful or not. Right now, wherever it’s called from the code forges ahead regardless of whether it succeeded or failed. 3) Fixing the NVMeResetAdapter issues to check if CC.EN is set to 1 before setting to 0. The routine NVMeResetAdapter() sets CC.EN to 0 without ever checking to make sure that CSTS.RDY is set to ‘1’ first. This check has to be included in this routine. Since it is not, there are many paths in the driver where there is no prior check for this condition: a) NVMeInitAdminQueues -> NVMeEnableAdapter -> NVMeResetAdapter b) NVMeNormalShutdown -> NVMeResetAdapter c) NVMeAdapterControlPowerDown -> NVMeResetAdapter d) NVMeSynchronizeReset -> NVMeResetAdapter 4) Memory corruption while creating inquiry response data - In SntiTranslateStandardInquiryPage(), the following line of code is accessing a field way past the end of STANDARD_INQUIRY_LENGTH (36 bytes): pStdInquiry->Reserved3[0] = RESERVED_FIELD; 5) Eliminate NVMeWaitOnReady and use only NVMeWaitForCtrlRDY. There is redundancy in the new routine NVMeWaitForCtrlRDY() and the old routine NVMeWaitOnReady(). We don’t need both – we can get rid of the old routine. 6) Fixed the RecoveryDpcRoutine to avoid redundant setting of CC.EN bit to 0. The code does not need to set CC.EN to ‘0’ and then wait for CSTS.RDY to become 0 because right after it does so, it calls NVMeResetAdapter which does the exact same thing. 7) Write Buffer implementation correction. a. Calculation of dword10 for DOWNLOAD_SAVE_ACTIVATE and DOWNLOAD_SAVE_DEFER_ACTIVATE is modified. b. Set the SRB Status value for NVMe command failure condition in SntiCompletionCallbackRoutine. c. Prepare the Firmware Activate Command and issue the command in case of DOWNLOAD_SAVE_ACTIVATE mode in SntiTranslateWriteBufferResponse. d. Handled the scenario of SNTI_SEQUENCE_IN_PROGRESS for Write Data Buffer command. 8) Enabling Eject option in the taskbar. 9) StorPortGetScatterGatherList() - The second parameter pSrb is typecasted to PSCSI_REQUEST_BLOCK. But as per msdn, for Win8/8.1 kernel, it will be PSTORAGE_REQUEST_BLOCK. So it is OK to just pass pSrb which is already either PSCSI_REQUEST_BLOCK or PSTORAGE_REQUEST_BLOCK. 10) SntiTranslateReadCapacity10() - When the disk capacity is more than 2TB, according to the SCSI command spec (SBC-3), READ CAPACITY (10) command should return 0xFFFF FFFF as "Returned Logical Block Address" if lba is greater than the DWORD unit. This specification is, of course, considered in SCSI translation code. However 'minus 1' code which should not be applied in this case is executed. This makes device capacity to be 2TB (0xFFFF FFFE x 0x200 = 2047.99GB). 11) SntiTranslateRequestSense() - No need to separately get pSenseData for win7 and Win8. The GET_DATA_BUFFER will be defined to (SrbGetDataBuffer((PVOID)pSrb)) for Win8 and (pSrb)->DataBuffer for win7. 12) SntiBuildGetLogPageCmd() - The numDwords for ERROR_INFORMATION, SMART_HEALTH_INFORMATION and FIRMWARE_SLOT_INFORMATION is corrected to be number of dwords - 1 value. 13) NVMeProcessPublicIoctl() - For IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, the pSrbExt->nvmeSqeUnit.CDW10 value is corrected to be number of dwords - 1 value. 14) With OFA Revision 106 driver, the SCSI Compliance test is failing in our setup (please find attached the scsicompliance test failure log) a) MODE SELECT 6: MODE SENSE (6) Checking Caching Mode Page Length. b) MODE SELECT 10: MODE SENSE (10) Checking Caching Mode Page Length. c) ASSERTION: INQUIRY Checking Identification Descriptors in VPD page 0x83. for fixing a) and b), we have to use PMODE_CACHING_PAGE for Win7 kernel and PMODE_CACHING_PAGE_EX for Win8/8.1 kernel. We have corrected this in this patch. for c), the implementation is not as per NVMe-SCSI translation specification. But even if we follow the specification, we don t get a uniqueid. So Judy has proposed to change the SCSI Name format so that we get unique id for each device. This proposal in pending for 30 day review. Once review is complete and approved, We will include the modifications in the next Samsung patch. 15) Invalid return value for NVMeAdapterControl NVMeAdapterControl miniport routine - sometimes returns illegal value. WDK specifies that the driver must always return ScsiAdapterControlSuccess. However, depending on execution, the driver may currently return ScsiAdapterControlUnsuccessful for ScsiStopAdapter and ScsiRestartAdapter control types. As per msdn – http://msdn.microsoft.com/en-us/library/windows/hardware/ff557365(v=vs.85).aspx 16) Handling StartIo deadlock when MultipleCoresToSingleQueueFlag is set. Unit tests: Tested the following on Win7 and Windows 2012R2. - Executed NVMe SCSI compliance tests - Executed IOmeter - Install/Uninstall, Enable/Disable driver, FS Format/hibernation. - Hot plug Thanks, Suman [cid:image001.gif at 01CFD29D.57225540] [Image removed by sender.] _______________________________________________ nvmewin mailing list nvmewin at lists.openfabrics.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openfabrics.org_mailman_listinfo_nvmewin&d=AAICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=QOwFo5M7MYyQeT06CcSuSQHSUdSO20xC9GZe6-T9Svk&m=j6D7ZI8F3Aa9SQlZWxJK4uUxNG1P29bbv3b3SZpOxbE&s=fcwM8_-rqRoV3MS8sC6SAATWyb_X3bUXyS32PXOQqCE&e= -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 823 bytes Desc: image002.jpg URL: From Alex.Chang at pmcs.com Wed Sep 17 18:07:20 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Thu, 18 Sep 2014 01:07:20 +0000 Subject: [nvmewin] NVMe Windows DB Is LOCKED - Pushing Samsung Reset Fixes And Others Message-ID: Locking NVMe Windows DB. Thanks, Alex nvmewin mailing list nvmewin at lists.openfabrics.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alex.Chang at pmcs.com Wed Sep 17 18:22:48 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Thu, 18 Sep 2014 01:22:48 +0000 Subject: [nvmewin] NVMe Windows DB Is UNLOCKED - Pushing Patch From Samsung For Reset And Other Fixes Message-ID: Dear all, Thank you very much, Suman and Judy, for adding the changes. Thank you all for reviewing/testing the patch from Samsung. The patch had been pushed into the source base and a new tag called "Patch#28_Reset_N_Other_Fixes" had been created under tags directory. HGST is scheduled to submit next patch after re-basing with most current sources in the repository. Hi Tom and Moji, You may send out your patch and the details when it's available for the community to review and test. Thank you! Alex nvmewin mailing list nvmewin at lists.openfabrics.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.freeman at hgst.com Wed Sep 24 11:55:13 2014 From: thomas.freeman at hgst.com (Thomas Freeman) Date: Wed, 24 Sep 2014 18:55:13 +0000 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Message-ID: <932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> The attached zip file contains source code, project files and instructional documents for WMI and Driver tracing. The password is "hgst1234" We tested the changes on w7, w8 and w8.1 - 64-bit Testing included sdstress, iometer, quick and slow format: MBR and GPT and scsi compliance. Here is a description of the various changes: WMI (WindowsWmiDesc.pdf in the attached zip file gives details on using the change) nvme.vcxproj - Menu for "Mof Compiler" -Create Binary Mof File = "../../source/%(FileName).bmf" -WMI Syntax Check = Yes (-WMI) menu for Linker->Input -added $(DDK_LIB_PATH)\scsiwmi.lib directly in the file. This directive causes VS to create nvmeMofData.h: "$(IntDir)nvmeMofData.h" -u -h"$(IntDir)nvmeMofData.h" nvme.rc - Added "mofResource" statement nvmeMofData.bmf - Visual studio generates this file on every compile. Exists in the "source" directory. nvmeMofData.mof - Used to define WMI obects. Exists in the "source" directory nvmeMofData.h - Visual studio generates during compile. It is created based on nvmeMofData.mof. It exists in the project's intermediate directory (e.g. nvme/x64/Win7Debug). nvmeStd.c -NVMeFindAdapter - indicate that the driver is a wmiProvider and initialize the wmiContext. -NVMeBuildIo - Allow calls to WMI -NVMeStartIo - Allow calls to WMI nvmeStd.h -WmiLibContext - Added this structure to the device extension. The WmiLibContext structure provides registration information for a miniport driver's data and event blocks and defines entry points for the miniport driver's HwScsiWmiXxx callback routines. -WmiReqContext - Added this structure to the srb extension. When processing a WMI command, this structure is used to save context information for that particular command. precomp.h -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, nmeWmi.h WPP - Driver tracing (WindowsTraceCollection.pdf in the attached zip file gives details on using the change) Relied heavily on the document "Using Storage Tracing Support In Miniport Drivers" - http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc nvme.vcxproj - in the Menu for "Wpp Tracing" -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) -Run Wpp Tracing = Yes -Scan Configuration Data = ..\..\source\nvme_tracing.h -Specify Template File = {km-StorDefault.tpl}*.tmh -Trace Kernel-Mode Components = Yes (-km) All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated file to support driver tracing. nvmeStd.c - create a global variable for storing the trace context information. At cleanup time, the Port Driver calls a cleanup routine that uses this global variable. -DriverEntry - Include code to initialize driver tracing through wpp. -WppCleanupRoutine - Added code to be called by the port driver to clean up driver tracing. nvmeStd.h - -add function prototype for Wpp Cleanup routine. -Changed values for debug print levels to match values in evntrace.h INFO = TRACE_LEVEL_INFORMATION, WARNING = TRACE_LEVEL_WARNING, ERROR = TRACE_LEVEL_ERROR, TRACE = TRACE_LEVEL_VERBOSE precomp.h -added nvme_tracing.h Various Fixes nvme.vcxproj -Changed c/c++ compiler warning level to W3/WX nvmeSnti.c SntiTranslateReadCapacity16 - The caller's response buffer was being cleared and set up without regard to its size. I put in changes to allocate a read capacity buffer on the stack. Once that temporary buffer was filled in, I used the response buffer size to determine how much data to copy into the caller's response buffer. NOTE: It appears this same issue occurs in the handling of other scsi commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response buffer was too short, setting the fields in pIdDescriptor would overrun the response buffer). This may be a fix to be implemented in the future. The issue in SntiTranslateReadCapacity16 issue was seen during testing. The potential issue with SntiTranslateDeviceIdentificationPage has not occurred in our testing. SnitTranslateUnmap -Changes to ensure the DataSetManagement buffer was always 16-byte aligned. -Use prp2 to allow the prplist to cross a page boundary -When building the dsm-deallocate command, cdw10->NR was used to count the number of ranges - starting with the value 1. Since NR is a zero-based value, the count was decremented when command building was completed. Unfortunately, when 256 ranges are specified, NR has a value of 0 before decrementing. The value of 0 prevented the code from decrementing NR. A change was made to use a local uint16 variable to cound the number of ranges. SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based value. A change was made to correctly set this as a zero-based value. SntiTranslateLogSense - A pointer to the data buffer is saved in the srb extension. A change was made to also save the data buffer length in the srb extension. The value is used when the data buffer is freed. nvmeStd.h -Increase size of dsmBuffer to allow for 16-byte alignment. -add dataBufferSize to store size of data buffer allocated for log sense command. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1117 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: WMIWppChanges.zip Type: application/x-zip-compressed Size: 2012775 bytes Desc: WMIWppChanges.zip URL: From Alex.Chang at pmcs.com Wed Sep 24 12:24:02 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Wed, 24 Sep 2014 19:24:02 +0000 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes In-Reply-To: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> References: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> Message-ID: Thank you very much, Tom. Dear all, Please review/test the patch at your earliest convenience, and provide feedback if you have any. I plan to push this patch 2nd week of October. Thank you! Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Thomas Freeman Sent: Wednesday, September 24, 2014 11:55 AM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin The attached zip file contains source code, project files and instructional documents for WMI and Driver tracing. The password is "hgst1234" We tested the changes on w7, w8 and w8.1 - 64-bit Testing included sdstress, iometer, quick and slow format: MBR and GPT and scsi compliance. Here is a description of the various changes: WMI (WindowsWmiDesc.pdf in the attached zip file gives details on using the change) nvme.vcxproj - Menu for "Mof Compiler" -Create Binary Mof File = "../../source/%(FileName).bmf" -WMI Syntax Check = Yes (-WMI) menu for Linker->Input -added $(DDK_LIB_PATH)\scsiwmi.lib directly in the file. This directive causes VS to create nvmeMofData.h: "$(IntDir)nvmeMofData.h" -u -h"$(IntDir)nvmeMofData.h" nvme.rc - Added "mofResource" statement nvmeMofData.bmf - Visual studio generates this file on every compile. Exists in the "source" directory. nvmeMofData.mof - Used to define WMI obects. Exists in the "source" directory nvmeMofData.h - Visual studio generates during compile. It is created based on nvmeMofData.mof. It exists in the project's intermediate directory (e.g. nvme/x64/Win7Debug). nvmeStd.c -NVMeFindAdapter - indicate that the driver is a wmiProvider and initialize the wmiContext. -NVMeBuildIo - Allow calls to WMI -NVMeStartIo - Allow calls to WMI nvmeStd.h -WmiLibContext - Added this structure to the device extension. The WmiLibContext structure provides registration information for a miniport driver's data and event blocks and defines entry points for the miniport driver's HwScsiWmiXxx callback routines. -WmiReqContext - Added this structure to the srb extension. When processing a WMI command, this structure is used to save context information for that particular command. precomp.h -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, nmeWmi.h WPP - Driver tracing (WindowsTraceCollection.pdf in the attached zip file gives details on using the change) Relied heavily on the document "Using Storage Tracing Support In Miniport Drivers" - http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc nvme.vcxproj - in the Menu for "Wpp Tracing" -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) -Run Wpp Tracing = Yes -Scan Configuration Data = ..\..\source\nvme_tracing.h -Specify Template File = {km-StorDefault.tpl}*.tmh -Trace Kernel-Mode Components = Yes (-km) All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated file to support driver tracing. nvmeStd.c - create a global variable for storing the trace context information. At cleanup time, the Port Driver calls a cleanup routine that uses this global variable. -DriverEntry - Include code to initialize driver tracing through wpp. -WppCleanupRoutine - Added code to be called by the port driver to clean up driver tracing. nvmeStd.h - -add function prototype for Wpp Cleanup routine. -Changed values for debug print levels to match values in evntrace.h INFO = TRACE_LEVEL_INFORMATION, WARNING = TRACE_LEVEL_WARNING, ERROR = TRACE_LEVEL_ERROR, TRACE = TRACE_LEVEL_VERBOSE precomp.h -added nvme_tracing.h Various Fixes nvme.vcxproj -Changed c/c++ compiler warning level to W3/WX nvmeSnti.c SntiTranslateReadCapacity16 - The caller's response buffer was being cleared and set up without regard to its size. I put in changes to allocate a read capacity buffer on the stack. Once that temporary buffer was filled in, I used the response buffer size to determine how much data to copy into the caller's response buffer. NOTE: It appears this same issue occurs in the handling of other scsi commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response buffer was too short, setting the fields in pIdDescriptor would overrun the response buffer). This may be a fix to be implemented in the future. The issue in SntiTranslateReadCapacity16 issue was seen during testing. The potential issue with SntiTranslateDeviceIdentificationPage has not occurred in our testing. SnitTranslateUnmap -Changes to ensure the DataSetManagement buffer was always 16-byte aligned. -Use prp2 to allow the prplist to cross a page boundary -When building the dsm-deallocate command, cdw10->NR was used to count the number of ranges - starting with the value 1. Since NR is a zero-based value, the count was decremented when command building was completed. Unfortunately, when 256 ranges are specified, NR has a value of 0 before decrementing. The value of 0 prevented the code from decrementing NR. A change was made to use a local uint16 variable to cound the number of ranges. SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based value. A change was made to correctly set this as a zero-based value. SntiTranslateLogSense - A pointer to the data buffer is saved in the srb extension. A change was made to also save the data buffer length in the srb extension. The value is used when the data buffer is freed. nvmeStd.h -Increase size of dsmBuffer to allow for 16-byte alignment. -add dataBufferSize to store size of data buffer allocated for log sense command. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 1117 bytes Desc: image002.gif URL: From Alex.Chang at pmcs.com Mon Sep 29 11:18:32 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Mon, 29 Sep 2014 18:18:32 +0000 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes In-Reply-To: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> References: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> Message-ID: Hi Tom, I have the following comments after browsing the changes you've made: 1. In line 184 of nvmestd.c, can RtlZeroMemory be replaced by memset ? 2. In line 1195 of nvmeinit.c, you moved down memset after page align macro for completion queue start. In case of the original completion queue start wasn't page aligned, memset will clear the memory it shouldn't. Thanks, Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Thomas Freeman Sent: Wednesday, September 24, 2014 11:55 AM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin The attached zip file contains source code, project files and instructional documents for WMI and Driver tracing. The password is "hgst1234" We tested the changes on w7, w8 and w8.1 - 64-bit Testing included sdstress, iometer, quick and slow format: MBR and GPT and scsi compliance. Here is a description of the various changes: WMI (WindowsWmiDesc.pdf in the attached zip file gives details on using the change) nvme.vcxproj - Menu for "Mof Compiler" -Create Binary Mof File = "../../source/%(FileName).bmf" -WMI Syntax Check = Yes (-WMI) menu for Linker->Input -added $(DDK_LIB_PATH)\scsiwmi.lib directly in the file. This directive causes VS to create nvmeMofData.h: "$(IntDir)nvmeMofData.h" -u -h"$(IntDir)nvmeMofData.h" nvme.rc - Added "mofResource" statement nvmeMofData.bmf - Visual studio generates this file on every compile. Exists in the "source" directory. nvmeMofData.mof - Used to define WMI obects. Exists in the "source" directory nvmeMofData.h - Visual studio generates during compile. It is created based on nvmeMofData.mof. It exists in the project's intermediate directory (e.g. nvme/x64/Win7Debug). nvmeStd.c -NVMeFindAdapter - indicate that the driver is a wmiProvider and initialize the wmiContext. -NVMeBuildIo - Allow calls to WMI -NVMeStartIo - Allow calls to WMI nvmeStd.h -WmiLibContext - Added this structure to the device extension. The WmiLibContext structure provides registration information for a miniport driver's data and event blocks and defines entry points for the miniport driver's HwScsiWmiXxx callback routines. -WmiReqContext - Added this structure to the srb extension. When processing a WMI command, this structure is used to save context information for that particular command. precomp.h -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, nmeWmi.h WPP - Driver tracing (WindowsTraceCollection.pdf in the attached zip file gives details on using the change) Relied heavily on the document "Using Storage Tracing Support In Miniport Drivers" - http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc nvme.vcxproj - in the Menu for "Wpp Tracing" -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) -Run Wpp Tracing = Yes -Scan Configuration Data = ..\..\source\nvme_tracing.h -Specify Template File = {km-StorDefault.tpl}*.tmh -Trace Kernel-Mode Components = Yes (-km) All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated file to support driver tracing. nvmeStd.c - create a global variable for storing the trace context information. At cleanup time, the Port Driver calls a cleanup routine that uses this global variable. -DriverEntry - Include code to initialize driver tracing through wpp. -WppCleanupRoutine - Added code to be called by the port driver to clean up driver tracing. nvmeStd.h - -add function prototype for Wpp Cleanup routine. -Changed values for debug print levels to match values in evntrace.h INFO = TRACE_LEVEL_INFORMATION, WARNING = TRACE_LEVEL_WARNING, ERROR = TRACE_LEVEL_ERROR, TRACE = TRACE_LEVEL_VERBOSE precomp.h -added nvme_tracing.h Various Fixes nvme.vcxproj -Changed c/c++ compiler warning level to W3/WX nvmeSnti.c SntiTranslateReadCapacity16 - The caller's response buffer was being cleared and set up without regard to its size. I put in changes to allocate a read capacity buffer on the stack. Once that temporary buffer was filled in, I used the response buffer size to determine how much data to copy into the caller's response buffer. NOTE: It appears this same issue occurs in the handling of other scsi commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response buffer was too short, setting the fields in pIdDescriptor would overrun the response buffer). This may be a fix to be implemented in the future. The issue in SntiTranslateReadCapacity16 issue was seen during testing. The potential issue with SntiTranslateDeviceIdentificationPage has not occurred in our testing. SnitTranslateUnmap -Changes to ensure the DataSetManagement buffer was always 16-byte aligned. -Use prp2 to allow the prplist to cross a page boundary -When building the dsm-deallocate command, cdw10->NR was used to count the number of ranges - starting with the value 1. Since NR is a zero-based value, the count was decremented when command building was completed. Unfortunately, when 256 ranges are specified, NR has a value of 0 before decrementing. The value of 0 prevented the code from decrementing NR. A change was made to use a local uint16 variable to cound the number of ranges. SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based value. A change was made to correctly set this as a zero-based value. SntiTranslateLogSense - A pointer to the data buffer is saved in the srb extension. A change was made to also save the data buffer length in the srb extension. The value is used when the data buffer is freed. nvmeStd.h -Increase size of dsmBuffer to allow for 16-byte alignment. -add dataBufferSize to store size of data buffer allocated for log sense command. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 1117 bytes Desc: image002.gif URL: From parag.sheth at seagate.com Mon Sep 29 18:32:05 2014 From: parag.sheth at seagate.com (Parag Sheth) Date: Mon, 29 Sep 2014 18:32:05 -0700 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes In-Reply-To: References: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> Message-ID: Hi Alex, Tom's change related to your point # 2 seems right. Here is my explanation. - While allocating memory for submission queue + completion queue + command entries, there is 1 additional memory page allocated. - Because this allocation is page aligned to begin with, sub queue start is always page aligned. - making completion queue page aligned might use 1 additionally allocated page. - command entries need not be page aligned. - And all these 3 things are initialized in the above order. So I think clearing memory for completion queue must be done only after page align macro. Let me know if I am missing anything here. Thanks Parag Sheth On Mon, Sep 29, 2014 at 11:18 AM, Alex Chang wrote: > Hi Tom, > > > > I have the following comments after browsing the changes you’ve made: > > 1. In line 184 of nvmestd.c, can RtlZeroMemory be replaced by > memset ? > > 2. In line 1195 of nvmeinit.c, you moved down memset after page > align macro for completion queue start. In case of the original completion > queue start wasn’t page aligned, memset will clear the memory it shouldn’t. > > > > Thanks, > > Alex > > > > *From:* nvmewin-bounces at lists.openfabrics.org [mailto: > nvmewin-bounces at lists.openfabrics.org] *On Behalf Of *Thomas Freeman > *Sent:* Wednesday, September 24, 2014 11:55 AM > *To:* nvmewin at lists.openfabrics.org > *Subject:* [nvmewin] HGST Changes to Enable WMI, Driver Trace and various > fixes > > > > Content-Type: text/plain; charset=UTF-8 > > Content-Transfer-Encoding: 8bit > > Date: %%SENT_DATE%% > > Subject: Suspect Message Quarantined > > > > > > > > WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: > > > > %%DESC%% > > > > The full message and the attachment have been stored in the quarantine. > > > > The identifier for this message is '%%QID%%'. > > > > Access the quarantine at: > > https://puremessage.pmc-sierra.bc.ca:28443/ > > > > For more information on PMC's Anti-Spam system: > > http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ > > > > IT Services > > PureMessage Admin > > > > The attached zip file contains source code, project files and > instructional documents for WMI and Driver tracing. > > The password is “hgst1234” > > > > We tested the changes on w7, w8 and w8.1 – 64-bit > > Testing included sdstress, iometer, quick and slow format: MBR and GPT and > scsi compliance. > > > > > > Here is a description of the various changes: > > > > *WMI *(WindowsWmiDesc.pdf in the attached zip file gives details on using > the change) > > nvme.vcxproj - Menu for "Mof Compiler" > > -Create Binary Mof File = "../../source/%(FileName).bmf" > > -WMI Syntax Check = Yes (-WMI) > > menu for Linker->Input > > -added $(DDK_LIB_PATH)\scsiwmi.lib > > directly in the file. This directive causes VS to create nvmeMofData.h: > > > > > > "$(IntDir)nvmeMofData.h" > > -u -h"$(IntDir)nvmeMofData.h" > > > > > > > > > > nvme.rc - Added "mofResource" statement > > nvmeMofData.bmf - Visual studio generates this file on every compile. > Exists in the "source" directory. > > nvmeMofData.mof – Used to define WMI obects. Exists in the "source" > directory > > nvmeMofData.h - Visual studio generates during compile. It is created > based on nvmeMofData.mof. It exists in the project's intermediate directory > (e.g. nvme/x64/Win7Debug). > > > > nvmeStd.c > > -NVMeFindAdapter - indicate that the driver is a > wmiProvider and initialize the wmiContext. > > -NVMeBuildIo - Allow calls to WMI > > -NVMeStartIo - Allow calls to WMI > > > > nvmeStd.h > > -WmiLibContext - Added this structure to the device > extension. The WmiLibContext structure provides registration information > for a miniport driver's data and event blocks and defines entry points for > the miniport driver's HwScsiWmiXxx callback routines. > > -WmiReqContext - Added this structure to the srb > extension. When processing a WMI command, this structure is used to save > context information for that particular command. > > > > precomp.h > > -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, > nmeWmi.h > > > > > > *WPP - Driver tracing *(WindowsTraceCollection.pdf in the attached zip > file gives details on using the change) > > Relied heavily on the document "Using Storage Tracing Support In Miniport > Drivers" - > http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc > > > > nvme.vcxproj - in the Menu for "Wpp Tracing" > > -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) > > -Run Wpp Tracing = Yes > > -Scan Configuration Data = ..\..\source\nvme_tracing.h > > -Specify Template File = {km-StorDefault.tpl}*.tmh > > -Trace Kernel-Mode Components = Yes (-km) > > > > All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated > file to support driver tracing. > > > > nvmeStd.c - create a global variable for storing the trace context > information. At cleanup time, the Port Driver calls a cleanup routine that > uses this global variable. > > -DriverEntry - Include code to initialize driver tracing > through wpp. > > -WppCleanupRoutine - Added code to be called by the port > driver to clean up driver tracing. > > nvmeStd.h - > > -add function prototype for Wpp Cleanup routine. > > -Changed values for debug print levels to match values in > evntrace.h > > INFO = TRACE_LEVEL_INFORMATION, > > WARNING = TRACE_LEVEL_WARNING, > > ERROR = TRACE_LEVEL_ERROR, > > TRACE = TRACE_LEVEL_VERBOSE > > > > precomp.h > > -added nvme_tracing.h > > > > > > *Various Fixes* > > nvme.vcxproj > > -Changed c/c++ compiler warning level to W3/WX > > nvmeSnti.c > > SntiTranslateReadCapacity16 - The caller’s response buffer was being > cleared and set up without regard to its size. I put in changes to allocate > a read capacity buffer on the stack. Once that temporary buffer was filled > in, I used the response buffer size to determine how much data to copy into > the caller’s response buffer. > > NOTE: It appears this same issue occurs in the handling of other scsi > commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response > buffer was too short, setting the fields in pIdDescriptor would overrun > the response buffer). This may be a fix to be implemented in the future. > The issue in SntiTranslateReadCapacity16 issue was seen during testing. The > potential issue with SntiTranslateDeviceIdentificationPage has not > occurred in our testing. > > > > > > SnitTranslateUnmap > > -Changes to ensure the DataSetManagement buffer was always > 16-byte aligned. > > -Use prp2 to allow the prplist to cross a page boundary > > -When building the dsm-deallocate command, cdw10->NR was > used to count the number of ranges - starting with the value 1. Since NR is > a zero-based value, the count was decremented when command building was > completed. Unfortunately, when 256 ranges are specified, NR has a value of > 0 before decrementing. The value of 0 prevented the code from decrementing > NR. A change was made to use a local uint16 variable to cound the number of > ranges. > > SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based > value. A change was made to correctly set this as a zero-based value. > > SntiTranslateLogSense - A pointer to the data buffer is saved in the > srb extension. A change was made to also save the data buffer length in the > srb extension. The value is used when the data buffer is freed. > > > > nvmeStd.h > > -Increase size of dsmBuffer to allow for 16-byte alignment. > > -add dataBufferSize to store size of data buffer allocated for log > sense command. > > > > > > > > Tom Freeman > > > > Software Engineer, Device Manager and Driver Development > > HGST, a Western Digital company > > Thomas.Freeman at hgst.com > > 507-322-2311 > > > > _______________________________________________ > nvmewin mailing list > nvmewin at lists.openfabrics.org > http://lists.openfabrics.org/mailman/listinfo/nvmewin > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.gif Type: image/gif Size: 1117 bytes Desc: not available URL: From thomas.freeman at hgst.com Tue Sep 30 07:50:01 2014 From: thomas.freeman at hgst.com (Thomas Freeman) Date: Tue, 30 Sep 2014 14:50:01 +0000 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes In-Reply-To: References: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> Message-ID: Thank you Paraq… I like your explanation. In addition to your explanation, I’d also say the drivers uses pCplQStart -> (pCplQstart + queueSize -1) for the completion queue. That is also the address range used in that memset. If those address are wrong, then the CompletionQueue itself is wrong. Alex…. Yes, I’ll change the RtlZeroMemory to memset. I’m not sure why I didn’t use memset to begin with. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 From: Parag Sheth [mailto:parag.sheth at seagate.com] Sent: Monday, September 29, 2014 8:32 PM To: Alex Chang Cc: Thomas Freeman; nvmewin at lists.openfabrics.org Subject: Re: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Hi Alex, Tom's change related to your point # 2 seems right. Here is my explanation. - While allocating memory for submission queue + completion queue + command entries, there is 1 additional memory page allocated. - Because this allocation is page aligned to begin with, sub queue start is always page aligned. - making completion queue page aligned might use 1 additionally allocated page. - command entries need not be page aligned. - And all these 3 things are initialized in the above order. So I think clearing memory for completion queue must be done only after page align macro. Let me know if I am missing anything here. Thanks Parag Sheth On Mon, Sep 29, 2014 at 11:18 AM, Alex Chang > wrote: [cid:image001.gif at 01CFDC93.D0664420] Hi Tom, I have the following comments after browsing the changes you’ve made: 1. In line 184 of nvmestd.c, can RtlZeroMemory be replaced by memset ? 2. In line 1195 of nvmeinit.c, you moved down memset after page align macro for completion queue start. In case of the original completion queue start wasn’t page aligned, memset will clear the memory it shouldn’t. Thanks, Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Thomas Freeman Sent: Wednesday, September 24, 2014 11:55 AM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin The attached zip file contains source code, project files and instructional documents for WMI and Driver tracing. The password is “hgst1234” We tested the changes on w7, w8 and w8.1 – 64-bit Testing included sdstress, iometer, quick and slow format: MBR and GPT and scsi compliance. Here is a description of the various changes: WMI (WindowsWmiDesc.pdf in the attached zip file gives details on using the change) nvme.vcxproj - Menu for "Mof Compiler" -Create Binary Mof File = "../../source/%(FileName).bmf" -WMI Syntax Check = Yes (-WMI) menu for Linker->Input -added $(DDK_LIB_PATH)\scsiwmi.lib directly in the file. This directive causes VS to create nvmeMofData.h: "$(IntDir)nvmeMofData.h" -u -h"$(IntDir)nvmeMofData.h" nvme.rc - Added "mofResource" statement nvmeMofData.bmf - Visual studio generates this file on every compile. Exists in the "source" directory. nvmeMofData.mof – Used to define WMI obects. Exists in the "source" directory nvmeMofData.h - Visual studio generates during compile. It is created based on nvmeMofData.mof. It exists in the project's intermediate directory (e.g. nvme/x64/Win7Debug). nvmeStd.c -NVMeFindAdapter - indicate that the driver is a wmiProvider and initialize the wmiContext. -NVMeBuildIo - Allow calls to WMI -NVMeStartIo - Allow calls to WMI nvmeStd.h -WmiLibContext - Added this structure to the device extension. The WmiLibContext structure provides registration information for a miniport driver's data and event blocks and defines entry points for the miniport driver's HwScsiWmiXxx callback routines. -WmiReqContext - Added this structure to the srb extension. When processing a WMI command, this structure is used to save context information for that particular command. precomp.h -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, nmeWmi.h WPP - Driver tracing (WindowsTraceCollection.pdf in the attached zip file gives details on using the change) Relied heavily on the document "Using Storage Tracing Support In Miniport Drivers" - http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc nvme.vcxproj - in the Menu for "Wpp Tracing" -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) -Run Wpp Tracing = Yes -Scan Configuration Data = ..\..\source\nvme_tracing.h -Specify Template File = {km-StorDefault.tpl}*.tmh -Trace Kernel-Mode Components = Yes (-km) All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated file to support driver tracing. nvmeStd.c - create a global variable for storing the trace context information. At cleanup time, the Port Driver calls a cleanup routine that uses this global variable. -DriverEntry - Include code to initialize driver tracing through wpp. -WppCleanupRoutine - Added code to be called by the port driver to clean up driver tracing. nvmeStd.h - -add function prototype for Wpp Cleanup routine. -Changed values for debug print levels to match values in evntrace.h INFO = TRACE_LEVEL_INFORMATION, WARNING = TRACE_LEVEL_WARNING, ERROR = TRACE_LEVEL_ERROR, TRACE = TRACE_LEVEL_VERBOSE precomp.h -added nvme_tracing.h Various Fixes nvme.vcxproj -Changed c/c++ compiler warning level to W3/WX nvmeSnti.c SntiTranslateReadCapacity16 - The caller’s response buffer was being cleared and set up without regard to its size. I put in changes to allocate a read capacity buffer on the stack. Once that temporary buffer was filled in, I used the response buffer size to determine how much data to copy into the caller’s response buffer. NOTE: It appears this same issue occurs in the handling of other scsi commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response buffer was too short, setting the fields in pIdDescriptor would overrun the response buffer). This may be a fix to be implemented in the future. The issue in SntiTranslateReadCapacity16 issue was seen during testing. The potential issue with SntiTranslateDeviceIdentificationPage has not occurred in our testing. SnitTranslateUnmap -Changes to ensure the DataSetManagement buffer was always 16-byte aligned. -Use prp2 to allow the prplist to cross a page boundary -When building the dsm-deallocate command, cdw10->NR was used to count the number of ranges - starting with the value 1. Since NR is a zero-based value, the count was decremented when command building was completed. Unfortunately, when 256 ranges are specified, NR has a value of 0 before decrementing. The value of 0 prevented the code from decrementing NR. A change was made to use a local uint16 variable to cound the number of ranges. SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based value. A change was made to correctly set this as a zero-based value. SntiTranslateLogSense - A pointer to the data buffer is saved in the srb extension. A change was made to also save the data buffer length in the srb extension. The value is used when the data buffer is freed. nvmeStd.h -Increase size of dsmBuffer to allow for 16-byte alignment. -add dataBufferSize to store size of data buffer allocated for log sense command. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 _______________________________________________ nvmewin mailing list nvmewin at lists.openfabrics.org http://lists.openfabrics.org/mailman/listinfo/nvmewin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1117 bytes Desc: image001.gif URL: From Alex.Chang at pmcs.com Tue Sep 30 08:18:34 2014 From: Alex.Chang at pmcs.com (Alex Chang) Date: Tue, 30 Sep 2014 15:18:34 +0000 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes In-Reply-To: References: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> Message-ID: Thank you, Parag. I know we allocate one extra page intentionally. When people don’t know the trick, the original order simply avoids some concern. Alex From: Thomas Freeman [mailto:thomas.freeman at hgst.com] Sent: Tuesday, September 30, 2014 7:50 AM To: Parag Sheth; Alex Chang Cc: nvmewin at lists.openfabrics.org Subject: RE: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Thank you Paraq… I like your explanation. In addition to your explanation, I’d also say the drivers uses pCplQStart -> (pCplQstart + queueSize -1) for the completion queue. That is also the address range used in that memset. If those address are wrong, then the CompletionQueue itself is wrong. Alex…. Yes, I’ll change the RtlZeroMemory to memset. I’m not sure why I didn’t use memset to begin with. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 From: Parag Sheth [mailto:parag.sheth at seagate.com] Sent: Monday, September 29, 2014 8:32 PM To: Alex Chang Cc: Thomas Freeman; nvmewin at lists.openfabrics.org Subject: Re: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Hi Alex, Tom's change related to your point # 2 seems right. Here is my explanation. - While allocating memory for submission queue + completion queue + command entries, there is 1 additional memory page allocated. - Because this allocation is page aligned to begin with, sub queue start is always page aligned. - making completion queue page aligned might use 1 additionally allocated page. - command entries need not be page aligned. - And all these 3 things are initialized in the above order. So I think clearing memory for completion queue must be done only after page align macro. Let me know if I am missing anything here. Thanks Parag Sheth On Mon, Sep 29, 2014 at 11:18 AM, Alex Chang > wrote: [cid:image001.gif at 01CFDC87.0CF1C2A0] Hi Tom, I have the following comments after browsing the changes you’ve made: 1. In line 184 of nvmestd.c, can RtlZeroMemory be replaced by memset ? 2. In line 1195 of nvmeinit.c, you moved down memset after page align macro for completion queue start. In case of the original completion queue start wasn’t page aligned, memset will clear the memory it shouldn’t. Thanks, Alex From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Thomas Freeman Sent: Wednesday, September 24, 2014 11:55 AM To: nvmewin at lists.openfabrics.org Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: %%SENT_DATE%% Subject: Suspect Message Quarantined WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: %%DESC%% The full message and the attachment have been stored in the quarantine. The identifier for this message is '%%QID%%'. Access the quarantine at: https://puremessage.pmc-sierra.bc.ca:28443/ For more information on PMC's Anti-Spam system: http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ IT Services PureMessage Admin The attached zip file contains source code, project files and instructional documents for WMI and Driver tracing. The password is “hgst1234” We tested the changes on w7, w8 and w8.1 – 64-bit Testing included sdstress, iometer, quick and slow format: MBR and GPT and scsi compliance. Here is a description of the various changes: WMI (WindowsWmiDesc.pdf in the attached zip file gives details on using the change) nvme.vcxproj - Menu for "Mof Compiler" -Create Binary Mof File = "../../source/%(FileName).bmf" -WMI Syntax Check = Yes (-WMI) menu for Linker->Input -added $(DDK_LIB_PATH)\scsiwmi.lib directly in the file. This directive causes VS to create nvmeMofData.h: "$(IntDir)nvmeMofData.h" -u -h"$(IntDir)nvmeMofData.h" nvme.rc - Added "mofResource" statement nvmeMofData.bmf - Visual studio generates this file on every compile. Exists in the "source" directory. nvmeMofData.mof – Used to define WMI obects. Exists in the "source" directory nvmeMofData.h - Visual studio generates during compile. It is created based on nvmeMofData.mof. It exists in the project's intermediate directory (e.g. nvme/x64/Win7Debug). nvmeStd.c -NVMeFindAdapter - indicate that the driver is a wmiProvider and initialize the wmiContext. -NVMeBuildIo - Allow calls to WMI -NVMeStartIo - Allow calls to WMI nvmeStd.h -WmiLibContext - Added this structure to the device extension. The WmiLibContext structure provides registration information for a miniport driver's data and event blocks and defines entry points for the miniport driver's HwScsiWmiXxx callback routines. -WmiReqContext - Added this structure to the srb extension. When processing a WMI command, this structure is used to save context information for that particular command. precomp.h -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, nmeWmi.h WPP - Driver tracing (WindowsTraceCollection.pdf in the attached zip file gives details on using the change) Relied heavily on the document "Using Storage Tracing Support In Miniport Drivers" - http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc nvme.vcxproj - in the Menu for "Wpp Tracing" -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) -Run Wpp Tracing = Yes -Scan Configuration Data = ..\..\source\nvme_tracing.h -Specify Template File = {km-StorDefault.tpl}*.tmh -Trace Kernel-Mode Components = Yes (-km) All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated file to support driver tracing. nvmeStd.c - create a global variable for storing the trace context information. At cleanup time, the Port Driver calls a cleanup routine that uses this global variable. -DriverEntry - Include code to initialize driver tracing through wpp. -WppCleanupRoutine - Added code to be called by the port driver to clean up driver tracing. nvmeStd.h - -add function prototype for Wpp Cleanup routine. -Changed values for debug print levels to match values in evntrace.h INFO = TRACE_LEVEL_INFORMATION, WARNING = TRACE_LEVEL_WARNING, ERROR = TRACE_LEVEL_ERROR, TRACE = TRACE_LEVEL_VERBOSE precomp.h -added nvme_tracing.h Various Fixes nvme.vcxproj -Changed c/c++ compiler warning level to W3/WX nvmeSnti.c SntiTranslateReadCapacity16 - The caller’s response buffer was being cleared and set up without regard to its size. I put in changes to allocate a read capacity buffer on the stack. Once that temporary buffer was filled in, I used the response buffer size to determine how much data to copy into the caller’s response buffer. NOTE: It appears this same issue occurs in the handling of other scsi commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response buffer was too short, setting the fields in pIdDescriptor would overrun the response buffer). This may be a fix to be implemented in the future. The issue in SntiTranslateReadCapacity16 issue was seen during testing. The potential issue with SntiTranslateDeviceIdentificationPage has not occurred in our testing. SnitTranslateUnmap -Changes to ensure the DataSetManagement buffer was always 16-byte aligned. -Use prp2 to allow the prplist to cross a page boundary -When building the dsm-deallocate command, cdw10->NR was used to count the number of ranges - starting with the value 1. Since NR is a zero-based value, the count was decremented when command building was completed. Unfortunately, when 256 ranges are specified, NR has a value of 0 before decrementing. The value of 0 prevented the code from decrementing NR. A change was made to use a local uint16 variable to cound the number of ranges. SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based value. A change was made to correctly set this as a zero-based value. SntiTranslateLogSense - A pointer to the data buffer is saved in the srb extension. A change was made to also save the data buffer length in the srb extension. The value is used when the data buffer is freed. nvmeStd.h -Increase size of dsmBuffer to allow for 16-byte alignment. -add dataBufferSize to store size of data buffer allocated for log sense command. Tom Freeman Software Engineer, Device Manager and Driver Development HGST, a Western Digital company Thomas.Freeman at hgst.com 507-322-2311 _______________________________________________ nvmewin mailing list nvmewin at lists.openfabrics.org http://lists.openfabrics.org/mailman/listinfo/nvmewin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1117 bytes Desc: image001.gif URL: From parag.sheth at seagate.com Tue Sep 30 16:06:57 2014 From: parag.sheth at seagate.com (Parag Sheth) Date: Tue, 30 Sep 2014 16:06:57 -0700 Subject: [nvmewin] HGST Changes to Enable WMI, Driver Trace and various fixes In-Reply-To: References: <2850_1411584948_542313B4_2850_3247_1_932a60f831004058b38554c6fdfe1348@BLUPR04MB673.namprd04.prod.outlook.com> Message-ID: Hi Tom, 1. Your change in function SntiHardCodeCacheModePage (nvmesnti.c) overturns the fix made in last patch. 2. Function SetWmiDataBlock (nvmeWmi.c & .h) is never used. It can be removed. Other than these 2, the patch looks fine. Thanks Parag Sheth On Tue, Sep 30, 2014 at 8:18 AM, Alex Chang wrote: > Thank you, Parag. > > I know we allocate one extra page intentionally. When people don’t know > the trick, the original order simply avoids some concern. > > > > Alex > > > > *From:* Thomas Freeman [mailto:thomas.freeman at hgst.com] > *Sent:* Tuesday, September 30, 2014 7:50 AM > *To:* Parag Sheth; Alex Chang > *Cc:* nvmewin at lists.openfabrics.org > *Subject:* RE: [nvmewin] HGST Changes to Enable WMI, Driver Trace and > various fixes > > > > Thank you Paraq… I like your explanation. > > In addition to your explanation, I’d also say the drivers uses pCplQStart > -> (pCplQstart + queueSize -1) for the completion queue. > > That is also the address range used in that memset. If those address are > wrong, then the CompletionQueue itself is wrong. > > > > Alex…. Yes, I’ll change the RtlZeroMemory to memset. I’m not sure why I > didn’t use memset to begin with. > > > > Tom Freeman > > > > Software Engineer, Device Manager and Driver Development > > HGST, a Western Digital company > > Thomas.Freeman at hgst.com > > 507-322-2311 > > > > *From:* Parag Sheth [mailto:parag.sheth at seagate.com > ] > *Sent:* Monday, September 29, 2014 8:32 PM > *To:* Alex Chang > *Cc:* Thomas Freeman; nvmewin at lists.openfabrics.org > *Subject:* Re: [nvmewin] HGST Changes to Enable WMI, Driver Trace and > various fixes > > > > Hi Alex, > > > > Tom's change related to your point # 2 seems right. > > > > Here is my explanation. > > - While allocating memory for submission queue + completion queue + > command entries, there is 1 additional memory page allocated. > > - Because this allocation is page aligned to begin with, sub queue start > is always page aligned. > > - making completion queue page aligned might use 1 additionally allocated > page. > > - command entries need not be page aligned. > > - And all these 3 things are initialized in the above order. > > > > So I think clearing memory for completion queue must be done only after > page align macro. Let me know if I am missing anything here. > > > > Thanks > > Parag Sheth > > > > On Mon, Sep 29, 2014 at 11:18 AM, Alex Chang wrote: > > Hi Tom, > > > > I have the following comments after browsing the changes you’ve made: > > 1. In line 184 of nvmestd.c, can RtlZeroMemory be replaced by > memset ? > > 2. In line 1195 of nvmeinit.c, you moved down memset after page > align macro for completion queue start. In case of the original completion > queue start wasn’t page aligned, memset will clear the memory it shouldn’t. > > > > Thanks, > > Alex > > > > *From:* nvmewin-bounces at lists.openfabrics.org [mailto: > nvmewin-bounces at lists.openfabrics.org] *On Behalf Of *Thomas Freeman > *Sent:* Wednesday, September 24, 2014 11:55 AM > *To:* nvmewin at lists.openfabrics.org > *Subject:* [nvmewin] HGST Changes to Enable WMI, Driver Trace and various > fixes > > > > Content-Type: text/plain; charset=UTF-8 > > Content-Transfer-Encoding: 8bit > > Date: %%SENT_DATE%% > > Subject: Suspect Message Quarantined > > > > > > > > WARNING: The virus scanner was unable to scan an attachment in an email message sent to you. This attachment could possibly contain viruses or other malicious programs. The attachment could not be scanned for the following reasons: > > > > %%DESC%% > > > > The full message and the attachment have been stored in the quarantine. > > > > The identifier for this message is '%%QID%%'. > > > > Access the quarantine at: > > https://puremessage.pmc-sierra.bc.ca:28443/ > > > > For more information on PMC's Anti-Spam system: > > http://pmc-intranet/wiki/index.php/Outlook:Anti-Spam_FAQ > > > > IT Services > > PureMessage Admin > > > > The attached zip file contains source code, project files and > instructional documents for WMI and Driver tracing. > > The password is “hgst1234” > > > > We tested the changes on w7, w8 and w8.1 – 64-bit > > Testing included sdstress, iometer, quick and slow format: MBR and GPT and > scsi compliance. > > > > > > Here is a description of the various changes: > > > > *WMI *(WindowsWmiDesc.pdf in the attached zip file gives details on using > the change) > > nvme.vcxproj - Menu for "Mof Compiler" > > -Create Binary Mof File = "../../source/%(FileName).bmf" > > -WMI Syntax Check = Yes (-WMI) > > menu for Linker->Input > > -added $(DDK_LIB_PATH)\scsiwmi.lib > > directly in the file. This directive causes VS to create nvmeMofData.h: > > > > > > "$(IntDir)nvmeMofData.h" > > -u -h"$(IntDir)nvmeMofData.h" > > > > > > > > > > nvme.rc - Added "mofResource" statement > > nvmeMofData.bmf - Visual studio generates this file on every compile. > Exists in the "source" directory. > > nvmeMofData.mof – Used to define WMI obects. Exists in the "source" > directory > > nvmeMofData.h - Visual studio generates during compile. It is created > based on nvmeMofData.mof. It exists in the project's intermediate directory > (e.g. nvme/x64/Win7Debug). > > > > nvmeStd.c > > -NVMeFindAdapter - indicate that the driver is a > wmiProvider and initialize the wmiContext. > > -NVMeBuildIo - Allow calls to WMI > > -NVMeStartIo - Allow calls to WMI > > > > nvmeStd.h > > -WmiLibContext - Added this structure to the device > extension. The WmiLibContext structure provides registration information > for a miniport driver's data and event blocks and defines entry points for > the miniport driver's HwScsiWmiXxx callback routines. > > -WmiReqContext - Added this structure to the srb > extension. When processing a WMI command, this structure is used to save > context information for that particular command. > > > > precomp.h > > -added guiddef.h, scsiwmi.h, initguid.h, nvmeMofData.h, > nmeWmi.h > > > > > > *WPP - Driver tracing *(WindowsTraceCollection.pdf in the attached zip > file gives details on using the change) > > Relied heavily on the document "Using Storage Tracing Support In Miniport > Drivers" - > http://download.microsoft.com/download/8/e/8/8e85288f-b718-47d9-a7b2-af19d4c8f031/Storage-tracing-for-miniports.doc > > > > nvme.vcxproj - in the Menu for "Wpp Tracing" > > -Func to Gen Trace = StorStorPortDebugPrint(LEVEL,MSG,...) > > -Run Wpp Tracing = Yes > > -Scan Configuration Data = ..\..\source\nvme_tracing.h > > -Specify Template File = {km-StorDefault.tpl}*.tmh > > -Trace Kernel-Mode Components = Yes (-km) > > > > All c-files: Added include for "nvmeinit.tmh". A Visual Studio generated > file to support driver tracing. > > > > nvmeStd.c - create a global variable for storing the trace context > information. At cleanup time, the Port Driver calls a cleanup routine that > uses this global variable. > > -DriverEntry - Include code to initialize driver tracing > through wpp. > > -WppCleanupRoutine - Added code to be called by the port > driver to clean up driver tracing. > > nvmeStd.h - > > -add function prototype for Wpp Cleanup routine. > > -Changed values for debug print levels to match values in > evntrace.h > > INFO = TRACE_LEVEL_INFORMATION, > > WARNING = TRACE_LEVEL_WARNING, > > ERROR = TRACE_LEVEL_ERROR, > > TRACE = TRACE_LEVEL_VERBOSE > > > > precomp.h > > -added nvme_tracing.h > > > > > > *Various Fixes* > > nvme.vcxproj > > -Changed c/c++ compiler warning level to W3/WX > > nvmeSnti.c > > SntiTranslateReadCapacity16 - The caller’s response buffer was being > cleared and set up without regard to its size. I put in changes to allocate > a read capacity buffer on the stack. Once that temporary buffer was filled > in, I used the response buffer size to determine how much data to copy into > the caller’s response buffer. > > NOTE: It appears this same issue occurs in the handling of other scsi > commands (e.g. in SntiTranslateDeviceIdentificationPage, if the response > buffer was too short, setting the fields in pIdDescriptor would overrun > the response buffer). This may be a fix to be implemented in the future. > The issue in SntiTranslateReadCapacity16 issue was seen during testing. The > potential issue with SntiTranslateDeviceIdentificationPage has not > occurred in our testing. > > > > > > SnitTranslateUnmap > > -Changes to ensure the DataSetManagement buffer was always > 16-byte aligned. > > -Use prp2 to allow the prplist to cross a page boundary > > -When building the dsm-deallocate command, cdw10->NR was > used to count the number of ranges - starting with the value 1. Since NR is > a zero-based value, the count was decremented when command building was > completed. Unfortunately, when 256 ranges are specified, NR has a value of > 0 before decrementing. The value of 0 prevented the code from decrementing > NR. A change was made to use a local uint16 variable to cound the number of > ranges. > > SntiTranslateWriteBuffer - The existing code set dword10 as a 1-based > value. A change was made to correctly set this as a zero-based value. > > SntiTranslateLogSense - A pointer to the data buffer is saved in the > srb extension. A change was made to also save the data buffer length in the > srb extension. The value is used when the data buffer is freed. > > > > nvmeStd.h > > -Increase size of dsmBuffer to allow for 16-byte alignment. > > -add dataBufferSize to store size of data buffer allocated for log > sense command. > > > > > > > > Tom Freeman > > > > Software Engineer, Device Manager and Driver Development > > HGST, a Western Digital company > > Thomas.Freeman at hgst.com > > 507-322-2311 > > > > > _______________________________________________ > nvmewin mailing list > nvmewin at lists.openfabrics.org > http://lists.openfabrics.org/mailman/listinfo/nvmewin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1117 bytes Desc: not available URL: