From patchwork Mon Mar 18 15:40:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2293781 X-Patchwork-Delegate: hal@mellanox.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 6B4C03FCF6 for ; Mon, 18 Mar 2013 15:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753820Ab3CRPkg (ORCPT ); Mon, 18 Mar 2013 11:40:36 -0400 Received: from mail-ea0-f174.google.com ([209.85.215.174]:33999 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753831Ab3CRPkf (ORCPT ); Mon, 18 Mar 2013 11:40:35 -0400 Received: by mail-ea0-f174.google.com with SMTP id q10so2661035eaj.33 for ; Mon, 18 Mar 2013 08:40:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=q3T497nHY3HzCbROeomQzQU4Hy49VM6K01SeqL+lz2k=; b=gYqRYLTAYUHJmnR3E5KaNYGQOBIvgwk5jarXDat6ajjtIEcvhlITZ9CeS2jghtLodc ZlrFOC2m94VzerdxTWH5WPpV5Jh9sFl/Zw2A4MvNCW7OTxOCSodxRZramRrfW93n80Cz nqJmR5bVQIQsLvk40k0gV96sS3dpV41Elmn7GDFqMpvoRWHLhSsxvHXFYI24Q9eRItZN kXXxHpfRdnH9LJ9LGisGwmg+Rfd0Dbco14wvAyp8wijJk8I0drFktSArYDZcR7Zfhno+ JhZzBS7dbmW+TViW+pf65SQZBtN0zsAvIJeGnPSq/VPybqegjkKbUvLY5NLvrisz5VT6 etLw== X-Received: by 10.14.184.68 with SMTP id r44mr49757782eem.40.1363621222545; Mon, 18 Mar 2013 08:40:22 -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 ESMTPS id u44sm27851620eel.7.2013.03.18.08.40.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:40:21 -0700 (PDT) Message-ID: <51473562.8060805@dev.mellanox.co.il> Date: Mon, 18 Mar 2013 11:40:18 -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)" Subject: [PATCH] opensm/osm_port_info_rcv.c: Fix min_sw_data_vls calculation X-Gm-Message-State: ALoCoQkYIAL2KceqU/3cVTt1BrPxRw54iIqPzn58Xt8MiUUMfP2dW/5zp66zqh3vXWyyvMzULt8T Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Only update min_sw_data_vls when peer port is another switch port Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c index 84f9fb1..2ea35b8 100644 --- a/opensm/osm_port_info_rcv.c +++ b/opensm/osm_port_info_rcv.c @@ -327,16 +327,22 @@ static void pi_rcv_process_switch_port(IN osm_sm_t * sm, IN osm_node_t * p_node, if (ib_port_info_get_port_state(p_pi) == IB_LINK_DOWN) goto Exit; - 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; + p_remote_physp = osm_physp_get_remote(p_physp); + 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); + 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; + } + } } }