[openib-general] [PATCH] osm: pkey manager fail to clear unused peer block

Eitan Zahavi eitan at mellanox.co.il
Sat Jul 1 13:21:18 PDT 2006


Hi Hal

Similar to the failure to clear HCA port pkey block if it was empty.
The code for peer port does depend on the neighbor HCA block to exist.
So the fix is very similar: use an empty block for comparing with the
current peer port in this case.

Eitan

Signed-off-by:  Eitan Zahavi <eitan at mellanox.co.il>

Index: osm/opensm/osm_pkey_mgr.c
===================================================================
--- osm/opensm/osm_pkey_mgr.c	(revision 8313)
+++ osm/opensm/osm_pkey_mgr.c	(working copy)
@@ -404,6 +404,7 @@ pkey_mgr_update_peer_port(
   uint16_t peer_max_blocks;
   ib_api_status_t status = IB_SUCCESS;
   boolean_t ret_val = FALSE;
+  ib_pkey_table_t empty_block = {.pkey_entry = {0}, };
 
   p_physp = osm_port_get_default_phys_ptr( p_port );
   if (!osm_physp_is_valid( p_physp ))
@@ -452,6 +453,9 @@ pkey_mgr_update_peer_port(
   for (block_index = 0; block_index < p_pkey_tbl->used_blocks; block_index++)
   {
     block = osm_pkey_tbl_new_block_get( p_pkey_tbl, block_index );
+    if (!block)
+      block = &empty_block;
+
     peer_block = osm_pkey_tbl_block_get( p_peer_pkey_tbl, block_index );
     if ( !peer_block || memcmp( peer_block, block, sizeof( *peer_block ) ) )
     {





More information about the general mailing list