All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: "linux-rdma
	(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] opensm/osm_dump.c: Fix enhanced switch port 0 handling in print_node_report
Date: Wed, 20 Feb 2013 14:02:19 -0500	[thread overview]
Message-ID: <51251DBB.70203@dev.mellanox.co.il> (raw)


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 <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
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 " *",
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2013-02-20 19:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51251DBB.70203@dev.mellanox.co.il \
    --to=hal-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.