From patchwork Mon Dec 3 21:26:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1835471 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 42D35DFF39 for ; Mon, 3 Dec 2012 21:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627Ab2LCV0P (ORCPT ); Mon, 3 Dec 2012 16:26:15 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:39412 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211Ab2LCV0M (ORCPT ); Mon, 3 Dec 2012 16:26:12 -0500 Received: by mail-ea0-f174.google.com with SMTP id e13so1330223eaa.19 for ; Mon, 03 Dec 2012 13:26:11 -0800 (PST) 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=RyF6CNrC5gSgJ6SUkQIhqWY2q1CboELKf7Y+l0NTn1E=; b=OzxMlJvZ6KCRUUUGmbnO6drXl3aycjTH+7GquTDwNKO75zk8ZF0JIPtlt4gAsaED6t pI/pAZOS+kloQEfS9BwOxM5rdmtKW9H+A3fDZVWzeccynBx5Rzfep60dcrdVtZfpTHm/ LqOWgtfEz8iQUffQX4WCGRRxwJIcitMFaIZfw98Y+vs7qJEj3vPXYl73uqLBbehYxiK8 W2XvOgzP7yHU8YiSsQSjoWyBDiCUDGt5o6JiajPH2riwuRektEuEmsvuOU1+lxVskzkO DiFR3T/W9sEBQf4sdQuG+ANADcGENoGxNIFoKkINY9itNiF+AtNAgqR+46FtBKoqM6p3 cFIg== Received: by 10.14.221.9 with SMTP id q9mr40965299eep.3.1354569971017; Mon, 03 Dec 2012 13:26:11 -0800 (PST) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id w3sm33651323eel.17.2012.12.03.13.26.09 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 13:26:10 -0800 (PST) Message-ID: <50BD18F0.4030900@dev.mellanox.co.il> Date: Mon, 03 Dec 2012 16:26:08 -0500 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)" Subject: [PATCH] opensm/osm_port_info_rcv.c: Don't modify subnet minimal values when PortState DOWN X-Gm-Message-State: ALoCoQk7D0heq9bIRQYrRPeZg3bePb/LX+I89GvVKnKST1GP3vgHazFffD8J2hQMQncMesbI2G5J Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org as they are vendor dependent fields in PortInfo and can't be relied on due to: C14-24.2.1: If PortInfo:Portstate=Down, then o a SubnGet(PortInfo) shall produce valid data for PortInfo:PortState and PortInfo:PortPhysicalState; whether any other component has valid data is vendor-dependent. 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 6f6922c..859a6be 100644 --- a/opensm/osm_port_info_rcv.c +++ b/opensm/osm_port_info_rcv.c @@ -94,7 +94,8 @@ static void pi_rcv_process_endport(IN osm_sm_t * sm, IN osm_physp_t * p_physp, port_guid = osm_physp_get_port_guid(p_physp); /* HACK extended port 0 should be handled too! */ - if (osm_physp_get_port_num(p_physp) != 0) { + if (osm_physp_get_port_num(p_physp) != 0 && + ib_port_info_get_port_state(p_pi) != IB_LINK_DOWN) { /* track the minimal endport MTU, rate, and operational VLs */ mtu = ib_port_info_get_mtu_cap(p_pi); if (mtu < sm->p_subn->min_ca_mtu) { @@ -323,6 +324,9 @@ static void pi_rcv_process_switch_port(IN osm_sm_t * sm, IN osm_node_t * p_node, p_physp->port_info = *p_pi; pi_rcv_process_endport(sm, p_physp, p_pi); } else { + if (ib_port_info_get_port_state(p_pi) == IB_LINK_DOWN) + goto Exit; + /* track the minimal switch ext port MTU, rate, and operational VLs */ mtu = ib_port_info_get_mtu_cap(p_pi); if (mtu < sm->p_subn->min_sw_mtu) { @@ -358,6 +362,7 @@ static void pi_rcv_process_switch_port(IN osm_sm_t * sm, IN osm_node_t * p_node, } } +Exit: OSM_LOG_EXIT(sm->p_log); }