From patchwork Sun Dec 6 14:40:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 65160 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB6EWMLj006727 for ; Sun, 6 Dec 2009 14:32:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754925AbZLFOcM (ORCPT ); Sun, 6 Dec 2009 09:32:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754310AbZLFOcM (ORCPT ); Sun, 6 Dec 2009 09:32:12 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:50412 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753700AbZLFOcL (ORCPT ); Sun, 6 Dec 2009 09:32:11 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from kliteyn@dev.mellanox.co.il) with SMTP; 6 Dec 2009 16:40:59 +0200 Received: from [10.4.1.29] ([10.4.1.29]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Dec 2009 16:32:16 +0200 Message-ID: <4B1BC268.5030605@dev.mellanox.co.il> Date: Sun, 06 Dec 2009 16:40:40 +0200 From: Yevgeny Kliteynik Reply-To: kliteyn@dev.mellanox.co.il User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky CC: Linux RDMA Subject: [PATCH 1/2 v3] opensm SA DB dump/restore: load SA DB only once X-OriginalArrivalTime: 06 Dec 2009 14:32:16.0622 (UTC) FILETIME=[E8BF40E0:01CA7680] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17052.007 X-TM-AS-Result: No--10.750100-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c index bf794f0..4cfd18c 100644 --- a/opensm/opensm/osm_sa.c +++ b/opensm/opensm/osm_sa.c @@ -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);