From patchwork Tue Feb 26 21:54:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 2187631 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 4458A3FCF2 for ; Tue, 26 Feb 2013 21:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314Ab3BZVyl (ORCPT ); Tue, 26 Feb 2013 16:54:41 -0500 Received: from prdiron-1.llnl.gov ([128.15.143.171]:39079 "EHLO prdiron-1.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828Ab3BZVyl (ORCPT ); Tue, 26 Feb 2013 16:54:41 -0500 X-Attachments: Received: from auk59.llnl.gov (HELO [134.9.93.24]) ([134.9.93.24]) by prdiron-1.llnl.gov with ESMTP; 26 Feb 2013 13:54:40 -0800 Subject: [PATCH 1/2] opensm/osm_console.c: Support portstatus output for unenabled width/speed From: Albert Chu To: linux-rdma@vger.kernel.org Date: Tue, 26 Feb 2013 13:54:40 -0800 Message-Id: <1361915680.28997.11.camel@auk59.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On occasion, it has been observed that active link width and/or speed is set at a level not enabled. For example, a link may be active at QDR but SDR & DDR speeds are the only ones enabled. Under these scenarios, the portstatus option in the console may incorrectly output port status, which can confuse users. A new port output status of "unenabled width" or "unenabled speed" is output when this situation is discovered, helping users find problems in the fabric. Signed-off-by: Albert Chu --- opensm/osm_console.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/opensm/osm_console.c b/opensm/osm_console.c index 600007c..7f9a963 100644 --- a/opensm/osm_console.c +++ b/opensm/osm_console.c @@ -703,6 +703,8 @@ typedef struct { uint64_t ports_8X; uint64_t ports_12X; uint64_t ports_unknown_width; + uint64_t ports_unenabled_width; + port_report_t *unenabled_width_ports; uint64_t ports_reduced_width; port_report_t *reduced_width_ports; uint64_t ports_sdr; @@ -712,6 +714,8 @@ typedef struct { uint64_t ports_fdr; uint64_t ports_edr; uint64_t ports_unknown_speed; + uint64_t ports_unenabled_speed; + port_report_t *unenabled_speed_ports; uint64_t ports_reduced_speed; port_report_t *reduced_speed_ports; } fabric_stats_t; @@ -766,14 +770,27 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context) port_state = ib_port_info_get_port_state(pi); port_phys_state = ib_port_info_get_port_phys_state(pi); - if ((enabled_width ^ active_width) > active_width) { + if (!(active_width & enabled_width)) { + __tag_port_report(&(fs->unenabled_width_ports), + cl_ntoh64(node->node_info.node_guid), + port, node->print_desc); + fs->ports_unenabled_width++; + } + else if ((enabled_width ^ active_width) > active_width) { __tag_port_report(&(fs->reduced_width_ports), cl_ntoh64(node->node_info.node_guid), port, node->print_desc); fs->ports_reduced_width++; } - if ((enabled_speed ^ active_speed) > active_speed) { + /* unenabled speed usually due to problems with force_link_speed */ + if (!(active_speed & enabled_speed)) { + __tag_port_report(&(fs->unenabled_speed_ports), + cl_ntoh64(node->node_info.node_guid), + port, node->print_desc); + fs->ports_unenabled_speed++; + } + else if ((enabled_speed ^ active_speed) > active_speed) { __tag_port_report(&(fs->reduced_speed_ports), cl_ntoh64(node->node_info.node_guid), port, node->print_desc); @@ -814,7 +831,13 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context) (enabled_speed = pi->link_speed_ext_enabled) != IB_LINK_SPEED_EXT_DISABLE && active_speed == IB_LINK_SPEED_ACTIVE_10) { active_speed = ib_port_info_get_link_speed_ext_active(pi); - if ((enabled_speed ^ active_speed) > active_speed) { + if (!(active_speed & enabled_speed)) { + __tag_port_report(&(fs->unenabled_speed_ports), + cl_ntoh64(node->node_info.node_guid), + port, node->print_desc); + fs->ports_unenabled_speed++; + } + else if ((enabled_speed ^ active_speed) > active_speed) { __tag_port_report(&(fs->reduced_speed_ports), cl_ntoh64(node->node_info.node_guid), port, node->print_desc); @@ -933,18 +956,28 @@ static void portstatus_parse(char **p_last, osm_opensm_t * p_osm, FILE * out) fprintf(out, " %" PRIu64 " at 25.78125 Gbps\n", fs.ports_edr); if (fs.ports_disabled + fs.ports_reduced_speed + fs.ports_reduced_width - > 0) { + + fs.ports_unenabled_width + fs.ports_unenabled_speed > 0) { fprintf(out, "\nPossible issues:\n"); } if (fs.ports_disabled) { fprintf(out, " %" PRIu64 " disabled\n", fs.ports_disabled); __print_port_report(out, fs.disabled_ports); } + if (fs.ports_unenabled_speed) { + fprintf(out, " %" PRIu64 " with unenabled speed\n", + fs.ports_unenabled_speed); + __print_port_report(out, fs.unenabled_speed_ports); + } if (fs.ports_reduced_speed) { fprintf(out, " %" PRIu64 " with reduced speed\n", fs.ports_reduced_speed); __print_port_report(out, fs.reduced_speed_ports); } + if (fs.ports_unenabled_width) { + fprintf(out, " %" PRIu64 " with unenabled width\n", + fs.ports_unenabled_width); + __print_port_report(out, fs.unenabled_width_ports); + } if (fs.ports_reduced_width) { fprintf(out, " %" PRIu64 " with reduced width\n", fs.ports_reduced_width);