<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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"MS Shell Dlg";
        panose-1:2 11 6 4 2 2 2 2 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:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:2048023476;
        mso-list-type:hybrid;
        mso-list-template-ids:1074551486 102782794 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        color:#1F497D;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
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 class="WordSection1">
<p class="MsoPlainText"><span style="color:#1F497D">Hi Steve<o:p></o:p></span></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Per our analysis</span><span style="color:#1F497D">, MaxMpxCount is enforced on
</span><span style="color:#1F497D">all</span><span style="color:#1F497D"> the commands
</span><span style="color:#1F497D">including</span><span style="color:#1F497D"> Negotiate, Echo and SMBOplockBreak.
</span><span style="color:#1F497D">Please find </span><span style="color:#1F497D">the
</span><span style="color:#1F497D">answers </span><span style="color:#1F497D">as follows :
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1;text-autospace:none">
<![if !supportLists]><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">    
</span></span></span><![endif]><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">I would like clarification on the how the maximum number of cifs  simultaneous requests are enforced, and for which cifs operations  they apply to.  In part
 this is to avoid triggering a serious problem  in Windows 7 and Windows Vista (when they are run as a server) when  exceeding this limit on simultaneous requests.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">               
</span><span style="color:#1F497D">On both the client and the server, MaxMpxCount is used to limit the number of outstanding commands Per SMB Connection.<b>
</b> This behavior applies to ALL commands.</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:24.75pt;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">2.   
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">What I have observed in my testing:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">       
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">- Although Windows 7 and Vista allows more than 10 simultaneous SMB  write requests (and Windows 2008 allows more than 50 simultaneous  write requests), Windows 7 and Windows Vista
 appear to have problems  when 20 or 30 are in flight at one time.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-indent:.25in;text-autospace:none">
<span style="color:#1F497D">We would be requiring capture for this scenario for further analysis.
</span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">3.
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> Windows does not enforce a limit on SMB Negotiate Protocol<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">     
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">Windows seems to ignore checks on maximum simultaneous requests on  certain handle based operations (SMB writeX in particular) until  after the file is closed (the writes don't get
 an error, but the next  QueryPathInfo after the file is closed gets an error).<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">             
</span><span style="color:#1F497D">Windows in fact sends STATUS_DATA_NOT_ACCEPTED. Please let us know if you are not getting this error.
</span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">4.
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">I need to understand on which requests (besides SMB Negotiate) I  should ignore MaxMpxCount.  In particular, SMB Echo, seems like an  obvious choice to ALWAYS allow to be sent by
 the client, since SMB <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <span style="color:#1F497D">  
</span>Echo is sent to make sure the server is alive (when for example the  limit on simultaneous requests has been reached due to slow opens, or writes past end of file) and to prevent timeout.   If a client is restricted from sending SMB Echo then there is
 no reasonably reliable  mechanism available to determine whether the server <span style="color:#1F497D">
    <o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">    </span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">is dead or just  hung temporarily
 processing slow requests.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">           
</span><span style="color:#1F497D">To really have a problem with SMB Echo or any other commands, total pending requests(<b>including SMB Echo</b>) should be greater than what server could really handle, which might be possible only when server is really busy.
 The above mentioned scenario would not arise unless server is busy. </span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="color:#1F497D">    In this scenario, SMB should fail Echo if it cannot process more requests. Client can keep retrying to check if server is available.  <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">5.
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">MS-CIFS is not clear on which commands MaxMpxCount is enforced.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">            
</span><span style="color:#1F497D">MaxMpxCount will be enforced for <b>all</b> the commands in a particular
<b>Connection</b>.</span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">6.
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">I would like to ignore MaxMpxCount on (sending one of) SMBEcho (where  you could cause data integrity issues if you limited the ability to check server state up/down) and SMBNegotiate
 (where it is obviously <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <span style="color:#1F497D">  
</span>not set yet) and SMBOplockBreak responses (since you can't guarantee  the order that these are received/sent from the server relative to  other frames which are being processed, and can cause the server
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">   </span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> session to drop if you
 don't allow the client to send these) to the  server since there is no reasonable mechanism to limit these without  risking problems with prematurely taking down a slow session (perhaps
<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <span style="color:#1F497D">   </span>opens of offline files for example).<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">           
</span><span style="color:#1F497D">SMBEcho, SMB Negotiate & SMB Oplock response are NOT excluded from MaxMpxCount limit. However the server does not enable Oplocks if MaxMpxCount = 1, as Oplock break notification/ack need an extra work item when current create/lock/write
 request is pending on oplock break. </span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">7.
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">It looks like the safest way to handle this is for the client to  limit pending requests to the MaxMpxCount, with the exception of the  three SMB types listed above.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">           
</span><span style="color:#1F497D">Client would always limit the pending requests to MaxMpxCount, without the exception of any commands.</span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">8.
</span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">In previous versions of MS-CIFS there were mentions of different  processes, and uids on the negotiated tcp session and their relation  to the MaxMpxCount - and I would also like
 to verify whether the  limits are considered relative to some combination of the negotiated  tcp session and uid and/or pid as earlier discussions
<span style="color:#1F497D">  <o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif";color:#1F497D">    </span><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif"">implied (or  file handle,
 as our testing hinted at).<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-autospace:none"><span style="font-size:10.0pt;font-family:"MS Shell Dlg","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">           
</span><span style="color:#1F497D">MaxMpxCount on the client is based on the outstanding PID/MID pairs in the
<b>Client.Connection.PIDMIDList</b> per <b>SMB Connection</b>.</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:#1F497D">Please let us know if any further clarification is required.<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="color:#1F497D">Tarun Chopra.<o:p></o:p></span></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: Bryan Burgin <br>
Sent: Friday, October 14, 2011 1:20 PM<br>
To: 'Steve French'; Tarun Chopra<br>
Cc: MSSolve Case Email; 'pfif@tridgell.net'; 'cifs-protocol@samba.org'<br>
Subject: RE: [REG:111092973873305] [cifs-protocol] [Pfif] Maximum Simultaneous Request for CIFS behavior clarification</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">[Adding Tarun]<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Steve,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I am working with Windows Sustained Engineering on the Windows Vista and Windows 7 issue you reported.  It is not directly related to MaxMpx, which is the topic of this thread.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Tarun is researching your questions re "I need to understand on which requests (besides SMB Negotiate) I should ignore MaxMpxCount", "MS-CIFS is not clear on which commands MaxMpxCount is enforced" and other protocol-related MaxMpx questions.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Bryan<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<o:p></o:p></p>
<p class="MsoPlainText">From: Bryan Burgin<o:p></o:p></p>
<p class="MsoPlainText">Sent: Thursday, September 29, 2011 2:19 PM<o:p></o:p></p>
<p class="MsoPlainText">To: Steve French<o:p></o:p></p>
<p class="MsoPlainText">Cc: MSSolve Case Email; <a href="mailto:pfif@tridgell.net">
<span style="color:windowtext;text-decoration:none">pfif@tridgell.net</span></a>;
<a href="mailto:cifs-protocol@samba.org"><span style="color:windowtext;text-decoration:none">cifs-protocol@samba.org</span></a><o:p></o:p></p>
<p class="MsoPlainText">Subject: [REG:111092973873305] [cifs-protocol] [Pfif] Maximum Simultaneous Request for CIFS behavior clarification<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Hi, Steve,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I'll look into this for you in the process of working the issue that is driving this inquiry: the large file copy to Vista or Windows 7 clients resulting in the DOS NOT_ENOUGH_MEMORY  error on subsequent SMB session setups (among other
 commands, like Queries, which return STATUS_INSUFF_SERVER_RESOURCES).<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I have the repro of that issue and I'm presently debugging it.  I will note that on my Windows 7 system (acting as the server in this transaction), it replies with a negotiation specifying 50 (0x32) for MaxMpxCount.  Furthermore, the
 "Client05" system we were using, also Windows 7,  was forced to use 50 by setting Services\LanmanSERVER\Parameters\MaxMpxCt = (DWORD) 50 (previously, it returned 10 for MaxMpxCount).  It continued to fail.  (I also experimented with Services\LanmanWORKSTATION\Parameters\MaxCmds
 = (DWORD) 50).  Thus, the value returned by the server side via Negotiate MaxMpxCount does not seem to be linked to your initial issue.  Setting \LanmanSERVER\Parameters\MaxWorkItems, however, does seem to have a positive effect on your original issue.  And,
 I was able to find code that used MaxWorkItems in calculating if there was sufficient buffers for an operation.  So, there may be a direct collation yet to be verified.
<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I am also aware that the failing scenario seems to be triggered by having a lot of Writes-in-flight.  In our testing together, we were seeing 15 to 20 to more Writes-in-flight, which exceeded MaxMpxCount (then 10) by quite a bit.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I'm debugging the cause of your initial issue and in the process I'll research your questions re MaxMpxCount.  Once root cause is determined, we'll know more if there was a connection between the Out-of-Memory errors and MaxMpxCount. 
 In the process of that work, I'll research the issues you listed below.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Bryan<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<o:p></o:p></p>
<p class="MsoPlainText">From: Christopher R. Hertel <a href="mailto:[mailto:crh@samba.org]">
<span style="color:windowtext;text-decoration:none">[mailto:crh@samba.org]</span></a><o:p></o:p></p>
<p class="MsoPlainText">Sent: Thursday, September 29, 2011 12:16 PM<o:p></o:p></p>
<p class="MsoPlainText">To: Steve French<o:p></o:p></p>
<p class="MsoPlainText">Cc: Interoperability Documentation Help; <a href="mailto:pfif@tridgell.net">
<span style="color:windowtext;text-decoration:none">pfif@tridgell.net</span></a>;
<a href="mailto:cifs-protocol@samba.org"><span style="color:windowtext;text-decoration:none">cifs-protocol@samba.org</span></a><o:p></o:p></p>
<p class="MsoPlainText">Subject: Re: [cifs-protocol] [Pfif] Maximum Simultaneous Request for CIFS behavior clarification<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Steve,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Only Microsoft can correctly answer these questions, at this point, but I am adding my comments here to encourage them to spend a good deal of time studying both the client and server code.  The behavior of the MaxMpxCount value, in
 particular, is buried in the source.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">My team and I spent a great deal of time digging into this particular question when writing the documentation.  We did try to make things as clear as we could.  There is an internal table, as described in [MS-CIFS], that is keyed on
 both PID and MID (not just MID).  This table keeps track of outstanding requests from the client.  Note that an open OpLock is an out standing request, as is a ChangeNotify.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">What is difficult to determine when studying the code is how this internal table actually performs under load.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Another thing to consider is how the Windows clients handle the MaxMpxCount value.  I do not believe that they put much stress on the server, in general.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Chris -)-----<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Steve French wrote:<o:p></o:p></p>
<p class="MsoPlainText">> Resending with correct title.<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> On Thu, Sep 29, 2011 at 1:09 PM, Steve French <<a href="mailto:smfrench@gmail.com"><span style="color:windowtext;text-decoration:none">smfrench@gmail.com</span></a>> wrote:<o:p></o:p></p>
<p class="MsoPlainText">>> I would like clarification on the how the maximum number of cifs
<o:p></o:p></p>
<p class="MsoPlainText">>> simultaneous requests are enforced, and for which cifs operations
<o:p></o:p></p>
<p class="MsoPlainText">>> they apply to.  In part this is to avoid triggering a serious problem
<o:p></o:p></p>
<p class="MsoPlainText">>> in Windows 7 and Windows Vista (when they are run as a server) when
<o:p></o:p></p>
<p class="MsoPlainText">>> exceeding this limit on simultaneous requests.<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> What I have observed in my testing:<o:p></o:p></p>
<p class="MsoPlainText">>> - Although Windows 7 and Vista allows more than 10 simultaneous SMB
<o:p></o:p></p>
<p class="MsoPlainText">>> write requests (and Windows 2008 allows more than 50 simultaneous
<o:p></o:p></p>
<p class="MsoPlainText">>> write requests), Windows 7 and Windows Vista appear to have problems
<o:p></o:p></p>
<p class="MsoPlainText">>> when 20 or 30 are in flight at one time.<o:p></o:p></p>
<p class="MsoPlainText">>> - Windows does not enforce a limit on SMB Negotiate Protocol<o:p></o:p></p>
<p class="MsoPlainText">>> - Windows seems to ignore checks on maximum simultaneous requests on
<o:p></o:p></p>
<p class="MsoPlainText">>> certain handle based operations (SMB writeX in particular) until
<o:p></o:p></p>
<p class="MsoPlainText">>> after the file is closed (the writes don't get an error, but the next
<o:p></o:p></p>
<p class="MsoPlainText">>> QueryPathInfo after the file is closed gets an error).<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> I need to understand on which requests (besides SMB Negotiate) I
<o:p></o:p></p>
<p class="MsoPlainText">>> should ignore MaxMpxCount.  In particular, SMB Echo, seems like an
<o:p></o:p></p>
<p class="MsoPlainText">>> obvious choice to ALWAYS allow to be sent by the client, since SMB
<o:p></o:p></p>
<p class="MsoPlainText">>> Echo is sent to make sure the server is alive (when for example the
<o:p></o:p></p>
<p class="MsoPlainText">>> limit on simultaneous requests has been reached due to slow opens, or<o:p></o:p></p>
<p class="MsoPlainText">>> writes past end of file) and to prevent timeout.   If a client is<o:p></o:p></p>
<p class="MsoPlainText">>> restricted from sending SMB Echo then there is no reasonably reliable
<o:p></o:p></p>
<p class="MsoPlainText">>> mechanism available to determine whether the server is dead or just
<o:p></o:p></p>
<p class="MsoPlainText">>> hung temporarily processing slow requests.<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> MS-CIFS is not clear on which commands MaxMpxCount is enforced.<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> I would like to ignore MaxMpxCount on (sending one of) SMBEcho (where
<o:p></o:p></p>
<p class="MsoPlainText">>> you could cause data integrity issues if you limited the ability to
<o:p></o:p></p>
<p class="MsoPlainText">>> check server state up/down) and SMBNegotiate (where it is obviously
<o:p></o:p></p>
<p class="MsoPlainText">>> not set yet) and SMBOplockBreak responses (since you can't guarantee
<o:p></o:p></p>
<p class="MsoPlainText">>> the order that these are received/sent from the server relative to
<o:p></o:p></p>
<p class="MsoPlainText">>> other frames which are being processed, and can cause the server
<o:p></o:p></p>
<p class="MsoPlainText">>> session to drop if you don't allow the client to send these) to the
<o:p></o:p></p>
<p class="MsoPlainText">>> server since there is no reasonable mechanism to limit these without
<o:p></o:p></p>
<p class="MsoPlainText">>> risking problems with prematurely taking down a slow session (perhaps
<o:p></o:p></p>
<p class="MsoPlainText">>> opens of offline files for example).<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> It looks like the safest way to handle this is for the client to
<o:p></o:p></p>
<p class="MsoPlainText">>> limit pending requests to the MaxMpxCount, with the exception of the
<o:p></o:p></p>
<p class="MsoPlainText">>> three SMB types listed above.<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> In previous versions of MS-CIFS there were mentions of different
<o:p></o:p></p>
<p class="MsoPlainText">>> processes, and uids on the negotiated tcp session and their relation
<o:p></o:p></p>
<p class="MsoPlainText">>> to the MaxMpxCount - and I would also like to verify whether the
<o:p></o:p></p>
<p class="MsoPlainText">>> limits are considered relative to some combination of the negotiated
<o:p></o:p></p>
<p class="MsoPlainText">>> tcp session and uid and/or pid as earlier discussions implied (or
<o:p></o:p></p>
<p class="MsoPlainText">>> file handle, as our testing hinted at).<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> --<o:p></o:p></p>
<p class="MsoPlainText">>> Thanks,<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">>> Steve<o:p></o:p></p>
<p class="MsoPlainText">>><o:p> </o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">--<o:p></o:p></p>
<p class="MsoPlainText">"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X<o:p></o:p></p>
<p class="MsoPlainText">Samba Team -- <a href="http://www.samba.org/"><span style="color:windowtext;text-decoration:none">http://www.samba.org/</span></a>     -)-----   Christopher R. Hertel<o:p></o:p></p>
<p class="MsoPlainText">jCIFS Team -- <a href="http://jcifs.samba.org/"><span style="color:windowtext;text-decoration:none">http://jcifs.samba.org/</span></a>   -)-----   ubiqx development, uninq.<o:p></o:p></p>
<p class="MsoPlainText">ubiqx Team -- <a href="http://www.ubiqx.org/"><span style="color:windowtext;text-decoration:none">http://www.ubiqx.org/</span></a>     -)-----  
<a href="mailto:crh@ubiqx.mn.org"><span style="color:windowtext;text-decoration:none">crh@ubiqx.mn.org</span></a><o:p></o:p></p>
<p class="MsoPlainText">OnLineBook -- <a href="http://ubiqx.org/cifs/"><span style="color:windowtext;text-decoration:none">http://ubiqx.org/cifs/</span></a>    -)-----  
<a href="mailto:crh@ubiqx.org"><span style="color:windowtext;text-decoration:none">crh@ubiqx.org</span></a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
</body>
</html>