From patchwork Tue Jun 11 18:13:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2705371 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 E5305C1459 for ; Tue, 11 Jun 2013 18:13:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C05520357 for ; Tue, 11 Jun 2013 18:13:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52E6C203AF for ; Tue, 11 Jun 2013 18:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755263Ab3FKSNa (ORCPT ); Tue, 11 Jun 2013 14:13:30 -0400 Received: from mail-ea0-f173.google.com ([209.85.215.173]:35553 "EHLO mail-ea0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755254Ab3FKSN3 (ORCPT ); Tue, 11 Jun 2013 14:13:29 -0400 Received: by mail-ea0-f173.google.com with SMTP id g15so6275952eak.32 for ; Tue, 11 Jun 2013 11:13:28 -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=OxlWK3JRREC3U420aof07z+rRv9ORdQU+U96dvuVu+k=; b=M4uby1jCvDApCxzNZibJDEa3UtJ9/8CdB6aEwkn3IGSmUBEzf6dU29sxZkgz+bO889 o5NiEMPuGyryLHz9NixqmECVfB82Kkbv78v5agNvZ3on2+E5DHkRP0BSX/F9oiITQkb2 A/W6BGAtsixsx+sV8kEcVEHUOy8wQZZWw1wHNBZXn4efmYEy2ORZjqFTjwLSQWJ7DgIQ 1i/cCmef8KpKgiJQzvNnKTibS04I8KpOS615pELSNuUEqmrT7ieWOF7WxEZZu/c47dDP 0zXbFJl3j/p2sQ3Ih3cDZhG48wTYMvxX5pS8NwpgBMg/woAdNZmanrWUgU3DxzqCA0sw xddw== X-Received: by 10.14.127.73 with SMTP id c49mr17895434eei.101.1370974408381; Tue, 11 Jun 2013 11:13:28 -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 u7sm31923573eef.14.2013.06.11.11.13.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 11:13:27 -0700 (PDT) Message-ID: <51B768C5.6080301@dev.mellanox.co.il> Date: Tue, 11 Jun 2013 14:13:25 -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 1/6] Fix fat-tree routing for CAs with more than 1 connected port X-Gm-Message-State: ALoCoQkfysIu8tuioBrZuLjdP/M/soAOjXite7XyTLP5TAbNeJ0CV7jrgSIxp51+zI/LAONi/tF3 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=ham 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 269512894d0bbb814707bf0aae56e832228f32f9 Mon Sep 17 00:00:00 2001 From: Vladimir Koushnir Date: Sun, 29 Apr 2012 12:25:41 +0300 Subject: [PATCH 1/6] Fix fat-tree routing for CAs with more than 1 connected port Signed-off-by: Vladimir Koushnir Signed-off-by: Alex Netes --- opensm/osm_ucast_ftree.c | 30 ++++++++++++++++++++++++------ 1 files changed, 24 insertions(+), 6 deletions(-) diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c index 864e161..fecc902 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -886,9 +886,24 @@ static ftree_port_group_t *hca_get_port_group_by_remote_lid(IN ftree_hca_t * return NULL; } +static ftree_port_group_t *hca_get_port_group_by_lid(IN ftree_hca_t * + p_hca, + IN uint16_t + base_lid) +{ + uint32_t i; + for (i = 0; i < p_hca->up_port_groups_num; i++) + if (base_lid == + p_hca->up_port_groups[i]->base_lid) + return p_hca->up_port_groups[i]; + + return NULL; + +} /***************************************************/ -static void hca_add_port(IN ftree_hca_t * p_hca, IN uint8_t port_num, +static void hca_add_port(IN ftree_fabric_t * p_ftree, + IN ftree_hca_t * p_hca, IN uint8_t port_num, IN uint8_t remote_port_num, IN uint16_t base_lid, IN uint16_t remote_base_lid, IN ib_net64_t port_guid, IN ib_net64_t remote_port_guid, @@ -903,7 +918,7 @@ static void hca_add_port(IN ftree_hca_t * p_hca, IN uint8_t port_num, in hca's that lead to switches */ CL_ASSERT(remote_node_type == IB_NODE_TYPE_SWITCH); - p_group = hca_get_port_group_by_remote_lid(p_hca, remote_base_lid); + p_group = hca_get_port_group_by_lid(p_hca, base_lid); if (!p_group) { p_group = port_group_create(base_lid, remote_base_lid, @@ -914,9 +929,11 @@ static void hca_add_port(IN ftree_hca_t * p_hca, IN uint8_t port_num, p_remote_hca_or_sw, is_cn, is_io); CL_ASSERT(p_group); p_hca->up_port_groups[p_hca->up_port_groups_num++] = p_group; - } - port_group_add_port(p_group, port_num, remote_port_num); - + port_group_add_port(p_group, port_num, remote_port_num); + } else + OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR, + "ERR AB32: Duplicated LID for CA GUID: 0x%016" PRIx64 "\n", + cl_ntoh64(port_guid)); } /* hca_add_port() */ /*************************************************** @@ -3379,7 +3396,8 @@ fabric_construct_hca_ports(IN ftree_fabric_t * p_ftree, IN ftree_hca_t * p_hca) } p_ftree->ca_ports++; - hca_add_port(p_hca, /* local ftree_hca object */ + hca_add_port(p_ftree, + p_hca, /* local ftree_hca object */ i, /* local port number */ remote_port_num, /* remote port number */ cl_ntoh16(osm_node_get_base_lid(p_node, i)), /* local lid */