public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] infiniband-diags/ibqueryerrors: Fix remote node name printing
@ 2009-11-04  3:54 Ira Weiny
       [not found] ` <20091103195415.fb9254cf.weiny2-i2BcT+NCU+M@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Ira Weiny @ 2009-11-04  3:54 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org


From: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
Date: Tue, 3 Nov 2009 19:51:32 -0800
Subject: [PATCH] infiniband-diags/ibqueryerrors: Fix remote node name printing

	"-r" option was reporting the current node name, not the remote node
	name of the port as it should have been.

Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
---
 infiniband-diags/src/ibqueryerrors.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/infiniband-diags/src/ibqueryerrors.c b/infiniband-diags/src/ibqueryerrors.c
index f83f29e..37acd70 100644
--- a/infiniband-diags/src/ibqueryerrors.c
+++ b/infiniband-diags/src/ibqueryerrors.c
@@ -145,6 +145,8 @@ static void print_port_config(char *node_name, ibnd_node_t * node, int portnum)
 		 mad_dump_val(IB_PORT_PHYS_STATE_F, physstate, 64, &iphystate));
 
 	if (port->remoteport) {
+		char *rem_node_name = NULL;
+
 		if (port->remoteport->ext_portnum)
 			snprintf(ext_port_str, 256, "%d",
 				 port->remoteport->ext_portnum);
@@ -153,13 +155,19 @@ static void print_port_config(char *node_name, ibnd_node_t * node, int portnum)
 
 		get_msg(width_msg, speed_msg, 256, port);
 
+		rem_node_name = remap_node_name(node_name_map,
+						port->remoteport->node->guid,
+						port->remoteport->node->nodedesc);
+
 		snprintf(remote_str, 256,
 			 "0x%016" PRIx64 " %6d %4d[%2s] \"%s\" (%s %s)\n",
 			 port->remoteport->node->guid,
 			 port->remoteport->base_lid ? port->remoteport->
 			 base_lid : port->remoteport->node->smalid,
-			 port->remoteport->portnum, ext_port_str, node_name,
+			 port->remoteport->portnum, ext_port_str, rem_node_name,
 			 width_msg, speed_msg);
+
+		free(rem_node_name);
 	} else
 		snprintf(remote_str, 256, "           [  ] \"\" ( )\n");
 
-- 
1.5.4.5

--
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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] infiniband-diags/ibqueryerrors: Fix remote node name printing
       [not found] ` <20091103195415.fb9254cf.weiny2-i2BcT+NCU+M@public.gmane.org>
@ 2009-11-13  5:58   ` Sasha Khapyorsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Khapyorsky @ 2009-11-13  5:58 UTC (permalink / raw)
  To: Ira Weiny; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On 19:54 Tue 03 Nov     , Ira Weiny wrote:
> 
> From: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
> Date: Tue, 3 Nov 2009 19:51:32 -0800
> Subject: [PATCH] infiniband-diags/ibqueryerrors: Fix remote node name printing
> 
> 	"-r" option was reporting the current node name, not the remote node
> 	name of the port as it should have been.
> 
> Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>

Applied. Thanks.

Sasha
--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-13  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04  3:54 [PATCH] infiniband-diags/ibqueryerrors: Fix remote node name printing Ira Weiny
     [not found] ` <20091103195415.fb9254cf.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-11-13  5:58   ` Sasha Khapyorsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox