All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doron Shoham <dorons-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: Hal Rosenstock
	<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ibnetdiscover: add '-f' flag to show full information (ports' speed and width).
Date: Thu, 26 Aug 2010 10:43:23 +0300	[thread overview]
Message-ID: <4C761B1B.5030804@voltaire.com> (raw)
In-Reply-To: <20100825170656.GM5837@me>

add '-f' flag to show full information (ports' speed and witdh).
mainly to work with ibsim (using links real speed and width).

Signed-off-by: Doron Shoham <dorons-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 infiniband-diags/src/ibnetdiscover.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/infiniband-diags/src/ibnetdiscover.c b/infiniband-diags/src/ibnetdiscover.c
index f20058c..df9e5a6 100644
--- a/infiniband-diags/src/ibnetdiscover.c
+++ b/infiniband-diags/src/ibnetdiscover.c
@@ -77,6 +77,7 @@ static char *diff_cache_file = NULL;
 static unsigned diffcheck_flags = DIFF_FLAG_DEFAULT;
 
 static int report_max_hops = 0;
+static int full_info;
 
 /**
  * Define our own conversion functions to maintain compatibility with the old
@@ -357,13 +358,16 @@ void out_switch_port(ibnd_port_t * port, int group, char *out_prefix)
 		ext_port_str ? ext_port_str : "");
 	if (port->remoteport->node->type != IB_NODE_SWITCH)
 		fprintf(f, "(%" PRIx64 ") ", port->remoteport->guid);
-	fprintf(f, "\t\t# \"%s\" lid %d %s%s",
+	fprintf(f, "\t\t# \"%s\" lid %d %s%s ",
 		rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
 		port->remoteport->node->smalid :
 		port->remoteport->base_lid,
 		dump_linkwidth_compat(iwidth), dump_linkspeed_compat(ispeed));
 
+	if (full_info)
+		fprintf(f, "s=%d w=%d", ispeed, iwidth);
+
 	if (ibnd_is_xsigo_tca(port->remoteport->guid))
 		fprintf(f, " slot %d", port->portnum);
 	else if (ibnd_is_xsigo_hca(port->remoteport->guid))
@@ -397,13 +401,17 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 				       port->remoteport->node->guid,
 				       port->remoteport->node->nodedesc);
 
-	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
+	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s ",
 		port->base_lid, port->lmc, rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
 		port->remoteport->node->smalid :
 		port->remoteport->base_lid,
 		dump_linkwidth_compat(iwidth), dump_linkspeed_compat(ispeed));
 
+	if (full_info)
+		fprintf(f, "s=%d w=%d", ispeed, iwidth);
+	fprintf(f, "\n");
+
 	free(rem_nodename);
 }
 
@@ -926,6 +934,9 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 's':
 		cfg->show_progress = 1;
 		break;
+	case 'f':
+		full_info = 1;
+		break;
 	case 'l':
 		list = LIST_CA_NODE | LIST_SWITCH_NODE | LIST_ROUTER_NODE;
 		break;
@@ -964,6 +975,7 @@ int main(int argc, char **argv)
 	ibnd_fabric_t *diff_fabric = NULL;
 
 	const struct ibdiag_opt opts[] = {
+		{"full", 'f', 0, NULL, "show full information (ports' speed and witdh)"},
 		{"show", 's', 0, NULL, "show more information"},
 		{"list", 'l', 0, NULL, "list of connected nodes"},
 		{"grouping", 'g', 0, NULL, "show grouping"},
-- 
1.5.4

--
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:[~2010-08-26  7:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18  8:30 [PATCH] ibnetdiscover: add '-f' flag to show full information (ports' speed and width) Doron Shoham
     [not found] ` <4C6B9A42.9020505-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2010-08-24  4:03   ` Sasha Khapyorsky
2010-08-24 11:55     ` Doron Shoham
     [not found]       ` <4C73B34A.4080508-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2010-08-24 13:10         ` Hal Rosenstock
     [not found]           ` <AANLkTi=V9Xb92KPgqKnFFWzp-izSsHi7c+-HXYBmggYN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-24 13:27             ` Doron Shoham
     [not found]               ` <4C73C8BC.6010702-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2010-08-24 13:45                 ` Hal Rosenstock
     [not found]                   ` <AANLkTime9OX4EPS_c+pKwnchuVfyLqeLcuX0rXDjOCgR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-25 17:06                     ` Sasha Khapyorsky
2010-08-26  7:43                       ` Doron Shoham [this message]
     [not found]                         ` <4C761B1B.5030804-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2010-08-26 11:17                           ` Hal Rosenstock
     [not found]                             ` <AANLkTimpAQNGo+wzCY8VmnvGf7zfwqm3cak49eZRQs1V-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-26 13:14                               ` Doron Shoham
     [not found]                                 ` <4C7668A8.9080806-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2010-09-01 13:23                                   ` Sasha Khapyorsky
2010-08-31 14:18                       ` Eli Dorfman (Voltaire)
     [not found]                         ` <4C7D0F46.1030305-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-08-31 15:15                           ` Hal Rosenstock
2010-09-01 13:23                           ` Sasha Khapyorsky

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=4C761B1B.5030804@voltaire.com \
    --to=dorons-smomgflxvozwk0htik3j/w@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sashak-smomgflXvOZWk0Htik3J/w@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.