From patchwork Sun Jul 7 20:56:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 2824640 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 50B609F9CA for ; Sun, 7 Jul 2013 20:56:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B09AB2012F for ; Sun, 7 Jul 2013 20:56:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6E3E20122 for ; Sun, 7 Jul 2013 20:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161Ab3GGU4K (ORCPT ); Sun, 7 Jul 2013 16:56:10 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:48479 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753136Ab3GGU4K (ORCPT ); Sun, 7 Jul 2013 16:56:10 -0400 Received: by mail-ee0-f42.google.com with SMTP id c4so2397418eek.15 for ; Sun, 07 Jul 2013 13:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=dujKDMYZL47YBn9NfdccQrK5CfxEIrmvW34CpqmoKbI=; b=cflqmOlF4/WIQ7sO6UOAHmhUhu+LAzMjahvaIThAbyjMHTvzPxqx5eIQpoSWaR9uHC Zb8RMKUkN4mU+MGUKRJ83Tv/UmdxP+4S9anBZsjbsdg+7UewsWpeDq7avs+s0WwIbh7q /35mUrtdspltsN5ONpdYG/RET4UnXihdao5bI+T3FZiXf1NVDNInSvTVVQa1f8LNN/QO IyimpilMRHZhMefiVgNkKXtrPKNuR4H23/6RANMQ3mpKaTvocnjcCpTH7CMsiPF8zKbU fM/25elc4zuZvn4OJ20nKt69rpn1ZyvxM47WgeBXSMIK9suSbkemIQDWcei/45EQWMcC 7hlA== X-Received: by 10.15.21.199 with SMTP id d47mr21531075eeu.36.1373230567907; Sun, 07 Jul 2013 13:56:07 -0700 (PDT) Received: from gmail.com (85.64.252.114.dynamic.barak-online.net. [85.64.252.114]) by mx.google.com with ESMTPSA id b3sm36322057eev.10.2013.07.07.13.56.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 07 Jul 2013 13:56:07 -0700 (PDT) Date: Sun, 7 Jul 2013 23:56:03 +0300 From: Sasha Khapyorsky To: Hal Rosenstock Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm: update internal PortInfo state for any ports Message-ID: <20130707205219.GA6084@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Should not be matter to keep internal SM's PortInfo data for ports in any states. Signed-off-by: Sasha Khapyorsky --- 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.c b/opensm/osm_port.c index 6e73e66..d59d404 100644 --- a/opensm/osm_port.c +++ b/opensm/osm_port.c @@ -669,25 +669,16 @@ void osm_physp_set_port_info(IN osm_physp_t * p_physp, CL_ASSERT(p_pi); CL_ASSERT(osm_physp_is_valid(p_physp)); - if (ib_port_info_get_port_state(p_pi) == IB_LINK_DOWN) { - /* If PortState is down, only copy PortState */ - /* and PortPhysicalState per C14-24-2.1 */ - ib_port_info_set_port_state(&p_physp->port_info, IB_LINK_DOWN); - ib_port_info_set_port_phys_state - (ib_port_info_get_port_phys_state(p_pi), - &p_physp->port_info); - } else { - p_physp->port_info = *p_pi; - - /* The MKey in p_pi can only be considered valid if it's - * for a HCA/router or switch port 0, and it's either - * non-zero or the MKeyProtect bits are also zero. - */ - if ((osm_node_get_type(p_physp->p_node) != - IB_NODE_TYPE_SWITCH || p_physp->port_num == 0) && - (p_pi->m_key != 0 || ib_port_info_get_mpb(p_pi) == 0)) - osm_db_guid2mkey_set(p_sm->p_subn->p_g2m, - cl_ntoh64(p_physp->port_guid), - cl_ntoh64(p_pi->m_key)); - } + p_physp->port_info = *p_pi; + + /* The MKey in p_pi can only be considered valid if it's + * for a HCA/router or switch port 0, and it's either + * non-zero or the MKeyProtect bits are also zero. + */ + if ((osm_node_get_type(p_physp->p_node) != IB_NODE_TYPE_SWITCH || + p_physp->port_num == 0) && + (p_pi->m_key != 0 || ib_port_info_get_mpb(p_pi) == 0)) + osm_db_guid2mkey_set(p_sm->p_subn->p_g2m, + cl_ntoh64(p_physp->port_guid), + cl_ntoh64(p_pi->m_key)); }