<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/TR/REC-html40" 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19222">
<style>@font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@font-face {
font-family: Consolas;
}
@page WordSection1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
LI.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
DIV.MsoNormal {
MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.MsoPlainText {
MARGIN: 0in 0in 0pt; FONT-FAMILY: Consolas; FONT-SIZE: 10.5pt; mso-style-priority: 99; mso-style-link: "Plain Text Char"
}
LI.MsoPlainText {
MARGIN: 0in 0in 0pt; FONT-FAMILY: Consolas; FONT-SIZE: 10.5pt; mso-style-priority: 99; mso-style-link: "Plain Text Char"
}
DIV.MsoPlainText {
MARGIN: 0in 0in 0pt; FONT-FAMILY: Consolas; FONT-SIZE: 10.5pt; mso-style-priority: 99; mso-style-link: "Plain Text Char"
}
P.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-style-priority: 34
}
LI.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-style-priority: 34
}
DIV.MsoListParagraph {
MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt; mso-style-priority: 34
}
SPAN.EmailStyle18 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: windowtext; mso-style-type: personal-compose
}
SPAN.PlainTextChar {
FONT-FAMILY: Consolas; mso-style-priority: 99; mso-style-link: "Plain Text"; mso-style-name: "Plain Text Char"
}
.MsoChpDefault {
FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.WordSection1 {
page: WordSection1
}
OL {
MARGIN-BOTTOM: 0in
}
UL {
MARGIN-BOTTOM: 0in
}
</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="blue" vlink="purple">
<div dir="ltr" align="left"><span class="661230000-05062012"><font color="#0000ff" size="2" face="Arial">IDT is fine with the fix.</font></span></div>
<div dir="ltr" align="left"><span class="661230000-05062012"><font color="#0000ff" size="2" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="661230000-05062012"><font color="#0000ff" size="2" face="Arial">Thanks,<br>
Alex</font></span></div>
<br>
<div dir="ltr" lang="en-us" class="OutlookMessageHeader" align="left">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b> nvmewin-bounces@lists.openfabrics.org [mailto:nvmewin-bounces@lists.openfabrics.org]
<b>On Behalf Of </b>Murray, Kris R<br>
<b>Sent:</b> Monday, June 04, 2012 11:15 AM<br>
<b>To:</b> nvmewin@lists.openfabrics.org<br>
<b>Subject:</b> [nvmewin] ***UNCHECKED*** numberOfPrpEntries patch for review<br>
</font><br>
</div>
<div></div>
<div class="WordSection1">
<p class="MsoNormal">All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>Summary:<o:p></o:p></b></p>
<p class="MsoNormal">I found a bug in the ProcessIo step for copying the PRP list. From the SNTI code, the variable numberOfPrpEntries in the SRB Extension was built as the total number of PRPs for the NVMe command. However, the code to copy over the PRP list
uses this variable unaltered. This creates a bug where one too many PRP entries are copied. This bug hasn’t surfaced yet because creating an NVMe command with the maximum number of PRP entries in the list hasn’t been tested yet.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">See NVMe_PRP_fix.zip for source. Password: NVMe1234<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>Changes:<o:p></o:p></b></p>
<p class="MsoNormal">nvmeStd.h :<o:p></o:p></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>The numberofPrpEntries variable in the SRB Extension is updated with a comment that clarifies that it holds the total number of PRPs, not just the PRP entries in the list<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">nvmeIo.c:<o:p></o:p></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>Instead of checking for a valid entry 0 in the list, the number of entries is checked<o:p></o:p></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>The amount of memory to copy is decreased by the size of 1 entry to account for the PRP that is in PRP1 of the command.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>Code Sample:<o:p></o:p></b></p>
<p class="MsoNormal"><u><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">nvmeStd.h<o:p></o:p></span></u></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: green; FONT-SIZE: 9.5pt; mso-highlight: white">/* Temp PRP List */</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">UINT64 prpList[MAX_TX_SIZE / PAGE_SIZE];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: yellow; COLOR: green; FONT-SIZE: 9.5pt; mso-highlight: yellow">/* Keep track of the total number of PRPs */</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">UINT32 numberOfPrpEntries;</span><span style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 9.5pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 9.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 9.5pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><u><span style="COLOR: #1f497d">nvmeIo.c</span></u><u><span style="COLOR: #1f497d"><o:p></o:p></span></u></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: blue; FONT-SIZE: 9.5pt; mso-highlight: white">if</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"> (</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: gray; FONT-SIZE: 9.5pt; mso-highlight: white">pSrbExtension</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">-></span><span style="FONT-FAMILY: Consolas; BACKGROUND: yellow; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: yellow">numberOfPrpEntries
> 2</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"> pNvmeCmd->PRP2 = pCmdInfo->prpListPhyAddr.QuadPart;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="BACKGROUND: yellow; COLOR: #1f497d; FONT-SIZE: 9.5pt; mso-highlight: yellow"> /* Copy the PRP list pointed to by PRP2….
<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="BACKGROUND: yellow; COLOR: #1f497d; FONT-SIZE: 9.5pt; mso-highlight: yellow"> * Size of the copy is total num of PRPs -1 because
<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="BACKGROUND: yellow; COLOR: #1f497d; FONT-SIZE: 9.5pt; mso-highlight: yellow"> * PRP1 is not in the PRP list pointed to by PRP2<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="BACKGROUND: yellow; COLOR: #1f497d; FONT-SIZE: 9.5pt; mso-highlight: yellow"> */<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">
</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: #6f008a; FONT-SIZE: 9.5pt; mso-highlight: white">StorPortMoveMemory</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">((</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-highlight: white">PVOID</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">)pCmdInfo->pPRPList,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"> (</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-highlight: white">PVOID</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">)&</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: gray; FONT-SIZE: 9.5pt; mso-highlight: white">pSrbExtension</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">->prpList[0],<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white"> (</span><span style="FONT-FAMILY: Consolas; BACKGROUND: yellow; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: yellow">(</span><span style="FONT-FAMILY: Consolas; BACKGROUND: yellow; COLOR: gray; FONT-SIZE: 9.5pt; mso-highlight: yellow">pSrbExtension</span><span style="FONT-FAMILY: Consolas; BACKGROUND: yellow; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: yellow">->numberOfPrpEntries
- 1)</span><span style="FONT-FAMILY: Consolas; COLOR: black; FONT-SIZE: 9.5pt"> *
</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: blue; FONT-SIZE: 9.5pt; mso-highlight: white">sizeof</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">(</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-highlight: white">UINT64</span><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">)));<o:p></o:p></span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: Consolas; BACKGROUND: white; COLOR: black; FONT-SIZE: 9.5pt; mso-highlight: white">}</span><span style="COLOR: #1f497d"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>Testing (Logs attached):<o:p></o:p></b></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>IOMeter: PASS – See result.csv<o:p></o:p></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>PCMark7: PASS – See NVMe.pcmark-7-result<o:p></o:p></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>SCSI Compliance 2.0: 77 PASS, 36 WARN, 2 FAIL – See scsi_comp.txt<o:p></o:p></p>
<p style="TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class="MsoListParagraph">
<![if !supportLists]><span style="mso-list: Ignore">-<span style="FONT: 7pt 'Times New Roman'">
</span></span><![endif]>SD Stress: PASS – See SDSTRESS.LOG<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Kris Murray</span><span style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt"><o:p></o:p></span></p>
</div>
</body>
</html>