From patchwork Wed Oct 10 23:40:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1577411 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EEC5A40135 for ; Wed, 10 Oct 2012 23:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757473Ab2JJXkN (ORCPT ); Wed, 10 Oct 2012 19:40:13 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:45752 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756850Ab2JJXkM (ORCPT ); Wed, 10 Oct 2012 19:40:12 -0400 Received: by mail-qa0-f53.google.com with SMTP id s11so1000692qaa.19 for ; Wed, 10 Oct 2012 16:40:12 -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=8WHgh4ZPFjP5ma4nr8EGaiTJr9XulmgfzXRkzpFE2CI=; b=ccmzEsOhZRSzmyWRmR37IcS8SwPmz456+rVL0lTQoOSHAwsn7LZktLclPrCWncOv30 F9nAt08YwbGK5tqcPEE4Md2nReTyhAhzuKBrlo08d/vtqsbJEB5JzFxrfjJkF0YJgxzx VWoXUZJIzPAoiQTssk5OUmVUNlF89ym+JXwC6RSOxQCLNMQ5KdbZwC7AhneBKwVB9Hmo UPkmGsoOyDoEtV+I+U53x2/vzVWVDE5VzhIAU71NkRsudj+rJ/7Izt/naxM/rrz/6Eql uCVatTlWSHOKjthIGSCFhzMy3vQp8i9uV9yfHoK9phMrkBUOIHzJRbwg2mT/9r7ox2KV CQ+w== Received: by 10.49.104.129 with SMTP id ge1mr5833890qeb.62.1349912411985; Wed, 10 Oct 2012 16:40:11 -0700 (PDT) Received: from [192.168.1.103] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id g13sm2979263qaj.19.2012.10.10.16.40.10 (version=SSLv3 cipher=OTHER); Wed, 10 Oct 2012 16:40:11 -0700 (PDT) Message-ID: <50760759.7080406@dev.mellanox.co.il> Date: Wed, 10 Oct 2012 19:40:09 -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: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" , Jim Schutt Subject: [PATCH 1/2] opensm: Track minimum value in the fabric for data VLs supported on switch external ports X-Gm-Message-State: ALoCoQm6tfb5jb2QsKiRFZ4I0asCwfjMAYdxCgw0O/y9ToHI3aR996eKjdzDSPDqGEH3HJFlXT7H Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Hal Rosenstock Reviewed-by: Jim Schutt --- include/opensm/osm_subnet.h | 1 + opensm/osm_port_info_rcv.c | 13 +++++++++++++ opensm/osm_state_mgr.c | 1 + opensm/osm_subnet.c | 1 + 4 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h index 86aba47..566145b 100644 --- a/include/opensm/osm_subnet.h +++ b/include/opensm/osm_subnet.h @@ -747,6 +747,7 @@ typedef struct osm_subn { uint8_t min_ca_mtu; uint8_t min_ca_rate; uint8_t min_data_vls; + uint8_t min_sw_data_vls; boolean_t ignore_existing_lfts; boolean_t subnet_initialization_error; boolean_t force_heavy_sweep; diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c index c3bc66c..d5b6aac 100644 --- a/opensm/osm_port_info_rcv.c +++ b/opensm/osm_port_info_rcv.c @@ -193,6 +193,7 @@ static void pi_rcv_process_switch_port(IN osm_sm_t * sm, IN osm_node_t * p_node, osm_madw_context_t context; osm_physp_t *p_remote_physp; osm_node_t *p_remote_node; + unsigned data_vls; uint8_t port_num; uint8_t remote_port_num; osm_dr_path_t path; @@ -321,6 +322,18 @@ static void pi_rcv_process_switch_port(IN osm_sm_t * sm, IN osm_node_t * p_node, /* PortState is not used on BSP0 but just in case it is DOWN */ p_physp->port_info = *p_pi; pi_rcv_process_endport(sm, p_physp, p_pi); + } else { + data_vls = 1U << (ib_port_info_get_op_vls(p_pi) - 1); + if (data_vls >= IB_MAX_NUM_VLS) + data_vls = IB_MAX_NUM_VLS - 1; + if ((uint8_t)data_vls < sm->p_subn->min_sw_data_vls) { + OSM_LOG(sm->p_log, OSM_LOG_VERBOSE, + "Setting switch port minimal data VLs to:%u defined by node:0x%" + PRIx64 ", port:%u\n", data_vls, + cl_ntoh64(osm_node_get_node_guid(p_node)), + port_num); + sm->p_subn->min_sw_data_vls = data_vls; + } } OSM_LOG_EXIT(sm->p_log); diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index bc61136..7abbc91 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -1209,6 +1209,7 @@ repeat_discovery: sm->p_subn->min_ca_mtu = IB_MAX_MTU; sm->p_subn->min_ca_rate = IB_MAX_RATE; sm->p_subn->min_data_vls = IB_MAX_NUM_VLS - 1; + sm->p_subn->min_sw_data_vls = IB_MAX_NUM_VLS - 1; /* rescan configuration updates */ if (!config_parsed && osm_subn_rescan_conf_files(sm->p_subn) < 0) diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c index 9f05e8a..44d5b1a 100644 --- a/opensm/osm_subnet.c +++ b/opensm/osm_subnet.c @@ -1199,6 +1199,7 @@ ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn, IN osm_opensm_t * p_osm, p_subn->min_ca_mtu = IB_MAX_MTU; p_subn->min_ca_rate = IB_MAX_RATE; p_subn->min_data_vls = IB_MAX_NUM_VLS - 1; + p_subn->min_sw_data_vls = IB_MAX_NUM_VLS - 1; p_subn->ignore_existing_lfts = TRUE; /* we assume master by default - so we only need to set it true if STANDBY */