Fix couple of cases where duplicated LID generation is possible:

1) When guid2lid db is reloaded after standby or disconnected SM port
state (discovering) it must be validated, so content of used_lids[]
array (used as reference during LID assignment) will be consistent with
loaded guid2lid db.

2) When port for which LIDs were assigned exists in guid2lid db already
its record should be updated due to possibly changed LIDs, LMC, etc..

There still be more potential cases where LIDs could be duplicated. So
this patch fixes just part of them. I'm continuing an investigation.

Signed-off-by: Sasha Khapyorsky <sas...@voltaire.com>
---
 opensm/opensm/osm_lid_mgr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c
index 84f3508..08d54f0 100644
--- a/opensm/opensm/osm_lid_mgr.c
+++ b/opensm/opensm/osm_lid_mgr.c
@@ -319,6 +319,7 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr)
                                        "ERR 0306: "
                                        "Error restoring Guid-to-Lid "
                                        "persistent database. Ignoring it\n");
+                       lid_mgr_validate_db(p_mgr);
                }
        }
 
@@ -710,7 +711,7 @@ static int lid_mgr_get_port_lid(IN osm_lid_mgr_t * p_mgr,
                        /* we still need to send the setting to the target port 
*/
                        lid_changed = 1;
                }
-               goto Exit;
+               goto NewLidSet;
        } else
                OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
                        "0x%016" PRIx64 " has no persistent lid assigned\n",
@@ -764,7 +765,6 @@ NewLidSet:
        for (lid = *p_min_lid; lid <= *p_max_lid; lid++)
                p_mgr->used_lids[lid] = 1;
 
-Exit:
        /* make sure the assigned lids are marked in port_lid_tbl */
        for (lid = *p_min_lid; lid <= *p_max_lid; lid++)
                cl_ptr_vector_set(&p_mgr->p_subn->port_lid_tbl, lid, p_port);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to