From patchwork Wed May 7 13:25:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 4128191 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5CC2D9F334 for ; Wed, 7 May 2014 13:25:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88B8D201F9 for ; Wed, 7 May 2014 13:25:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 425852024F for ; Wed, 7 May 2014 13:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933296AbaEGNZM (ORCPT ); Wed, 7 May 2014 09:25:12 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:39433 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933211AbaEGNZK (ORCPT ); Wed, 7 May 2014 09:25:10 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi2so4929676wib.5 for ; Wed, 07 May 2014 06:25:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=JLtb5bXBHQ9cXCwe8EP+6x/WC2I6Q//EuTmOB4IF6zY=; b=OhnopXn2LeZef0tYPYnVTnQARk0SyYT9LvI3rwtAYYEVRXJZfMRZyk7milKCrFUDHj MvGXw3sPZ6HIQ4FQfkgEehsY6wyyd0dq0KRPqiNr3equvmbYOLzsLUHaetY8E+cjNGjn 3l0O0EALYneUochh6wb4iPcyoamIypxE3v3PJ5uJVEM/RIWHBgmpkTtN7W6SNLk2Qp6p EuQ2QqkV4FFQCUZfZzXi/hVJepgJ97JKM3kOZndIvLTLc27Y1pk3c9ACd/zfBy1CWTQA i5adv6REk9twBOPZypKdFdpcS/l0JvaZXnbMx3TQDfnThbNF8Dgl12fJxKMXg1FU96G9 Xqfw== X-Gm-Message-State: ALoCoQnG6LLP7vhKDyJfRfOgQFWJRGj1wXD1xdfMxDZ9rG6XPOMdQiCd3nSRT4upYYmngAcZrvhy X-Received: by 10.180.96.39 with SMTP id dp7mr26416937wib.12.1399469108237; Wed, 07 May 2014 06:25:08 -0700 (PDT) Received: from [10.222.163.14] (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id s2sm31632810wia.7.2014.05.07.06.25.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 06:25:07 -0700 (PDT) Message-ID: <536A3430.5060605@dev.mellanox.co.il> Date: Wed, 07 May 2014 09:25:04 -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: Tomer Cohen Subject: [PATCH opensm] osm_port_info_rcv.c: Fixed calculation of min_data_vls 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.5 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: Tomer Cohen Date: Sun, 13 Apr 2014 15:26:47 +0300 Bug description: opensm is not using future value of op_vls when calculating subnet's minimal op_vl. opensm calculates minimal op_vls (sm->p_subn->min_data_vl) when receiving pi mads, and the linkmgr might update that port's op_vls according to it's vl_cap. as a result, routing engines that depends on the minimal op_vls (such as torus) might fail on the first heavy sweep. for example, if in the fabric there is a port with op_vls = 1. vl_cap = 5, peer port vl_cap = 5. tours routing engine would fail on first sweep. Fix: now the calculation is done respective to vl_cap and max_op_vls Signed-off-by: Tomer Cohen Signed-off-by: Hal Rosenstock --- opensm/osm_port_info_rcv.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c index eb68dbf..9707496 100644 --- a/opensm/osm_port_info_rcv.c +++ b/opensm/osm_port_info_rcv.c @@ -115,7 +115,9 @@ static void pi_rcv_process_endport(IN osm_sm_t * sm, IN osm_physp_t * p_physp, sm->p_subn->min_ca_rate = rate; } - data_vls = 1U << (ib_port_info_get_op_vls(p_pi) - 1); + data_vls = 1U << (ib_port_info_get_vl_cap(p_pi) - 1); + if (data_vls > sm->p_subn->opt.max_op_vls) + data_vls = sm->p_subn->opt.max_op_vls; if (data_vls >= IB_MAX_NUM_VLS) data_vls = IB_MAX_NUM_VLS - 1; if ((uint8_t)data_vls < sm->p_subn->min_data_vls) { @@ -416,7 +418,9 @@ static void pi_rcv_process_switch_ext_port(IN osm_sm_t * sm, if (p_remote_physp) { p_remote_node = osm_physp_get_node_ptr(p_remote_physp); if (p_remote_node->sw) { - data_vls = 1U << (ib_port_info_get_op_vls(p_pi) - 1); + data_vls = 1U << (ib_port_info_get_vl_cap(p_pi) - 1); + if (data_vls > sm->p_subn->opt.max_op_vls) + data_vls = sm->p_subn->opt.max_op_vls; 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) {