From patchwork Mon Jul 22 15:54:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 2831438 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 2A0C09F9CC for ; Mon, 22 Jul 2013 15:55:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 043D9201F4 for ; Mon, 22 Jul 2013 15:55:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB655201EC for ; Mon, 22 Jul 2013 15:55:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757059Ab3GVPzI (ORCPT ); Mon, 22 Jul 2013 11:55:08 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:61616 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756343Ab3GVPzF (ORCPT ); Mon, 22 Jul 2013 11:55:05 -0400 Received: by mail-wi0-f178.google.com with SMTP id k10so2078113wiv.5 for ; Mon, 22 Jul 2013 08:55:04 -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=MIXnxag3PIsV9oFYot9g3OvXdF7h48CJDHojBDwPuq8=; b=Xjx4/D58all499x2TfzzdK9FcvlHYtOgG2cinRZw7zNNTe0pw5NtCIaS7jmc1SXVXq 3wUvaxAmPPxzpZuIkq74Yrx7+5mVThNl94X58axhbR+NPIE3ybN5Xkh2RB4Xh3e4gWQB O3g7cOaUGnUCkEwefHMelh5fNQanYVuAcp1TktLwI0SdNEXc8fiYF+Zw0YB5+1buvrqR WY21iOaWJ8LEO+pLAVSJaoTX8KXXU09QCcW23FoxSfSZqsKdW3HGFldrJqFya/OeE6xv +hG6+3F4XGwtoMwPOv3KyLmhxQZGchmzliGGtGW6EuXfYBn3cHWLFy6xTBasI6p3Q4+j 2SIA== X-Received: by 10.180.106.72 with SMTP id gs8mr30281541wib.51.1374508504539; Mon, 22 Jul 2013 08:55:04 -0700 (PDT) Received: from gmail.com ([2.54.251.234]) by mx.google.com with ESMTPSA id a6sm41580396wib.10.2013.07.22.08.55.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Jul 2013 08:55:03 -0700 (PDT) Date: Mon, 22 Jul 2013 18:54:59 +0300 From: Sasha Khapyorsky To: halr@gmail.com Cc: linux-rdma@vger.kernel.org, Alex Netes , Roy.Koren@emc.com Subject: [PATCH 1/3] opensm: update internal PortInfo state for any ports Message-ID: <20130722155457.GB23909@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=-8.2 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=unavailable 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 --- opensm/osm_port.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) 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)); }