Skip to contentSkip to conversation

opensm SA DB dump/restore: load SA DB only once

PATCH Applied Yevgeny Kliteynik 2 participants 2 messages Dec 6, 2009 – Dec 13, 2009 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 opensm SA DB dump/restore: load SA DB only once

Load SA DB only once, at first master heavy sweep. If loading succeeded, do whatever 'no_clients_rereg' option says. If loading failed at some point, turn off the 'no_clients_rereg' option (turn on re-registartion requests).

---

Changes since V2:
- No 'sa_db_load_once' option
- Combine 'no_clients_rereg' option meaning with loading SA DB result

 opensm/opensm/osm_sa.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
opensm/opensm/osm_sa.c +17 -2
index bf794f0..4cfd18c 100644
@@ -908,6 +908,12 @@ int osm_sa_db_file_load(osm_opensm_t * p_osm)
 		return 0;
 	}
 
+	if (!p_osm->subn.first_time_master_sweep) {
+		OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,
+			"Not first sweep - skip SA DB restore\n");
+		return 0;
+	}
+
 	file = fopen(file_name, "r");
 	if (!file) {
 		OSM_LOG(&p_osm->log, OSM_LOG_ERROR | OSM_LOG_SYS, "ERR 4C02: "
@@ -916,6 +922,10 @@ int osm_sa_db_file_load(osm_opensm_t * p_osm)
 		return -1;
 	}
 
+	OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,
+		"Restoring SA DB from file \'%s\'\n",
+		file_name);
+
 	lineno = 0;
 
 	while (fgets(line, sizeof(line) - 1, file) != NULL) {
@@ -1092,8 +1102,13 @@ int osm_sa_db_file_load(osm_opensm_t * p_osm)
 		}
 	}
 
-	if (!rereg_clients)
-		p_osm->subn.opt.no_clients_rereg = TRUE;
+	/*
+	 * If loading succeeded, do whatever 'no_clients_rereg' says.
+	 * If loading failed at some point, turn off the 'no_clients_rereg'
+	 * option (turn on re-registartion requests).
+	 */
+	if (rereg_clients)
+		p_osm->subn.opt.no_clients_rereg = FALSE;
 
 _error:
 	fclose(file);
Signature · 7 lines
1.5.1.4


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

A message that is not in the archive (sent off-list or not yet received): 4B1BC268.5030605-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#2 lore raw
Quoted 7 lines · Yevgeny Kliteynik

Load SA DB only once, at first master heavy sweep. If loading succeeded, do whatever 'no_clients_rereg' option says. If loading failed at some point, turn off the 'no_clients_rereg' option (turn on re-registartion requests).

Applied. Thanks.

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