From patchwork Tue Jun 11 18:13:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2705421 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9BCB2C1459 for ; Tue, 11 Jun 2013 18:14:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71BE6203DA for ; Tue, 11 Jun 2013 18:14:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B8C6202F1 for ; Tue, 11 Jun 2013 18:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755700Ab3FKSOD (ORCPT ); Tue, 11 Jun 2013 14:14:03 -0400 Received: from mail-ee0-f43.google.com ([74.125.83.43]:57324 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755851Ab3FKSOC (ORCPT ); Tue, 11 Jun 2013 14:14:02 -0400 Received: by mail-ee0-f43.google.com with SMTP id l10so3207602eei.16 for ; Tue, 11 Jun 2013 11:14:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=AM0Ss3mG/Nki1B89pkAu/wWYzFFsdiS9SpNgnYS5h5o=; b=ew4Ji5S0Ydw79S4LJJziM0WTH+/WVa8s6KNP8TEtarCzz2JuJ2OKcWbo4V2DFFHEEe xTvUyNGTv20AbzkdbfIja0VaWrTz7T+PlnPld6b5c8b9vVX+akgdHC1SSaucHxjdR9bV dGFvtUVcAosc9S1BK2UNb3NskTHhxsQ/sEYd3mit4Zdmu++9If+g8tWjvrJl26XfEP9n ozHWs7egFJgoYTPrEVI0hSCuFsu07g9KcF9Q05FK+JzTb3DjWw8vV7b/OZGgAQGnmFhg JYjWizsO+B8ZIgRLKv24aXlAHsZsUmVmALbAJJOA4ICMeBk3DuVTeA3JaKHiZpgtxgsp LUHg== X-Received: by 10.14.5.201 with SMTP id 49mr17932785eel.57.1370974441063; Tue, 11 Jun 2013 11:14:01 -0700 (PDT) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPSA id a5sm31989124ees.6.2013.06.11.11.13.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 11:14:00 -0700 (PDT) Message-ID: <51B768E7.2020706@dev.mellanox.co.il> Date: Tue, 11 Jun 2013 14:13:59 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Alex Netes Subject: [PATCH 6/6] When SM fails to load/parse root_guids file use MinHop heuristics X-Gm-Message-State: ALoCoQmjQ5jbW3ZOVO+0kJB5uZFZIO37EwpcX1xGCKAdMXb852Gie0AkAwibwwBvVeald8VrRIk1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 21765ade61c96c319d157293e57e10f2f0e07846 Mon Sep 17 00:00:00 2001 From: Alex Netes Date: Sun, 28 Apr 2013 10:06:00 +0300 Subject: [PATCH 6/6] When SM fails to load/parse root_guids file use MinHop heuristics Signed-off-by: Alex Netes --- opensm/osm_subnet.c | 11 ----------- opensm/osm_ucast_ftree.c | 8 +++++--- opensm/osm_ucast_updn.c | 8 +++++--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c index bd68957..0c199c5 100644 --- a/opensm/osm_subnet.c +++ b/opensm/osm_subnet.c @@ -2048,17 +2048,6 @@ int osm_subn_verify_config(IN osm_subn_opt_t * p_opts) } } - if (p_opts->root_guid_file != NULL) { - FILE *root_file = fopen(p_opts->root_guid_file, "r"); - if (!root_file) { - log_report("Root guid file provided: %s doesn't exist.\n" - "Using default roots discovery algorithm\n", - p_opts->root_guid_file); - p_opts->root_guid_file = NULL; - } else - fclose(root_file); - } - return 0; } diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c index 9b47c74..bd2817b 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -3558,6 +3558,9 @@ static boolean_t fabric_load_roots(IN ftree_fabric_t * p_ftree, context.list = p_ranking_bfs_list; if (parse_node_map(p_ftree->p_osm->subn.opt.root_guid_file, rank_root_sw_by_guid, &context)) { + OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR, "ERR AB2A: " + "cannot parse root guids file \'%s\'\n", + p_ftree->p_osm->subn.opt.root_guid_file); return FALSE; } @@ -3722,10 +3725,9 @@ static int fabric_rank(IN ftree_fabric_t * p_ftree) OSM_LOG_ENTER(&p_ftree->p_osm->log); - if (fabric_roots_provided(p_ftree)){ - if (fabric_load_roots(p_ftree, &ranking_bfs_list)) + if (fabric_roots_provided(p_ftree) && + fabric_load_roots(p_ftree, &ranking_bfs_list)) res = fabric_rank_from_roots(p_ftree, &ranking_bfs_list); - } else { res = fabric_rank_from_hcas(p_ftree); if (!res) diff --git a/opensm/osm_ucast_updn.c b/opensm/osm_ucast_updn.c index f3ca4dc..2da17de 100644 --- a/opensm/osm_ucast_updn.c +++ b/opensm/osm_ucast_updn.c @@ -594,12 +594,14 @@ static int updn_lid_matrices(void *ctx) ret = parse_node_map(p_updn->p_osm->subn.opt.root_guid_file, rank_root_node, p_updn); - if (ret) + if (ret) { OSM_LOG(&p_updn->p_osm->log, OSM_LOG_ERROR, "ERR AA02: " "cannot parse root guids file \'%s\'\n", p_updn->p_osm->subn.opt.root_guid_file); - if (p_updn->p_osm->subn.opt.connect_roots && - p_updn->num_roots > 1) + osm_ucast_mgr_build_lid_matrices(&p_updn->p_osm->sm.ucast_mgr); + updn_find_root_nodes_by_min_hop(p_updn); + } else if (p_updn->p_osm->subn.opt.connect_roots && + p_updn->num_roots > 1) osm_ucast_mgr_build_lid_matrices(&p_updn->p_osm->sm.ucast_mgr); } else { osm_ucast_mgr_build_lid_matrices(&p_updn->p_osm->sm.ucast_mgr);