<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>The NVMe OFA BugZilla database does not appear to be used. Should bug submissions simply be posted to the reflector?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>PERF_CONFIGURATION_DATA perfData = {0};<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Status = StorPortInitializePerfOpts(pAE, TRUE, &perfData);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>ASSERT(STOR_STATUS_SUCCESS == Status);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>if (STOR_STATUS_SUCCESS == Status) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> /* Allow optimization of storport DPCs */<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> if (perfData.Flags & STOR_PERF_DPC_REDIRECTION) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> perfData.Flags = STOR_PERF_DPC_REDIRECTION;<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> Status = StorPortInitializePerfOpts(pAE, FALSE, &perfData);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> ASSERT(STOR_STATUS_SUCCESS == Status);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>Local var @ 0xffffd001c58d3f38 Type _PERF_CONFIGURATION_DATA<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x000 Version : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x004 Size : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x008 Flags : 3<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x00c ConcurrentChannels : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x010 FirstRedirectionMessageNumber : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x014 LastRedirectionMessageNumber : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x018 DeviceNode : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x01c Reserved : 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> +0x020 MessageTargets : (null)<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>PERF_CONFIGURATION_DATA perfConfigData = {0};<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>//<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>// Query perf optimization information<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>//<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";background:yellow;mso-highlight:yellow'>perfConfigData.Version = STOR_PERF_VERSION;<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";background:yellow;mso-highlight:yellow'>perfConfigData.Size = sizeof(PERF_CONFIGURATION_DATA);</span><span style='font-family:"Courier New"'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>status = StorPortInitializePerfOpts(AdapterExtension, TRUE, &perfConfigData);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>//<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>// Turn on DPC Redirection if it's supported.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>//<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>if ((status == STOR_STATUS_SUCCESS) &&<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> ((perfConfigData.Flags & STOR_PERF_DPC_REDIRECTION) != 0)) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <span style='background:yellow;mso-highlight:yellow'>AhciZeroMemory((PCHAR)&perfConfigData, sizeof(PERF_CONFIGURATION_DATA));</span><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <span style='background:yellow;mso-highlight:yellow'>perfConfigData.Version = STOR_PERF_VERSION;</span><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> <span style='background:yellow;mso-highlight:yellow'>perfConfigData.Size = sizeof(PERF_CONFIGURATION_DATA);</span><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> perfConfigData.Flags = STOR_PERF_DPC_REDIRECTION;<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> status = StorPortInitializePerfOpts(AdapterExtension, FALSE, &perfConfigData);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> NT_ASSERT(status == STOR_STATUS_SUCCESS);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Mike Berhan<o:p></o:p></p><p class=MsoNormal>busTRACE Technologies<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>