[ofw] Emailing: pkey_not_found.diff

Tzachi Dar tzachid at mellanox.co.il
Tue Nov 4 09:17:26 PST 2008


After looking at this patch, there is one problem that I see:
 
If the call to ipoib_set_active fails, we are already after the lines:
 if (p_port->state == IB_QPS_INIT) {
  p_port->state = IB_QPS_RTS;
 }

which means that our p_port->state will likely be  IB_QPS_RTS. In other
words, the next time port_up will be called it will do nothing.
Actually our QP is already at RTS which means that we should probably
undo more things. (move QP to error, is for sure).
 
I'll look more at ipoib_port_down and see what else should be done
there.
 
Thanks
Tzachi


________________________________

	From: ofw-bounces at lists.openfabrics.org
[mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Anatoly
Greenblatt
	Sent: Monday, November 03, 2008 11:46 AM
	To: ofw at lists.openfabrics.org
	Subject: [ofw] Emailing: pkey_not_found.diff
	
	
	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/20081104/36edd279/attachment.html>


More information about the ofw mailing list