From patchwork Tue Jun 18 11:03:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2740621 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 E99F4C0AB1 for ; Tue, 18 Jun 2013 11:03:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A97452020A for ; Tue, 18 Jun 2013 11:03:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB4DE2020C for ; Tue, 18 Jun 2013 11:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754090Ab3FRLDL (ORCPT ); Tue, 18 Jun 2013 07:03:11 -0400 Received: from mail-bk0-f52.google.com ([209.85.214.52]:46921 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753208Ab3FRLDK (ORCPT ); Tue, 18 Jun 2013 07:03:10 -0400 Received: by mail-bk0-f52.google.com with SMTP id d7so1695419bkh.11 for ; Tue, 18 Jun 2013 04:03:09 -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=FMlZlJFDvJRdE8qVxe5jYDr4hRWywtvxjdmsg6u0Umw=; b=Z1WJRCxmQ3gNSWwx5APf9sPNjSwaA6s5woqUMwib7uheQYDH9/kU5OxZvRqMGXENZe cxVokYoV2w6p9SwKKIAvkVnT0pqdunTVrgKlV6adxf9moVq4F5YhtSnSqG9aEFBEGVyw 6K7/m+oaT2Xh1zpS+NHyUPmx1onCJrbmrJI96WheWVnyan34wTeQOnX+njIwsEIlpfIF 6ZXBU/I6Kjz5P+3MPMefjwTOzDL34hTYBm0Lb7s96+sRq1+oQAcVAdIV96KJYg1EJAla mZrbZX9xdS0n/sHI87OYbqXCeYqdsudQy9j4y7Rb+w+wJW2cBY/VqWtllfnV0xiVZTy2 4ONw== X-Received: by 10.205.4.6 with SMTP id oa6mr2505754bkb.1.1371553388703; Tue, 18 Jun 2013 04:03:08 -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 v7sm5330204bkh.12.2013.06.18.04.03.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Jun 2013 04:03:08 -0700 (PDT) Message-ID: <51C03E6A.1030808@dev.mellanox.co.il> Date: Tue, 18 Jun 2013 07:03:06 -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: Vladimir Koushnir Subject: [PATCH opensm] ftree: Allow defining only io_guids file and consider rest of nodes as CN nodes X-Gm-Message-State: ALoCoQlCcUu2/Vm5WZ1KkQNpwIpWqMNfrIUKnAsGyl1DaRlhoqu82OVTTi7GpcQwF15kAFgOwQV0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.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 2068a60399865590aff094738e3350f972c6e9b4 Mon Sep 17 00:00:00 2001 From: Vladimir Koushnir Date: Sun, 9 Jun 2013 18:05:01 +0300 Subject: [PATCH] ftree: Allow defining only io_guids file and consider rest of nodes as CN nodes In the current implementation cn_guids and io_guids files should be provided in order to separate between Compute Nodes and IO Nodes for ftree routing. This approach is not optimal when there are several IO Nodes the fabric compared to thousands of CNs. Provided patch considers all nodes to be Compute nodes by default. If some guid is presenting in io_guids file and not presenting in cn_guid file the corresponding node will be considered as IO node. Signed-off-by: Vladimir Koushnir --- opensm/osm_subnet.c | 7 ++++- opensm/osm_ucast_ftree.c | 53 +++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c index bc05ae0..5e06d83 100644 --- a/opensm/osm_subnet.c +++ b/opensm/osm_subnet.c @@ -2879,11 +2879,14 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t * p_opts) fprintf(out, "# The file holding the fat-tree I/O node guids\n" - "# One guid in each line\nio_guid_file %s\n\n", + "# One guid in each line.\n" + "# If only io_guid file is provided, the rest of nodes\n" + "# are considered as compute nodes.\n" + "io_guid_file %s\n\n", p_opts->io_guid_file ? p_opts->io_guid_file : null_str); fprintf(out, - "# Number of reverse hops allowed for I/O nodes \n" + "# Number of reverse hops allowed for I/O nodes\n" "# Used for connectivity between I/O nodes connected to Top Switches\nmax_reverse_hops %d\n\n", p_opts->max_reverse_hops); diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c index 58e51d4..a069edb 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -3268,8 +3268,11 @@ fabric_construct_hca_ports(IN ftree_fabric_t * p_ftree, IN ftree_hca_t * p_hca) osm_physp_t *p_remote_osm_port; uint8_t i; uint8_t remote_port_num; - boolean_t is_cn = FALSE; + boolean_t is_cn = TRUE; + boolean_t is_in_cn_file = FALSE; boolean_t is_io = FALSE; + boolean_t is_cns_file_provided = fabric_cns_provided(p_ftree); + boolean_t is_ios_file_provided = fabric_ios_provided(p_ftree); int res = 0; for (i = 0; i < osm_node_get_num_physp(p_node); i++) { @@ -3325,16 +3328,27 @@ fabric_construct_hca_ports(IN ftree_fabric_t * p_ftree, IN ftree_hca_t * p_hca) /* If CN file is not supplied, then all the CAs considered as Compute Nodes. Otherwise all the CAs are not CNs, and only guids that are present in the CN file will be marked as compute nodes. */ - if (!fabric_cns_provided(p_ftree)) { - is_cn = TRUE; - } else { + if (is_cns_file_provided == TRUE) { name_map_item_t *p_elem = (name_map_item_t *) - cl_qmap_get(&p_ftree->cn_guid_tbl, - cl_ntoh64(osm_physp_get_port_guid - (p_osm_port))); + cl_qmap_get(&p_ftree->cn_guid_tbl, + cl_ntoh64(osm_physp_get_port_guid + (p_osm_port))); + if (p_elem == (name_map_item_t *) + cl_qmap_end(&p_ftree->cn_guid_tbl)) + is_cn = FALSE; + else + is_in_cn_file = TRUE; + } + if (is_in_cn_file == FALSE && is_ios_file_provided == TRUE) { + name_map_item_t *p_elem = (name_map_item_t *) + cl_qmap_get(&p_ftree->io_guid_tbl, + cl_ntoh64(osm_physp_get_port_guid + (p_osm_port))); if (p_elem != (name_map_item_t *) - cl_qmap_end(&p_ftree->cn_guid_tbl)) - is_cn = TRUE; + cl_qmap_end(&p_ftree->io_guid_tbl)) { + is_io = TRUE; + is_cn = FALSE; + } } if (is_cn) { @@ -3343,32 +3357,19 @@ fabric_construct_hca_ports(IN ftree_fabric_t * p_ftree, IN ftree_hca_t * p_hca) OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_DEBUG, "Marking CN port GUID 0x%016" PRIx64 "\n", cl_ntoh64(osm_physp_get_port_guid(p_osm_port))); - } else { - if (fabric_ios_provided(p_ftree)) { - name_map_item_t *p_elem = (name_map_item_t *) - cl_qmap_get(&p_ftree->io_guid_tbl, - cl_ntoh64 - (osm_physp_get_port_guid - (p_osm_port))); - if (p_elem != (name_map_item_t *) - cl_qmap_end(&p_ftree->io_guid_tbl)) - is_io = TRUE; - } - - if (is_io) { + } else if (is_io) { OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_DEBUG, "Marking I/O port GUID 0x%016" PRIx64 "\n", cl_ntoh64(osm_physp_get_port_guid - (p_osm_port))); + (p_osm_port))); - } else { + } else { OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_DEBUG, "Marking non-CN port GUID 0x%016" PRIx64 "\n", cl_ntoh64(osm_physp_get_port_guid - (p_osm_port))); - } + (p_osm_port))); } p_ftree->ca_ports++;