<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff size=2>Of 
course,</FONT></SPAN></DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff size=2>We 
found (using WHQL test) that IPoIB driver got stuck when one set invalid 
registers parameters.</FONT></SPAN></DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff size=2>See 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\<last_interface_number>...for 
the list of parameters.</FONT></SPAN></DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff size=2>The 
default and min/max values of these parameters defined in 
netipoib.def</FONT></SPAN></DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff size=2>There 
was (almost) no check on validity of these parameters, and this patch solves 
this and doesn't allow driver to be initialized with wrong 
parameters.</FONT></SPAN></DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=238530113-26062008><FONT face=Arial color=#0000ff 
size=2>XaleX</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ofw-bounces@lists.openfabrics.org 
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Alex 
Estrin<BR><B>Sent:</B> Thursday, June 26, 2008 2:46 PM<BR><B>To:</B> Alex 
Naslednikov; ofw@lists.openfabrics.org; Tzachi Dar<BR><B>Subject:</B> RE: [ofw] 
[IPoIB] Fix for improper handling of IPoIB params<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=088402812-26062008><FONT face=Arial 
color=#0000ff size=2>Would you please explain what improper handling this 
patch is intended to fix?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=088402812-26062008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=088402812-26062008><FONT face=Arial 
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=088402812-26062008><FONT face=Arial 
color=#0000ff size=2>Alex</FONT></SPAN></DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT face=Tahoma size=2><B>From:</B> 
ofw-bounces@lists.openfabrics.org [mailto:ofw-bounces@lists.openfabrics.org] 
<B>On Behalf Of </B>Alex Naslednikov<BR><B>Sent:</B> Thursday, June 26, 2008 
8:00 AM<BR><B>To:</B> ofw@lists.openfabrics.org; Tzachi Dar<BR><B>Subject:</B> 
[ofw] [IPoIB] Fix for improper handling of IPoIB params<BR></FONT><BR></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=151055611-26062008>Reposting this message again (there was a porblem 
  with my first post)</SPAN></FONT></DIV><BR>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  </DIV>
  <DIV></DIV>
  <DIV><FONT face=Arial size=2>This patch fixes improper handl<SPAN 
  class=975370512-24062008>ing</SPAN> of IPoIB parameters received from 
  registers<BR>Signed-off by: xalex (</FONT><A 
  href="mailto:xalex@mellanox.co.il"><FONT face=Arial 
  size=2>xalex@mellanox.co.il</FONT></A><FONT face=Arial size=2>)</FONT></DIV>
  <DIV> </DIV>
  <DIV><FONT face=Arial size=2>Index: 
  ulp/ipoib/kernel/SOURCES<BR>===================================================================<BR>--- 
  ulp/ipoib/kernel/SOURCES (revision 2629)<BR>+++ 
  ulp/ipoib/kernel/SOURCES (revision 2630)<BR>@@ -25,14 +25,16 
  @@<BR> <BR> TARGETLIBS= \<BR>  $(TARGETPATH)\*\complib.lib 
  \<BR>- $(DDK_LIB_PATH)\ndis.lib<BR>+ $(DDK_LIB_PATH)\ndis.lib 
  \<BR>+ $(DDK_LIB_PATH)\ntstrsafe.lib 
  \<BR>+ $(DDK_LIB_PATH)\strsafe.lib<BR> <BR> !if 
  !defined(DDK_TARGET_OS) || "$(DDK_TARGET_OS)"=="Win2K"<BR> #<BR> # 
  The driver is built in the Win2K build environment<BR> # - use the 
  library version of safe strings <BR> #<BR>-TARGETLIBS= $(TARGETLIBS) 
  $(DDK_LIB_PATH)\ntstrsafe.lib<BR>+#TARGETLIBS= $(TARGETLIBS) 
  $(DDK_LIB_PATH)\ntstrsafe.lib<BR> !endif<BR> <BR> !IFDEF 
  ENABLE_EVENT_TRACING<BR>Index: 
  ulp/ipoib/kernel/ipoib_driver.c<BR>===================================================================<BR>--- 
  ulp/ipoib/kernel/ipoib_driver.c (revision 2629)<BR>+++ 
  ulp/ipoib/kernel/ipoib_driver.c (revision 2630)<BR>@@ -30,7 +30,7 
  @@<BR>  * $Id$<BR>  */<BR> <BR>-<BR>+#include 
  "limits.h"<BR> #include "ipoib_driver.h"<BR> #include 
  "ipoib_debug.h"<BR> <BR>@@ -47,8 +47,12 @@<BR> #include 
  <complib/cl_init.h><BR> #include 
  <initguid.h><BR> #include <iba/ipoib_ifc.h><BR>+#include 
  "ntstrsafe.h"<BR>+#include 
  "strsafe.h"<BR> <BR> <BR>+<BR>+<BR> #if 
  defined(NDIS50_MINIPORT)<BR> #define MAJOR_NDIS_VERSION 
  5<BR> #define MINOR_NDIS_VERSION 0<BR>@@ -59,6 +63,8 @@<BR> #error 
  NDIS Version not defined, try defining NDIS50_MINIPORT or 
  NDIS51_MINIPORT<BR> #endif<BR> <BR>+PDRIVER_OBJECT    g_p_drv_obj;<BR>+<BR> static 
  const NDIS_OID SUPPORTED_OIDS[] 
  =<BR> {<BR>  OID_GEN_SUPPORTED_LIST,<BR>@@ -125,7 +131,72 
  @@<BR> uint32_t  g_ipoib_dbg_flags = 
  0x00000fff;<BR> ipoib_globals_t g_ipoib = {0};<BR> <BR>+typedef 
  struct _IPOIB_REG_ENTRY<BR>+{<BR>+ NDIS_STRING 
  RegName;                
  // variable name text<BR>+ BOOLEAN     
  bRequired;              
  // 1 -> required, 0 -> 
  optional<BR>+ UINT        
  FieldOffset;            
  // offset in parent 
  struct<BR>+ UINT        
  FieldSize;              
  // size (in bytes) of the 
  field<BR>+ UINT        
  Default;                
  // default value to 
  use<BR>+ UINT        
  Min;                    
  // minimum value 
  allowed<BR>+ UINT        
  Max;                    
  // maximum value allowed<BR>+} IPOIB_REG_ENTRY, 
  *PIPOIB_REG_ENTRY;<BR> <BR>+IPOIB_REG_ENTRY HCARegTable[] = 
  {<BR>+ // reg value 
  name             
  If Required  Offset in parentr 
  struct             
  Field 
  size                  
  Default         
  Min     
  Max<BR>+ {NDIS_STRING_CONST("RqDepth"),          
  1, 
  IPOIB_OFFSET(rq_depth),              
  IPOIB_SIZE(rq_depth),           
  512,        128,    
  1024},<BR>+ {NDIS_STRING_CONST("RqLowWatermark"),   0, 
  IPOIB_OFFSET(rq_low_watermark),      
  IPOIB_SIZE(rq_low_watermark),   
  4,          
  2,      
  8},<BR>+ {NDIS_STRING_CONST("SqDepth"),          
  1, 
  IPOIB_OFFSET(sq_depth),              
  IPOIB_SIZE(sq_depth),           
  512,        128,    
  1024},<BR>+ {NDIS_STRING_CONST("SendChksum"),       
  1, IPOIB_OFFSET(send_chksum_offload),   
  IPOIB_SIZE(send_chksum_offload),0,          
  0,      
  1},<BR>+ {NDIS_STRING_CONST("RecvChksum"),       
  1, IPOIB_OFFSET(recv_chksum_offload),   
  IPOIB_SIZE(recv_chksum_offload),0,          
  0,      
  1},<BR>+ {NDIS_STRING_CONST("SaTimeout"),        
  1, 
  IPOIB_OFFSET(sa_timeout),            
  IPOIB_SIZE(sa_timeout),         
  1000,       250,    
  UINT_MAX},<BR>+ {NDIS_STRING_CONST("SaRetries"),        
  1, 
  IPOIB_OFFSET(sa_retry_cnt),          
  IPOIB_SIZE(sa_retry_cnt),       
  10,         
  1,      
  UINT_MAX},<BR>+ {NDIS_STRING_CONST("RecvRatio"),        
  1, IPOIB_OFFSET(recv_pool_ratio),       
  IPOIB_SIZE(recv_pool_ratio),    
  1,          
  1,      
  10},<BR>+ {NDIS_STRING_CONST("PayloadMtu"),       
  1, 
  IPOIB_OFFSET(payload_mtu),           
  IPOIB_SIZE(payload_mtu),        <SPAN 
  class=151055611-26062008> 2044 </SPAN>,         <SPAN 
  class=151055611-26062008><FONT color=#0000ff><FONT 
  color=#000000> 60</FONT> </FONT></SPAN>,   
  2044}<BR>+};  <BR>+<BR>+#define IPOIB_NUM_REG_PARAMS (sizeof 
  (HCARegTable) / sizeof(IPOIB_REG_ENTRY))<BR>+<BR>+<BR>+static 
  void<BR>+ipoib_create_log(<BR>+ NDIS_HANDLE h_adapter,<BR>+ UINT 
  ind,<BR>+ ULONG eventLogMsgId)<BR>+<BR>+{<BR>+#define cMaxStrLen  
  40<BR>+#define cArrLen  3<BR>+<BR>+ PWCHAR logMsgArray[cArrLen]; 
  <BR>+ WCHAR strVal[cMaxStrLen];<BR>+ NDIS_STRING 
  AdapterInstanceName;<BR>+<BR>+ IPOIB_INIT_NDIS_STRING(&AdapterInstanceName);<BR>+ if 
  (NdisMQueryAdapterInstanceName(&AdapterInstanceName, h_adapter)!= 
  NDIS_STATUS_SUCCESS 
  ){<BR>+  ASSERT(FALSE);<BR>+  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR,IPOIB_DBG_ERROR, ("[IPoIB] Init:Failed to retreive adapter 
  name.\n"));<BR>+  return;<BR>+ }<BR>+ logMsgArray[0] = 
  AdapterInstanceName.Buffer;<BR>+ <BR>+ if 
  (RtlStringCbPrintfW(strVal, sizeof(strVal), L"0x%x", HCARegTable[ind].Default) 
  != STATUS_SUCCESS) 
  {<BR>+  ASSERT(FALSE);<BR>+  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR,IPOIB_DBG_ERROR,<BR>+  ("[IPoIB] Init: Problem 
  copying string value: 
  exiting\n"));<BR>+  return;<BR>+ }<BR>+ <BR>+ logMsgArray[0] 
  = AdapterInstanceName.Buffer;<BR>+ logMsgArray[1] = 
  HCARegTable[ind].RegName.Buffer;<BR>+ logMsgArray[2] = 
  strVal;<BR>+ <BR>+ NdisWriteEventLogEntry(g_p_drv_obj, 
  eventLogMsgId, 0, cArrLen, &logMsgArray, 0, 
  NULL);<BR>+<BR>+}<BR>+<BR>+<BR>+<BR> NTSTATUS<BR> DriverEntry(<BR>  IN    PDRIVER_OBJECT    p_drv_obj,<BR>@@ 
  -248,6 +319,7 
  @@<BR>  NDIS_MINIPORT_CHARACTERISTICS characteristics;<BR> <BR>  IPOIB_ENTER( 
  IPOIB_DBG_INIT );<BR>+ g_p_drv_obj = p_drv_obj;<BR> <BR> #ifdef 
  _DEBUG_<BR>  PAGED_CODE();<BR>@@ -397,6 +469,7 
  @@<BR> }<BR> <BR> <BR>+<BR> NDIS_STATUS<BR> ipoib_get_adapter_params(<BR>  IN    NDIS_HANDLE* 
  const   wrapper_config_context,<BR>@@ -405,9 +478,13 
  @@<BR>  NDIS_STATUS      status;<BR>  NDIS_HANDLE      h_config;<BR>  NDIS_CONFIGURATION_PARAMETER *p_param;<BR>- NDIS_STRING      keyword;<BR>  PUCHAR       mac;<BR>  UINT       len;<BR>+ UINT                            
  value;<BR>+ PIPOIB_REG_ENTRY                
  pRegEntry;<BR>+ UINT                            
  i;<BR>+ PUCHAR                          
  structPointer;<BR>+ int sq_depth_step = 
  128;<BR> <BR>  IPOIB_ENTER( IPOIB_DBG_INIT );<BR> <BR>@@ 
  -419,124 +496,96 @@<BR>   return 
  status;<BR>  }<BR> <BR>- /* Required: Receive queue depth. 
  */<BR>- RtlInitUnicodeString( &keyword, L"RqDepth" 
  );<BR>- NdisReadConfiguration(<BR>-  &status, &p_param, 
  h_config, &keyword, NdisParameterInteger );<BR>- if( status != 
  NDIS_STATUS_SUCCESS )<BR>+ // read all the registry values <BR>+ for 
  (i = 0, pRegEntry = HCARegTable; i < IPOIB_NUM_REG_PARAMS; 
  ++i)<BR>  {<BR>-  IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, 
  IPOIB_DBG_ERROR,<BR>-   ("Receive Queue Depth parameter 
  missing.\n") );<BR>-  return 
  status;<BR>- }<BR>- p_adapter->params.rq_depth = 
  p_param->ParameterData.IntegerData;<BR>+  // initialize pointer 
  to appropriate place inside 'params'<BR>+  structPointer = (PUCHAR) 
  &p_adapter->params + pRegEntry[i].FieldOffset;<BR> <BR>- /* 
  Optional: Receive queue low watermark. */<BR>- RtlInitUnicodeString( 
  &keyword, L"RqLowWatermark" 
  );<BR>- NdisReadConfiguration(<BR>-  &status, &p_param, 
  h_config, &keyword, NdisParameterInteger );<BR>- if( status != 
  NDIS_STATUS_SUCCESS || !p_param->ParameterData.IntegerData 
  )<BR>- {<BR>-  p_adapter->params.rq_low_watermark = 
  p_adapter->params.rq_depth >> 
  2;<BR>- }<BR>- else<BR>- {<BR>-  p_adapter->params.rq_low_watermark 
  =<BR>-   p_adapter->params.rq_depth / 
  p_param->ParameterData.IntegerData;<BR>- }<BR>+  // Get the 
  configuration value for a specific parameter.  Under NT 
  the<BR>+  // parameters are all read in as 
  DWORDs.<BR>+  NdisReadConfiguration(<BR>+   &status,<BR>+   &p_param,<BR>+   h_config,<BR>+   &pRegEntry[i].RegName,<BR>+   NdisParameterInteger);<BR> <BR>- /* 
  Required: Send queue depth. */<BR>- RtlInitUnicodeString( &keyword, 
  L"SqDepth" );<BR>- NdisReadConfiguration(<BR>-  &status, 
  &p_param, h_config, &keyword, NdisParameterInteger );<BR>- if( 
  status != NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("Send Queue Depth 
  parameter missing.\n") );<BR>-  return 
  status;<BR>- }<BR>- p_adapter->params.sq_depth = 
  p_param->ParameterData.IntegerData;<BR>- /* Send queue depth needs to 
  be a power of two. */<BR>- if( p_adapter->params.sq_depth <= 128 
  )<BR>-  p_adapter->params.sq_depth = 128;<BR>- else if( 
  p_adapter->params.sq_depth <= 256 
  )<BR>-  p_adapter->params.sq_depth = 256;<BR>- else if( 
  p_adapter->params.sq_depth <= 512 
  )<BR>-  p_adapter->params.sq_depth = 
  512;<BR>- else<BR>-  p_adapter->params.sq_depth = 
  1024;<BR>+  // If the parameter was present, then check its value 
  for validity.<BR>+  if (status == 
  NDIS_STATUS_SUCCESS)<BR>+  {<BR>+   // Check that 
  param value is not too small or too large<BR>+   if 
  (p_param->ParameterData.IntegerData < pRegEntry[i].Min 
  ||<BR>+    p_param->ParameterData.IntegerData > 
  pRegEntry[i].Max)<BR>+   {<BR>+    value = 
  pRegEntry[i].Default;<BR>+    ipoib_create_log(p_adapter->h_adapter, 
  i, 
  EVENT_IPOIB_WRONG_PARAMETER_WRN);<BR>+    IPOIB_PRINT(TRACE_LEVEL_VERBOSE, 
  IPOIB_DBG_INIT, ("Read configuration.Registry %S value is out of range, 
  setting default value= 0x%x\n", pRegEntry[i].RegName.Buffer, 
  value));                                
  <BR> <BR>- /* Required: Send Checksum Offload. 
  */<BR>- RtlInitUnicodeString( &keyword, L"SendChksum" 
  );<BR>- NdisReadConfiguration(<BR>-  &status, &p_param, 
  h_config, &keyword, NdisParameterInteger );<BR>- if( status != 
  NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("Send Checksum 
  Offload parameter missing.\n") );<BR>-  return 
  status;<BR>- }<BR>- p_adapter->params.send_chksum_offload = 
  (p_param->ParameterData.IntegerData != 
  0);<BR>+   }<BR>+   else<BR>+   {<BR>+    value 
  = 
  p_param->ParameterData.IntegerData;<BR>+    IPOIB_PRINT(TRACE_LEVEL_VERBOSE, 
  IPOIB_DBG_INIT, ("Read configuration. Registry %S, Value= 0x%x\n", 
  pRegEntry[i].RegName.Buffer, 
  value));<BR>+   }<BR>+  }<BR> <BR>- /* 
  Required: Send Checksum Offload. */<BR>- RtlInitUnicodeString( 
  &keyword, L"RecvChksum" 
  );<BR>- NdisReadConfiguration(<BR>-  &status, &p_param, 
  h_config, &keyword, NdisParameterInteger );<BR>- if( status != 
  NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("Recv Checksum 
  Offload parameter missing.\n") );<BR>-  return 
  status;<BR>- }<BR>- p_adapter->params.recv_chksum_offload = 
  (p_param->ParameterData.IntegerData != 
  0);<BR>+  else<BR>+  {<BR>+   value = 
  pRegEntry[i].Default;<BR>+   status = 
  NDIS_STATUS_SUCCESS;<BR>+   if 
  (pRegEntry[i].bRequired)<BR>+   {<BR>+    ipoib_create_log(p_adapter->h_adapter, 
  i, 
  EVENT_IPOIB_WRONG_PARAMETER_ERR);<BR>+    IPOIB_PRINT(TRACE_LEVEL_ERROR, 
  IPOIB_DBG_INIT, ("Read configuration.Registry %S value not found, setting 
  default value= 0x%x\n", pRegEntry[i].RegName.Buffer, 
  value));<BR>+   }<BR>+   else<BR>+   {<BR>+    ipoib_create_log(p_adapter->h_adapter, 
  i, 
  EVENT_IPOIB_WRONG_PARAMETER_INFO);<BR>+    IPOIB_PRINT(TRACE_LEVEL_VERBOSE, 
  IPOIB_DBG_INIT, ("Read configuration. Registry %S value not found, Value= 
  0x%x\n", pRegEntry[i].RegName.Buffer, 
  value));<BR>+   }<BR> <BR>- /* Required: SA query 
  timeout, in milliseconds. */<BR>- RtlInitUnicodeString( &keyword, 
  L"SaTimeout" );<BR>- NdisReadConfiguration(<BR>-  &status, 
  &p_param, h_config, &keyword, NdisParameterInteger );<BR>- if( 
  status != NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("SA query timeout 
  parameter missing.\n") );<BR>-  return 
  status;<BR>- }<BR>- p_adapter->params.sa_timeout = 
  p_param->ParameterData.IntegerData;<BR>+  }<BR>+  //<BR>+  // 
  Store the value in the adapter 
  structure.<BR>+  //<BR>+  switch(pRegEntry[i].FieldSize)<BR>+  {<BR>+   case 
  1:<BR>+    *((PUCHAR) structPointer) = (UCHAR) 
  value;<BR>+    break;<BR> <BR>- /* Required: SA 
  query retry count. */<BR>- RtlInitUnicodeString( &keyword, 
  L"SaRetries" );<BR>- NdisReadConfiguration(<BR>-  &status, 
  &p_param, h_config, &keyword, NdisParameterInteger );<BR>- if( 
  status != NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("SA query retry 
  count parameter missing.\n") );<BR>-  return 
  status;<BR>+   case 2:<BR>+    *((PUSHORT) 
  structPointer) = (USHORT) 
  value;<BR>+    break;<BR>+<BR>+   case 
  4:<BR>+    *((PULONG) structPointer) = (ULONG) 
  value;<BR>+    break;<BR>+<BR>+   default:<BR>+    IPOIB_PRINT(TRACE_LEVEL_ERROR, 
  IPOIB_DBG_ERROR, ("Bogus field size %d\n", 
  pRegEntry[i].FieldSize));<BR>+    break;<BR>+  }<BR>  }<BR>- p_adapter->params.sa_retry_cnt 
  = p_param->ParameterData.IntegerData;<BR> <BR>- /* Required: 
  Receive pool to queue depth ratio. */<BR>- RtlInitUnicodeString( 
  &keyword, L"RecvRatio" 
  );<BR>- NdisReadConfiguration(<BR>-  &status, &p_param, 
  h_config, &keyword, NdisParameterInteger );<BR>- if( status != 
  NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("Receive pool to 
  queue depth ratio parameter missing.\n") );<BR>-  return 
  status;<BR>+ // Send queue depth needs to be a power of 
  two<BR>+ //static const INT sq_depth_step = 128;<BR>+<BR>+ if 
  (p_adapter->params.sq_depth % sq_depth_step) {<BR>+  static const 
  c_sq_ind = 2;<BR>+  p_adapter->params.sq_depth = sq_depth_step 
  *(<BR>+   p_adapter->params.sq_depth / sq_depth_step + !!( 
  (p_adapter->params.sq_depth % sq_depth_step) > (sq_depth_step/2) 
  ));<BR>+  ipoib_create_log(p_adapter->h_adapter, c_sq_ind, 
  EVENT_IPOIB_WRONG_PARAMETER_WRN);<BR>+  IPOIB_PRINT(TRACE_LEVEL_VERBOSE, 
  IPOIB_DBG_INIT, ("SQ DEPTH value was rounded to the closest acceptable value 
  of  0x%x\n", p_adapter->params.sq_depth 
  ));<BR>+<BR>  }<BR>- p_adapter->params.recv_pool_ratio = 
  p_param->ParameterData.IntegerData;<BR> <BR>- /* required: MTU 
  size. */<BR>- RtlInitUnicodeString( &keyword, L"PayloadMtu" 
  );<BR>- NdisReadConfiguration(<BR>-  &status, &p_param, 
  h_config, &keyword, NdisParameterInteger );<BR>- if( status != 
  NDIS_STATUS_SUCCESS )<BR>- {<BR>-  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,<BR>-   ("PayloadMtu 
  parameter missing. Use the default.\n") );<BR>-  return 
  status;<BR>- }<BR>- p_adapter->params.payload_mtu = 
  p_param->ParameterData.IntegerData;<BR>+<BR>+ // Adjusting the low 
  watermark parameter<BR>+ p_adapter->params.rq_low_watermark 
  =<BR>+   p_adapter->params.rq_depth / 
  p_adapter->params.rq_low_watermark;<BR>+<BR>  p_adapter->params.xfer_block_size 
  = (sizeof(eth_hdr_t) + 
  p_adapter->params.payload_mtu);<BR>  NdisReadNetworkAddress( 
  &status, &mac, &len, h_config );<BR> <BR>@@ -2344,8 +2393,14 
  @@<BR> <BR>  /* Must cast here because the service name is an 
  array of unsigned chars but<BR>   * strcpy want a pointer to a 
  signed char */<BR>- strcpy( (char *)ib_service.svc_rec.service_name, 
  ATS_NAME );<BR>-<BR>+ if ( StringCchCopy( (char 
  *)ib_service.svc_rec.service_name, 
  <BR>+  sizeof(ib_service.svc_rec.service_name) / sizeof(char), 
  ATS_NAME ) != S_OK) 
  {<BR>+  ASSERT(FALSE);<BR>+  IPOIB_PRINT_EXIT( 
  TRACE_LEVEL_ERROR,IPOIB_DBG_ERROR,<BR>+  ("Problem copying ATS name: 
  exiting\n"));<BR>+  return;<BR>+ }<BR>+    
  <BR>  /* IP Address in question will be put in below 
  */<BR>  ib_service.port_guid  = 
  p_adapter->guids.port_guid;<BR>  ib_service.timeout_ms  = 
  p_adapter->params.sa_timeout;<BR>Index: 
  ulp/ipoib/kernel/ipoib_log.mc<BR>===================================================================<BR>--- 
  ulp/ipoib/kernel/ipoib_log.mc (revision 2629)<BR>+++ 
  ulp/ipoib/kernel/ipoib_log.mc (revision 2630)<BR>@@ -283,3 +283,27 
  @@<BR> Language=English<BR> %2: The local port rate is too slow for 
  the existing broadcast MC 
  group.<BR> .<BR>+<BR>+MessageId=0x0058<BR>+Facility=IPoIB<BR>+Severity=Error<BR>+SymbolicName=EVENT_IPOIB_WRONG_PARAMETER_ERR<BR>+Language=English<BR>+%2: 
  Incorrect value or non-existing registry  for the required IPoIB 
  parameter %3, overriding it by default value: 
  %4<BR>+.<BR>+<BR>+MessageId=0x0059<BR>+Facility=IPoIB<BR>+Severity=Warning<BR>+SymbolicName=EVENT_IPOIB_WRONG_PARAMETER_WRN<BR>+Language=English<BR>+%2: 
  Incorrect value or non-existing registry entry  for the required IPoIB 
  parameter %3, overriding it by default value: 
  %4<BR>+.<BR>+<BR>+MessageId=0x005A<BR>+Facility=IPoIB<BR>+Severity=Informational<BR>+SymbolicName=EVENT_IPOIB_WRONG_PARAMETER_INFO<BR>+Language=English<BR>+%2: 
  Incorrect value or non-existing registry  for the optional IPoIB 
  parameter %3, overriding it by default value: %4<BR>+.<BR>Index: 
  ulp/ipoib/kernel/ipoib_driver.h<BR>===================================================================<BR>--- 
  ulp/ipoib/kernel/ipoib_driver.h (revision 2629)<BR>+++ 
  ulp/ipoib/kernel/ipoib_driver.h (revision 2630)<BR>@@ -126,4 +126,13 
  @@<BR> ipoib_resume_oids(<BR>  IN    ipoib_adapter_t* 
  const  p_adapter );<BR> <BR>+#define 
  IPOIB_OFFSET(field)   
  ((UINT)FIELD_OFFSET(ipoib_params_t,field))<BR>+#define 
  IPOIB_SIZE(field)     
  sizeof(((ipoib_params_t*)0)->field)<BR>+#define 
  IPOIB_INIT_NDIS_STRING(str)                        
  \<BR>+    (str)->Length = 
  0;                                  
  \<BR>+    (str)->MaximumLength = 
  0;                           
  \<BR>+    (str)->Buffer = 
  NULL;<BR>+<BR>+<BR>+<BR> #endif /* _IPOIB_DRIVER_H_ 
  */<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>