From patchwork Wed Feb 20 19:02:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2168771 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 7CAF53FD4E for ; Wed, 20 Feb 2013 19:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934450Ab3BTTCW (ORCPT ); Wed, 20 Feb 2013 14:02:22 -0500 Received: from mail-ie0-f180.google.com ([209.85.223.180]:43753 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933973Ab3BTTCW (ORCPT ); Wed, 20 Feb 2013 14:02:22 -0500 Received: by mail-ie0-f180.google.com with SMTP id bn7so10200073ieb.25 for ; Wed, 20 Feb 2013 11:02:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=b7G9jS89JO0qW+MwdEJD+oIDM2VPj5bt2TanlcaFdic=; b=C4piurO9ynvGf4ap470i64KnV10CRIW05rGi0hgpNo8UzZI5FwFlOS2p81zWeNI70e 7eLGEgPg6efgP5BwE4tq7X2p9MViuBAemNBlqlOf7+z0LEdfAbmBI9bexG2/acBpntV0 2rnIqEmQj1JXwL/0zGI2k2CgnUfdXwPAnh+5hSzFz7IOdXkdo3pDe4RpE9h0j/538g0k IzX/V2jO1XNcZhFRoowI0tWvUbtV3X1V+/TvSt1dX8IGpkC8LFEWYuVEQO2ShRRQnSsF vKgKQcFStlAMhurxXWWRhIzs0+Bi3Q2rcq13hv0e/xRxbYqUcVQ+OeA6iqQVBhl5xbWz Gx6g== X-Received: by 10.50.88.233 with SMTP id bj9mr11816337igb.55.1361386941702; Wed, 20 Feb 2013 11:02:21 -0800 (PST) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPS id xc3sm14210701igb.10.2013.02.20.11.02.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 11:02:20 -0800 (PST) Message-ID: <51251DBB.70203@dev.mellanox.co.il> Date: Wed, 20 Feb 2013 14:02:19 -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: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] opensm/osm_dump.c: Fix enhanced switch port 0 handling in print_node_report X-Gm-Message-State: ALoCoQnjASSRAsf0NsaXE6jicjiMxeDQpgdbW/SMFXs7LLXDUJlvOeyOPU/c+NfFnx+3tLGUxBiF Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Enhanced switch port 0 has port state, link speed, link width, and MTU. Only base (original) switch port 0 doesn't. 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_dump.c b/opensm/osm_dump.c index aae6a18..7f29259 100644 --- a/opensm/osm_dump.c +++ b/opensm/osm_dump.c @@ -563,9 +563,10 @@ static void print_node_report(cl_map_item_t * item, FILE * file, void *cxt) p_pi = &p_physp->port_info; /* - * Port state is not defined for switch port 0 + * Port state is not defined for base switch port 0 */ - if (port_num == 0) + if (port_num == 0 && + ib_switch_info_is_enhanced_port0(&p_node->sw->switch_info) == FALSE) fprintf(file, " :"); else fprintf(file, " %s :", @@ -584,7 +585,10 @@ static void print_node_report(cl_map_item_t * item, FILE * file, void *cxt) else fprintf(file, " : :"); - if (port_num != 0) + if (port_num == 0 && + ib_switch_info_is_enhanced_port0(&p_node->sw->switch_info) == FALSE) + fprintf(file, " : : "); + else fprintf(file, " %s : %s : %s ", osm_get_mtu_str (ib_port_info_get_neighbor_mtu(p_pi)), @@ -594,8 +598,6 @@ static void print_node_report(cl_map_item_t * item, FILE * file, void *cxt) ib_port_info_get_link_speed_ext_active(p_pi), ib_port_info_get_port_state(p_pi), p_physp->ext_port_info.link_speed_active & FDR10)); - else - fprintf(file, " : : "); if (osm_physp_get_port_guid(p_physp) == osm->subn.sm_port_guid) fprintf(file, "* %016" PRIx64 " *",