[ofw] Emailing: pkey_not_found.diff

Anatoly Greenblatt anatolyg at voltaire.com
Mon Nov 3 01:46:12 PST 2008


Hi,
 
This patch fixes partition bug where network connection appeared as
connected while pkey not yet configured in sm.
 
Thanks,
Anatoly.
 
 
Index: ulp/ipoib/kernel/ipoib_adapter.c
===================================================================
--- ulp/ipoib/kernel/ipoib_adapter.c (revision 1715)
+++ ulp/ipoib/kernel/ipoib_adapter.c (working copy)
@@ -560,6 +560,7 @@
       ("Pkey table is invalid, index not found\n"));
   NdisWriteErrorLogEntry( p_adapter->h_adapter,
    EVENT_IPOIB_PARTITION_ERR, 1, p_adapter->guids.port_guid.pkey );
+  status = IB_NOT_FOUND;
   p_adapter->p_port->pkey_index = PKEY_INVALID_INDEX;
   goto pkey_end;
  }
@@ -1070,12 +1071,13 @@
 }
 
 
-void
+ib_api_status_t
 ipoib_set_active(
  IN    ipoib_adapter_t* const  p_adapter )
 {
  ib_pnp_event_t old_state;
  uint8_t   i;
+ ib_api_status_t status = IB_SUCCESS;
 
  IPOIB_ENTER( IPOIB_DBG_INIT );
 
@@ -1104,8 +1106,11 @@
 
  default:
   if (p_adapter->guids.port_guid.pkey != IB_DEFAULT_PKEY)
-   ipoib_query_pkey_index(p_adapter);
-
+  {
+   status = ipoib_query_pkey_index(p_adapter);
+   if( IB_SUCCESS != status)
+    break;
+  }
   /* Join all programmed multicast groups. */
   for( i = 0; i < p_adapter->mcast_array_size; i++ )
   {
@@ -1143,6 +1148,7 @@
  }
 
  IPOIB_EXIT( IPOIB_DBG_INIT );
+ return status;
 }
 
 
Index: ulp/ipoib/kernel/ipoib_adapter.h
===================================================================
--- ulp/ipoib/kernel/ipoib_adapter.h (revision 1715)
+++ ulp/ipoib/kernel/ipoib_adapter.h (working copy)
@@ -413,7 +413,7 @@
  IN  const uint8_t      link_speed );
 
 
-void
+ib_api_status_t
 ipoib_set_active(
  IN    ipoib_adapter_t* const  p_adapter );
 
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c (revision 1715)
+++ ulp/ipoib/kernel/ipoib_port.c (working copy)
@@ -5770,7 +5770,17 @@
  cl_spinlock_release( &p_port->recv_lock );
 
  /* Notify the adapter that we now have an active connection. */
- ipoib_set_active( p_port->p_adapter );
+ status = ipoib_set_active( p_port->p_adapter );
+ if( status != IB_SUCCESS )
+ {
+  ipoib_set_inactive( p_port->p_adapter );
+  __endpt_mgr_reset_all( p_port );
+  KeSetEvent( &p_port->sa_event, EVENT_INCREMENT, FALSE );
+  IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,
+   ("ipoib_set_active returned
%s.\n",p_port->p_adapter->p_ifc->get_err_str( status )));
+  ipoib_port_deref( p_port, ref_join_bcast );
+  return;
+ }
 
  /* garbage collector timer is needed when link is active */
  gc_due_time.QuadPart =
-(int64_t)(((uint64_t)p_port->p_adapter->params.mc_leave_rescan *
2000000) * 10);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081103/75bbcb04/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pkey_not_found.diff
Type: application/octet-stream
Size: 2612 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081103/75bbcb04/attachment.obj>


More information about the ofw mailing list