From patchwork Tue Jul 31 16:04:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 1260821 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 55234DF26F for ; Tue, 31 Jul 2012 16:05:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755175Ab2GaQF5 (ORCPT ); Tue, 31 Jul 2012 12:05:57 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:51443 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755168Ab2GaQF5 (ORCPT ); Tue, 31 Jul 2012 12:05:57 -0400 Received: by vcbfk26 with SMTP id fk26so5974874vcb.19 for ; Tue, 31 Jul 2012 09:05:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=uXVJ3EwsIB/s6+PeTSJwiQAAPIkuF6so/B7F6NjiUhk=; b=i/RrQONMY9F3S9Yz14gXaewG2WNuy8cgBuVIBFaibn7c7/vAoueJLFXl8yH3m0eJHf ShwYSOIwdmvsZripKa+2UTFNeeOwJEaqL+Vfi/6vzn/0kKiBG+TZiMasVJ8Z7UrOBG/W IGEts7X3iZ2h+jYM0MiZ5UqeVKVIn7JQE/U2DRmbuQW6QP1s95HYXg4DOp0Y/jNBF6E8 Q0xzhbX1Cvo1/Bi1fBUBEZUX9Ufj0XR10PrAznfqUFYPFMLE39WvkTgMCsOa8qkoXSCz gcdup6U5GlzmdK7NB+OjIQvJzkXlS6yVE3z4rbhYSIZD8mvLYT6De4aWhVl9kbafeZJl xnRQ== Received: by 10.221.1.5 with SMTP id no5mr14422371vcb.67.1343750756224; Tue, 31 Jul 2012 09:05:56 -0700 (PDT) Received: from localhost ([193.47.165.251]) by mx.google.com with ESMTPS id cz2sm424751vdb.3.2012.07.31.09.05.55 (version=SSLv3 cipher=OTHER); Tue, 31 Jul 2012 09:05:55 -0700 (PDT) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock , Daniel Klein , Vladimir Koushnir , Alex Netes Subject: [PATCH 03/27] opensm/osm_link_mgr.c: Set PortInfo:PortState to LinkDown when remote port isn't accessible Date: Tue, 31 Jul 2012 19:04:31 +0300 Message-Id: <1343750695-28063-3-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1343750695-28063-1-git-send-email-alexne@mellanox.com> References: <1343750695-28063-1-git-send-email-alexne@mellanox.com> X-Gm-Message-State: ALoCoQnSrVkKpaQaQ/GSgV47ekIldY8iSXjREeCG7VsuXnQR2Pa0ylP+omH5cncbmjNvRcVuBhv1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Hal Rosenstock There might be a scenario where port's link physical state is LinkUp, but port's peer doesn't answer to SMPs. In this case we will move the port to LinkDown. Signed-off-by: Daniel Klein Signed-off-by: Vladimir Koushnir Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_link_mgr.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/opensm/osm_link_mgr.c b/opensm/osm_link_mgr.c index 8301643..8733329 100644 --- a/opensm/osm_link_mgr.c +++ b/opensm/osm_link_mgr.c @@ -484,7 +484,7 @@ Exit: static int link_mgr_process_node(osm_sm_t * sm, IN osm_node_t * p_node, IN const uint8_t link_state) { - osm_physp_t *p_physp; + osm_physp_t *p_physp, *p_physp_remote; uint32_t i, num_physp; int ret = 0; uint8_t current_state; @@ -517,6 +517,19 @@ static int link_mgr_process_node(osm_sm_t * sm, IN osm_node_t * p_node, continue; /* + Set PortState to DOWN in case Remote Physical Port is + unreachable. We have to check this for all ports, except + port zero. + */ + p_physp_remote = osm_physp_get_remote(p_physp); + if ((i != 0) && (!p_physp_remote || + !osm_physp_is_valid(p_physp_remote))) { + if (current_state != IB_LINK_INIT) + link_mgr_set_physp_pi(sm, p_physp, IB_LINK_DOWN); + continue; + } + + /* Normally we only send state update if state is lower then required state. However, we need to send update if no state change required.