<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" 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 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<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;}
/* 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.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.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:2079395651;
mso-list-type:hybrid;
mso-list-template-ids:1542346044 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
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=Section1>
<p class=MsoNormal><span style='color:#1F497D'>Please, see the revisited
version of the patch, which includes:<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='color:#1F497D'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span dir=LTR></span><span style='color:#1F497D'>Main
fix: handling a situation when NDIS sends ‘pause’ command before
the ‘reset’ command was completed<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='color:#1F497D'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span dir=LTR></span><span style='color:#1F497D'>Debug
prints improvements<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='color:#1F497D'><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span dir=LTR></span><span style='color:#1F497D'>Time
notification was added to IPOIB_DBG_SHUTTER printouts, because of timestamp
importance in this case. These debug prints are not in data path, so it’s
safe to use them here.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Index:
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>===================================================================<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp (revision
2975)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp (working
copy)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -111,6 +111,40 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> OUT UINT *p_len);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+static void<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ __ipoib_complete_reset(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IN ipoib_adapter_t*
const p_adapter,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IN NDIS_STATUS Status
) <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KLOCK_QUEUE_HANDLE hdl;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Check if Reset flag is set or if adapter is in Paused state<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->ipoib_state
= p_adapter->ipoib_state & ~IPOIB_RESET_OR_DOWN; <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( p_adapter->ipoib_state == IPOIB_RUNNING )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ shutter_alive(
&p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("ipoib_state
changed to IPOIB_RUNNING after the IPOIB_RESET_OR_DOWN flag was
cleared\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ else
<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
This sittuation happened in real life: <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
NDIS called to reset and right after to pause, before the reset was completed<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Thus, when ipoib will try to complete reset, state may be already changed to
IPOIB_PAUSE<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ASSERT(
p_adapter->ipoib_state == IPOIB_PAUSED );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("ipoib_state
remained IPOIB_PAUSED and will be changed at ipoib_restart()\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ NdisMResetComplete(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->h_adapter,
Status, TRUE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+}<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> /* Implementation */<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ib_api_status_t<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ipoib_create_adapter(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -800,9 +834,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> if(
p_adapter->reset && p_adapter->state != IB_PNP_PORT_INIT )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- NdisMResetComplete(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->h_adapter,
NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ __ipoib_complete_reset(
p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status
= IB_SUCCESS;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> break;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -978,6 +1010,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ib_api_status_t status;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ib_pnp_handle_t h_pnp;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KLOCK_QUEUE_HANDLE hdl;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_ENTER(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -992,8 +1025,19 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> h_pnp
= p_adapter->h_pnp;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->h_pnp
= NULL;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status
= p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> //
Wait until NDIS will return all indicated NBLs that were received<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- shutter_shut(
&p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Avoid shutting the shutter twice<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( p_adapter->ipoib_state == IPOIB_RUNNING ) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ shutter_shut(
&p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Notify that reset started and disable other shutter_shut<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->ipoib_state
|= IPOIB_RESET_OR_DOWN; <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]
ipoib_state was IPOIB_RUNNING and IPOIB_RESET_OR_DOWN flag was set \n",
cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> if(
status == IB_SUCCESS )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status
= IB_NOT_DONE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -1007,7 +1051,31 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->reset
= TRUE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> else
{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //do
not call to __ipoib_complete_reset, because we return completion status
directly from here<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->reset
= FALSE; <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Check if Reset flag is set or if adapter is in Paused state<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->ipoib_state
= p_adapter->ipoib_state & ~IPOIB_RESET_OR_DOWN; <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( p_adapter->ipoib_state == IPOIB_RUNNING )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ shutter_alive(
&p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("ipoib_state
changed to IPOIB_RUNNING after the IPOIB_RESET_OR_DOWN flag was
cleared\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ else
<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
This sittuation happened in real life: <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
NDIS called to reset and right after to pause, before the reset was completed<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Thus, when ipoib will try to complete reset, state may be already changed to
IPOIB_PAUSE<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ASSERT(
p_adapter->ipoib_state == IPOIB_PAUSED );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("ipoib_state
remained IPOIB_PAUSED and will be changed at ipoib_restart()\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_EXIT(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> return
status;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -1042,7 +1110,9 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_ENTER(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_PRINT(
TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- ("Got
RESET\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]
Got RESET\n", cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]
Got RESET\n", cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter
= (ipoib_adapter_t*)context;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -1074,19 +1144,15 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status
= __ipoib_pnp_reg( p_adapter, IB_PNP_FLAG_REG_COMPLETE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> if(
status != IB_SUCCESS )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_PRINT(
TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ("__ipoib_pnp_reg
returned %s\n",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->p_ifc->get_err_str(
status )) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- NdisMResetComplete(
<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->h_adapter,
NDIS_STATUS_HARD_ERRORS, TRUE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ __ipoib_complete_reset(
p_adapter, NDIS_STATUS_HARD_ERRORS );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> else<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- NdisMResetComplete(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->h_adapter,
NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ __ipoib_complete_reset(
p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status
= IB_SUCCESS;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -1261,10 +1327,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> if(
p_adapter->reset )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- //ASSERT(FALSE);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- NdisMResetComplete(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->h_adapter,
NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ __ipoib_complete_reset(
p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_EXIT(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -1323,9 +1386,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> if(
p_adapter->reset )<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->reset
= FALSE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- NdisMResetComplete(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->h_adapter,
NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ __ipoib_complete_reset(
p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_EXIT(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Index:
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>===================================================================<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h (revision
2975)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h (working
copy)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -70,14 +70,14 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> CSUM_BYPASS<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> } csum_flag_t;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-typedef enum _ipoib_state<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- IPOIB_INIT
= -1,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-
IPOIB_PAUSED,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-
IPOIB_PAUSING,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-
IPOIB_RUNNING<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-} ipoib_state_t;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+typedef uint32_t
ipoib_state_t;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_INIT 1<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_PAUSED
2<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_PAUSING 4<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define
IPOIB_RUNNING 8<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define
IPOIB_RESET_OR_DOWN 16<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> typedef struct
_ipoib_offloads_cap_ {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> boolean_t lso;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> boolean_t send_chksum_offload;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Index:
ulp/ipoib_NDIS6_CM/kernel/ipoib_debug.h<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>===================================================================<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_debug.h (revision
2975)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_debug.h (working
copy)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -73,7 +73,8 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> WPP_DEFINE_BIT(IPOIB_DBG_OID)
\<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> WPP_DEFINE_BIT(IPOIB_DBG_IOCTL)
\<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> WPP_DEFINE_BIT(IPOIB_DBG_STAT)
\<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- WPP_DEFINE_BIT(IPOIB_DBG_OBJ))<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ WPP_DEFINE_BIT(IPOIB_DBG_OBJ)
\<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ WPP_DEFINE_BIT(IPOIB_DBG_SHUTTER))<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -103,20 +104,21 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> /*<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> * Debug macros<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> */<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_ERR (1
<< 0)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_INIT (1
<< 1)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_PNP (1
<< 2)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_SEND (1
<< 3)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_RECV (1
<< 4)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_ENDPT (1
<< 5)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_IB (1
<< 6)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_BUF (1
<< 7)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_MCAST (1
<< 8)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_ALLOC (1
<< 9)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_OID (1
<< 10)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_IOCTL (1
<< 11)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_STAT (1
<< 12)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-#define IPOIB_DBG_OBJ (1
<< 13)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_ERR (1
<< 0)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_INIT (1
<< 1)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_PNP (1
<< 2)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_SEND (1
<< 3)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_RECV (1
<< 4)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_ENDPT (1
<< 5)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_IB (1
<< 6)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_BUF (1
<< 7)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_MCAST (1
<< 8)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_ALLOC (1
<< 9)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_OID (1
<< 10)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_IOCTL (1
<< 11)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_STAT (1
<< 12)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_OBJ (1
<< 13)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+#define IPOIB_DBG_SHUTTER (1
<< 14)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> #define IPOIB_DBG_ERROR (CL_DBG_ERROR
| IPOIB_DBG_ERR)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> #define IPOIB_DBG_ALL CL_DBG_ALL<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Index:
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>===================================================================<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp (revision
2975)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp (working
copy)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -1877,6 +1877,8 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> return
NDIS_STATUS_FAILURE;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->ipoib_state
= IPOIB_INIT;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("ipoib_state
changed to IPOIB_INIT\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status =
SetAttributes(p_adapter, h_adapter);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> if
(status != NDIS_STATUS_SUCCESS) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -3155,8 +3157,8 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter
= (ipoib_adapter_t*)adapter_context;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> cl_obj_lock(
&p_adapter->obj );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- if(
p_adapter->ipoib_state == IPOIB_PAUSING ||<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- p_adapter->ipoib_state
== IPOIB_PAUSED)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if(
p_adapter->ipoib_state & IPOIB_PAUSING ||<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->ipoib_state
& IPOIB_PAUSED)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> status
= NDIS_STATUS_PAUSED; <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_PRINT(
TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -3275,6 +3277,8 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IN
NDIS_HANDLE adapter_context,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IN
NDIS_SHUTDOWN_ACTION shutdown_action)<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KLOCK_QUEUE_HANDLE hdl;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_ENTER(
IPOIB_DBG_INIT ) ;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> UNUSED_PARAM(
shutdown_action );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -3287,7 +3291,19 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ("Shutter
shut, state = %d\n", p_adapter->ipoib_state));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ("Shutter
shut, state = %d\n", p_adapter->ipoib_state));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- shutter_shut
( &p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Wait until NDIS will return all indicated NBLs that were received<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Avoid shutting the shutter twice<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ASSERT
( !(p_adapter->ipoib_state & IPOIB_RESET_OR_DOWN) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( p_adapter->ipoib_state == IPOIB_RUNNING ) { //ensure that there was no
active reset<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ shutter_shut(
&p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ //
Notify that shutter was already shut<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ p_adapter->ipoib_state
|= IPOIB_RESET_OR_DOWN;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ASSERT(
p_adapter->ipoib_state == IPOIB_RUNNING ); <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("ipoib_state
was IPOIB_RUNNING and IPOIB_RESET_OR_DOWN flag was set\n") );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_EXIT(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -3965,6 +3981,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> cl_free(
context );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> static NDIS_STATUS <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ipoib_pause(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IN NDIS_HANDLE
adapter_context, <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -3972,30 +3989,42 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ipoib_adapter_t *p_adapter;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KLOCK_QUEUE_HANDLE hdl;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ipoib_state_t
prev_state;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- UNREFERENCED_PARAMETER(pause_parameters);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ UNREFERENCED_PARAMETER(
pause_parameters );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_ENTER(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- CL_ASSERT(adapter_context);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ CL_ASSERT(
adapter_context );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter
= (ipoib_adapter_t*)adapter_context;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- CL_ASSERT(p_adapter->ipoib_state
== IPOIB_RUNNING);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ prev_state
= p_adapter->ipoib_state;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ CL_ASSERT
( prev_state & IPOIB_RUNNING );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->ipoib_state
= IPOIB_PAUSING;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]ipoib_state
changed to IPOIB_PAUSING\n", cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- if
(p_adapter->p_port) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( p_adapter->p_port ) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> cl_spinlock_acquire(
&p_adapter->p_port->send_lock );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- ipoib_port_resume(p_adapter->p_port,FALSE);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ipoib_port_resume(
p_adapter->p_port,FALSE );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> cl_spinlock_release(
&p_adapter->p_port->send_lock );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( prev_state == IPOIB_RUNNING ) { //i.e there was no active reset<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("Shutter
shut, state = %d\n", p_adapter->ipoib_state) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ shutter_shut
( &p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ else
{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ASSERT
( prev_state & IPOIB_RESET_OR_DOWN);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT_EXIT(
TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]Got
pause during reset or got reset when IPoIB port wasn't active\n",
cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- ("Shutter
shut, state = %d\n", p_adapter->ipoib_state));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- shutter_shut
( &p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->ipoib_state
= IPOIB_PAUSED;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]ipoib_state
changed to IPOIB_PAUSED\n", cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_EXIT(
IPOIB_DBG_INIT );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>@@ -4025,18 +4054,20 @@<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> //
Check to see if we need to change any attributes<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- if
( (p_adapter->ipoib_state == IPOIB_PAUSED) || (p_adapter->ipoib_state ==
IPOIB_INIT) ) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ if
( p_adapter->ipoib_state & (IPOIB_PAUSED | IPOIB_INIT) ) {<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- ("Shutter
Alive, ipoib_state = %d\n", p_adapter->ipoib_state));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]Shutter
Alive, ipoib_state = %d\n", cl_get_time_stamp(),
p_adapter->ipoib_state));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> shutter_alive(
&p_adapter->recv_shutter );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> else
{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>- IPOIB_PRINT(
TRACE_LEVEL_WARNING, IPOIB_DBG_RECV,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_WARNING, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> ("*****Shutter
Was not \"Alived\", state = %d*****\n",
p_adapter->ipoib_state));<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KeAcquireInStackQueuedSpinLock(
&g_ipoib.lock, &hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> p_adapter->ipoib_state
= IPOIB_RUNNING;<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ IPOIB_PRINT(
TRACE_LEVEL_INFORMATION, IPOIB_DBG_SHUTTER,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>+ ("[%I64u]ipoib_state
changed to IPOIB_RUNNING\n",cl_get_time_stamp()) );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> KeReleaseInStackQueuedSpinLock(
&hdl );<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Smith, Stan
[mailto:stan.smith@intel.com] <br>
<b>Sent:</b> Wednesday, October 27, 2010 5:26 PM<br>
<b>To:</b> Alex Naslednikov; ofw@lists.openfabrics.org<br>
<b>Subject:</b> RE: [ofw] [IPoIB_NDIS6_CM][Patch] Improving shutter mechanism
for recv flow<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Hello,</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'> Patch tests out with no problems - expected behavior.</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Would you like for me to svn commit to trunk and WOF2-3 branch?</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>stan.</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p>
<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>
<hr size=2 width="100%" align=center>
</span></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <b>On Behalf Of </b>Alex Naslednikov<br>
<b>Sent:</b> Tuesday, October 26, 2010 2:59 AM<br>
<b>To:</b> Alex Naslednikov; ofw@lists.openfabrics.org<br>
<b>Subject:</b> Re: [ofw] [IPoIB_NDIS6_CM][Patch] Improving shutter mechanism
for recv flow</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Now with the patch attached by
file<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
ofw-bounces@lists.openfabrics.org [mailto:ofw-bounces@lists.openfabrics.org] <b>On
Behalf Of </b>Alex Naslednikov<br>
<b>Sent:</b> Tuesday, October 26, 2010 11:57 AM<br>
<b>To:</b> ofw@lists.openfabrics.org<br>
<b>Subject:</b> [ofw] [IPoIB_NDIS6_CM][Patch] Improving shutter mechanism for
recv flow<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>This patch avoids the situation when the recv shutter can be
shut twice.<o:p></o:p></p>
<p class=MsoNormal>It was tested with regression run that failed beforehand
along with manual debug <o:p></o:p></p>
<p class=MsoNormal>(forcing NDIS to call to ipoib_reset() )<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Signed-off by: Alexander Naslednikov (xalex at
mellanox.co.il)<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp<o:p></o:p></p>
<p class=MsoNormal>===================================================================<o:p></o:p></p>
<p class=MsoNormal>--- ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
(revision 2975)<o:p></o:p></p>
<p class=MsoNormal>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
(working copy)<o:p></o:p></p>
<p class=MsoNormal>@@ -111,6 +111,28 @@<o:p></o:p></p>
<p class=MsoNormal>
OUT
UINT
*p_len);<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>+static inline void<o:p></o:p></p>
<p class=MsoNormal>+
__ipoib_complete_reset(<o:p></o:p></p>
<p class=MsoNormal>+
IN
ipoib_adapter_t* const
p_adapter,<o:p></o:p></p>
<p class=MsoNormal>+
IN
NDIS_STATUS
Status ) <o:p></o:p></p>
<p class=MsoNormal>+{<o:p></o:p></p>
<p class=MsoNormal>+
KLOCK_QUEUE_HANDLE
hdl;<o:p></o:p></p>
<p class=MsoNormal>+
<o:p></o:p></p>
<p class=MsoNormal>+
KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
if ( p_adapter->ipoib_state & ~IPOIB_RESET_OR_DOWN ) <o:p></o:p></p>
<p class=MsoNormal>+
{<o:p></o:p></p>
<p class=MsoNormal>+
//Alive the shutter even if the status was not NDIS_STATUS_SUCCESS<o:p></o:p></p>
<p class=MsoNormal>+
shutter_alive( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->ipoib_state = p_adapter->ipoib_state &
~IPOIB_RESET_OR_DOWN;<o:p></o:p></p>
<p class=MsoNormal>+
ASSERT( p_adapter->ipoib_state == IPOIB_RUNNING
);
<o:p></o:p></p>
<p class=MsoNormal>+
}<o:p></o:p></p>
<p class=MsoNormal>+
KeReleaseInStackQueuedSpinLock( &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>+
NdisMResetComplete(<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->h_adapter, Status, TRUE );<o:p></o:p></p>
<p class=MsoNormal>+}<o:p></o:p></p>
<p class=MsoNormal>+<o:p></o:p></p>
<p class=MsoNormal> /* Implementation */<o:p></o:p></p>
<p class=MsoNormal> ib_api_status_t<o:p></o:p></p>
<p class=MsoNormal> ipoib_create_adapter(<o:p></o:p></p>
<p class=MsoNormal>@@ -800,9 +822,7 @@<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
if( p_adapter->reset && p_adapter->state != IB_PNP_PORT_INIT )<o:p></o:p></p>
<p class=MsoNormal>
{<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>-
NdisMResetComplete(<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->h_adapter, NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></p>
<p class=MsoNormal>+
__ipoib_complete_reset( p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>
status = IB_SUCCESS;<o:p></o:p></p>
<p class=MsoNormal>
break;<o:p></o:p></p>
<p class=MsoNormal>@@ -978,6 +998,7 @@<o:p></o:p></p>
<p class=MsoNormal> {<o:p></o:p></p>
<p class=MsoNormal>
ib_api_status_t
status;<o:p></o:p></p>
<p class=MsoNormal>
ib_pnp_handle_t
h_pnp;<o:p></o:p></p>
<p class=MsoNormal>+
KLOCK_QUEUE_HANDLE
hdl;<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
IPOIB_ENTER( IPOIB_DBG_INIT );<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>@@ -992,8 +1013,17 @@<o:p></o:p></p>
<p class=MsoNormal>
h_pnp = p_adapter->h_pnp;<o:p></o:p></p>
<p class=MsoNormal>
p_adapter->h_pnp = NULL;<o:p></o:p></p>
<p class=MsoNormal>
status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg );<o:p></o:p></p>
<p class=MsoNormal>+
<o:p></o:p></p>
<p class=MsoNormal>
// Wait until NDIS will return all indicated NBLs that were received<o:p></o:p></p>
<p class=MsoNormal>-
shutter_shut( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
// Avoid shutting the shutter twice<o:p></o:p></p>
<p class=MsoNormal>+
KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
if ( p_adapter->ipoib_state == IPOIB_RUNNING ) {<o:p></o:p></p>
<p class=MsoNormal>+
shutter_shut( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
// Notify that reset started and disable other shutter_shut<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->ipoib_state |= IPOIB_RESET_OR_DOWN;<o:p></o:p></p>
<p class=MsoNormal>+
}<o:p></o:p></p>
<p class=MsoNormal>+
KeReleaseInStackQueuedSpinLock( &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
<o:p></o:p></p>
<p class=MsoNormal>
if( status == IB_SUCCESS )<o:p></o:p></p>
<p class=MsoNormal>
status = IB_NOT_DONE;<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>@@ -1007,7 +1037,12 @@<o:p></o:p></p>
<p class=MsoNormal>
p_adapter->reset = TRUE;<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>
else {<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>+
//do not call to __ipoib_complete_reset, because we return completion
status directly from here<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->reset = FALSE; <o:p></o:p></p>
<p class=MsoNormal>+
KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->ipoib_state = p_adapter->ipoib_state &
~IPOIB_RESET_OR_DOWN;<o:p></o:p></p>
<p class=MsoNormal>+
shutter_alive( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
KeReleaseInStackQueuedSpinLock( &hdl );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>
IPOIB_EXIT( IPOIB_DBG_INIT );<o:p></o:p></p>
<p class=MsoNormal>
return status;<o:p></o:p></p>
<p class=MsoNormal>@@ -1074,19 +1109,15 @@<o:p></o:p></p>
<p class=MsoNormal>
status = __ipoib_pnp_reg( p_adapter, IB_PNP_FLAG_REG_COMPLETE );<o:p></o:p></p>
<p class=MsoNormal>
if( status != IB_SUCCESS )<o:p></o:p></p>
<p class=MsoNormal>
{<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></p>
<p class=MsoNormal>
("__ipoib_pnp_reg returned %s\n",<o:p></o:p></p>
<p class=MsoNormal>
p_adapter->p_ifc->get_err_str( status )) );<o:p></o:p></p>
<p class=MsoNormal>-
NdisMResetComplete( <o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->h_adapter, NDIS_STATUS_HARD_ERRORS, TRUE );<o:p></o:p></p>
<p class=MsoNormal>+
__ipoib_complete_reset( p_adapter, NDIS_STATUS_HARD_ERRORS );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>
else<o:p></o:p></p>
<p class=MsoNormal>
{<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>-
NdisMResetComplete(<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->h_adapter, NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></p>
<p class=MsoNormal>+
__ipoib_complete_reset( p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></p>
<p class=MsoNormal>
status = IB_SUCCESS;<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>@@ -1261,10 +1292,7 @@<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
if( p_adapter->reset )<o:p></o:p></p>
<p class=MsoNormal>
{<o:p></o:p></p>
<p class=MsoNormal>-
//ASSERT(FALSE);<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>-
NdisMResetComplete(<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->h_adapter, NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></p>
<p class=MsoNormal>+
__ipoib_complete_reset( p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
IPOIB_EXIT( IPOIB_DBG_INIT );<o:p></o:p></p>
<p class=MsoNormal>@@ -1323,9 +1351,7 @@<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
if( p_adapter->reset )<o:p></o:p></p>
<p class=MsoNormal>
{<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->reset = FALSE;<o:p></o:p></p>
<p class=MsoNormal>-
NdisMResetComplete(<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->h_adapter, NDIS_STATUS_SUCCESS, TRUE );<o:p></o:p></p>
<p class=MsoNormal>+
__ipoib_complete_reset( p_adapter, NDIS_STATUS_SUCCESS );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
IPOIB_EXIT( IPOIB_DBG_INIT );<o:p></o:p></p>
<p class=MsoNormal>Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h<o:p></o:p></p>
<p class=MsoNormal>===================================================================<o:p></o:p></p>
<p class=MsoNormal>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h
(revision 2975)<o:p></o:p></p>
<p class=MsoNormal>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.h
(working copy)<o:p></o:p></p>
<p class=MsoNormal>@@ -70,14 +70,14 @@<o:p></o:p></p>
<p class=MsoNormal>
CSUM_BYPASS<o:p></o:p></p>
<p class=MsoNormal> } csum_flag_t;<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>-typedef enum _ipoib_state<o:p></o:p></p>
<p class=MsoNormal>-{<o:p></o:p></p>
<p class=MsoNormal>-
IPOIB_INIT = -1,<o:p></o:p></p>
<p class=MsoNormal>- IPOIB_PAUSED,<o:p></o:p></p>
<p class=MsoNormal>- IPOIB_PAUSING,<o:p></o:p></p>
<p class=MsoNormal>- IPOIB_RUNNING<o:p></o:p></p>
<p class=MsoNormal>-} ipoib_state_t;<o:p></o:p></p>
<p class=MsoNormal>+typedef
uint32_t
ipoib_state_t;<o:p></o:p></p>
<p class=MsoNormal>+#define
IPOIB_INIT
1<o:p></o:p></p>
<p class=MsoNormal>+#define
IPOIB_PAUSED
2<o:p></o:p></p>
<p class=MsoNormal>+#define
IPOIB_PAUSING
4<o:p></o:p></p>
<p class=MsoNormal>+#define
IPOIB_RUNNING
8<o:p></o:p></p>
<p class=MsoNormal>+#define
IPOIB_RESET_OR_DOWN 16<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>+<o:p></o:p></p>
<p class=MsoNormal> typedef struct _ipoib_offloads_cap_ {<o:p></o:p></p>
<p class=MsoNormal>
boolean_t lso;<o:p></o:p></p>
<p class=MsoNormal>
boolean_t
send_chksum_offload;<o:p></o:p></p>
<p class=MsoNormal>Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp<o:p></o:p></p>
<p class=MsoNormal>===================================================================<o:p></o:p></p>
<p class=MsoNormal>---
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
(revision 2975)<o:p></o:p></p>
<p class=MsoNormal>+++
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
(working copy)<o:p></o:p></p>
<p class=MsoNormal>@@ -3155,8 +3155,8 @@<o:p></o:p></p>
<p class=MsoNormal>
p_adapter = (ipoib_adapter_t*)adapter_context;<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
cl_obj_lock( &p_adapter->obj );<o:p></o:p></p>
<p class=MsoNormal>-
if( p_adapter->ipoib_state == IPOIB_PAUSING ||<o:p></o:p></p>
<p class=MsoNormal>-
p_adapter->ipoib_state == IPOIB_PAUSED)<o:p></o:p></p>
<p class=MsoNormal>+
if( p_adapter->ipoib_state & IPOIB_PAUSING ||<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->ipoib_state & IPOIB_PAUSED)<o:p></o:p></p>
<p class=MsoNormal>
{<o:p></o:p></p>
<p class=MsoNormal>
status = NDIS_STATUS_PAUSED; <o:p></o:p></p>
<p class=MsoNormal>
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></p>
<p class=MsoNormal>@@ -3275,6 +3275,8 @@<o:p></o:p></p>
<p class=MsoNormal>
IN
NDIS_HANDLE
adapter_context,<o:p></o:p></p>
<p class=MsoNormal>
IN NDIS_SHUTDOWN_ACTION shutdown_action)<o:p></o:p></p>
<p class=MsoNormal> {<o:p></o:p></p>
<p class=MsoNormal>+
KLOCK_QUEUE_HANDLE
hdl;<o:p></o:p></p>
<p class=MsoNormal>+
<o:p></o:p></p>
<p class=MsoNormal>
IPOIB_ENTER( IPOIB_DBG_INIT ) ;<o:p></o:p></p>
<p class=MsoNormal>
UNUSED_PARAM( shutdown_action );<o:p></o:p></p>
<p class=MsoNormal>
<o:p></o:p></p>
<p class=MsoNormal>@@ -3287,7 +3289,16 @@<o:p></o:p></p>
<p class=MsoNormal>
("Shutter shut, state = %d\n", p_adapter->ipoib_state));<o:p></o:p></p>
<p class=MsoNormal>
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></p>
<p class=MsoNormal>
("Shutter shut, state = %d\n", p_adapter->ipoib_state));<o:p></o:p></p>
<p class=MsoNormal>-
shutter_shut ( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
// Wait until NDIS will return all indicated NBLs that were received<o:p></o:p></p>
<p class=MsoNormal>+
// Avoid shutting the shutter twice<o:p></o:p></p>
<p class=MsoNormal>+
KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
ASSERT ( !(p_adapter->ipoib_state & IPOIB_RESET_OR_DOWN) );<o:p></o:p></p>
<p class=MsoNormal>+
if ( p_adapter->ipoib_state == IPOIB_RUNNING ) { //ensure that there was no
active reset<o:p></o:p></p>
<p class=MsoNormal>+
shutter_shut( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
// Notify that shutter was already shut<o:p></o:p></p>
<p class=MsoNormal>+
p_adapter->ipoib_state |= IPOIB_RESET_OR_DOWN;<o:p></o:p></p>
<p class=MsoNormal>+
}<o:p></o:p></p>
<p class=MsoNormal>+
KeReleaseInStackQueuedSpinLock( &hdl );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
IPOIB_EXIT( IPOIB_DBG_INIT );<o:p></o:p></p>
<p class=MsoNormal>@@ -3965,6 +3976,7 @@<o:p></o:p></p>
<p class=MsoNormal>
cl_free( context );<o:p></o:p></p>
<p class=MsoNormal> }<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>+<o:p></o:p></p>
<p class=MsoNormal> static NDIS_STATUS <o:p></o:p></p>
<p class=MsoNormal> ipoib_pause(<o:p></o:p></p>
<p class=MsoNormal>
IN NDIS_HANDLE
adapter_context,
<o:p></o:p></p>
<p class=MsoNormal>@@ -3972,28 +3984,37 @@<o:p></o:p></p>
<p class=MsoNormal> {<o:p></o:p></p>
<p class=MsoNormal>
ipoib_adapter_t
*p_adapter;<o:p></o:p></p>
<p class=MsoNormal>
KLOCK_QUEUE_HANDLE
hdl;<o:p></o:p></p>
<p class=MsoNormal>+
ipoib_state_t
prev_state;<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>-
UNREFERENCED_PARAMETER(pause_parameters);<o:p></o:p></p>
<p class=MsoNormal>+
UNREFERENCED_PARAMETER( pause_parameters );<o:p></o:p></p>
<p class=MsoNormal>
IPOIB_ENTER( IPOIB_DBG_INIT );<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>-
CL_ASSERT(adapter_context);<o:p></o:p></p>
<p class=MsoNormal>+
CL_ASSERT( adapter_context );<o:p></o:p></p>
<p class=MsoNormal>
p_adapter = (ipoib_adapter_t*)adapter_context;<o:p></o:p></p>
<p class=MsoNormal>-
CL_ASSERT(p_adapter->ipoib_state == IPOIB_RUNNING);<o:p></o:p></p>
<p class=MsoNormal>+
<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>
KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl );<o:p></o:p></p>
<p class=MsoNormal>+
prev_state = p_adapter->ipoib_state;<o:p></o:p></p>
<p class=MsoNormal>+
CL_ASSERT ( prev_state & IPOIB_RUNNING );<o:p></o:p></p>
<p class=MsoNormal>
p_adapter->ipoib_state = IPOIB_PAUSING;<o:p></o:p></p>
<p class=MsoNormal>
KeReleaseInStackQueuedSpinLock( &hdl );<o:p></o:p></p>
<p class=MsoNormal>
<o:p></o:p></p>
<p class=MsoNormal>-
if (p_adapter->p_port) {<o:p></o:p></p>
<p class=MsoNormal>+
if ( p_adapter->p_port ) {<o:p></o:p></p>
<p class=MsoNormal>
cl_spinlock_acquire( &p_adapter->p_port->send_lock );<o:p></o:p></p>
<p class=MsoNormal>-
ipoib_port_resume(p_adapter->p_port,FALSE);<o:p></o:p></p>
<p class=MsoNormal>+
ipoib_port_resume( p_adapter->p_port,FALSE );<o:p></o:p></p>
<p class=MsoNormal>
cl_spinlock_release( &p_adapter->p_port->send_lock );<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>+
if ( prev_state == IPOIB_RUNNING ) { //i.e there was no active reset<o:p></o:p></p>
<p class=MsoNormal>+
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></p>
<p class=MsoNormal>+
("Shutter shut, state = %d\n", p_adapter->ipoib_state) );<o:p></o:p></p>
<p class=MsoNormal>+
shutter_shut ( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>+
}<o:p></o:p></p>
<p class=MsoNormal>+
else {<o:p></o:p></p>
<p class=MsoNormal>+
ASSERT ( prev_state & IPOIB_RESET_OR_DOWN);<o:p></o:p></p>
<p class=MsoNormal>+
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<o:p></o:p></p>
<p class=MsoNormal>+
("Got reset when IPoIB port wasn't active\n") );<o:p></o:p></p>
<p class=MsoNormal>+
}<o:p></o:p></p>
<p class=MsoNormal>
<o:p></o:p></p>
<p class=MsoNormal>-
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></p>
<p class=MsoNormal>-
("Shutter shut, state = %d\n", p_adapter->ipoib_state));<o:p></o:p></p>
<p class=MsoNormal>-
shutter_shut ( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal>-
<o:p></o:p></p>
<p class=MsoNormal>
KeAcquireInStackQueuedSpinLock( &g_ipoib.lock, &hdl );<o:p></o:p></p>
<p class=MsoNormal>
p_adapter->ipoib_state = IPOIB_PAUSED;<o:p></o:p></p>
<p class=MsoNormal>
KeReleaseInStackQueuedSpinLock( &hdl );<o:p></o:p></p>
<p class=MsoNormal>@@ -4025,7 +4046,7 @@<o:p></o:p></p>
<p class=MsoNormal>
// Check to see if we need to change any attributes<o:p></o:p></p>
<p class=MsoNormal>
}<o:p></o:p></p>
<p class=MsoNormal>
<o:p></o:p></p>
<p class=MsoNormal>-
if ( (p_adapter->ipoib_state == IPOIB_PAUSED) || (p_adapter->ipoib_state
== IPOIB_INIT) ) {<o:p></o:p></p>
<p class=MsoNormal>+
if ( (p_adapter->ipoib_state & IPOIB_PAUSED) || (p_adapter->ipoib_state
& IPOIB_INIT) ) {<o:p></o:p></p>
<p class=MsoNormal>
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,<o:p></o:p></p>
<p class=MsoNormal>
("Shutter Alive, ipoib_state = %d\n", p_adapter->ipoib_state));<o:p></o:p></p>
<p class=MsoNormal>
shutter_alive( &p_adapter->recv_shutter );<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><b>Alexander (XaleX) Naslednikov<o:p></o:p></b></p>
<p class=MsoNormal><b>SW Networking Team<o:p></o:p></b></p>
<p class=MsoNormal><b>Mellanox Technologies<o:p></o:p></b></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>