Skip to contentSkip to conversation

ibnetdiscover: add '-f' flag to show full information (ports' speed and width).

PATCH Applied Doron Shoham 4 participants 14 messages Aug 18, 2010 – Sep 1, 2010 9 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibnetdiscover: add '-f' flag to show full information (ports' speed and width).

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

---
 infiniband-diags/src/ibnetdiscover.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +9 -1
index f20058c..0a020a2 100644
@@ -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 = 0;
 
 /**
  * Define our own conversion functions to maintain compatibility with the old
@@ -357,6 +358,8 @@ 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);
+	if (full_info)
+			fprintf(f, " s=%d w=%d", ispeed, iwidth);
 	fprintf(f, "\t\t# \"%s\" lid %d %s%s",
 		rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -396,7 +399,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 	rem_nodename = remap_node_name(node_name_map,
 				       port->remoteport->node->guid,
 				       port->remoteport->node->nodedesc);
-
+	if (full_info)
+			fprintf(f, " s=%d w=%d", ispeed, iwidth);
 	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
 		port->base_lid, port->lmc, rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -926,6 +930,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 +971,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"},
Signature · 6 lines
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4C6B9A42.9020505-smomgflXvOZWk0Htik3J/[email protected]

#2 lore raw
Quoted 2 lines · Doron Shoham

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

Seems almost fine. However see the comments below.

Quoted 19 lines
---
 infiniband-diags/src/ibnetdiscover.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +1 -0
index f20058c..0a020a2 100644
@@ -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 = 0;
 
 /**
  * Define our own conversion functions to maintain compatibility with the old

infiniband-diags/src/ibnetdiscover.c void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) · line 362

Quoted 5 lines
infiniband-diags/src/ibnetdiscover.c +2 -0
@@ -357,6 +358,8 @@ 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);
+	if (full_info)
+			fprintf(f, " s=%d w=%d", ispeed, iwidth);

I think that in order to not potentially break any ibnetdiscover output parsers it would be better to put such "f" output after a comment line. Would it work with ibsim in a same way?

infiniband-diags/src/ibnetdiscover.c void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) · line 403

Quoted 10 lines
infiniband-diags/src/ibnetdiscover.c +2 -1
 	fprintf(f, "\t\t# \"%s\" lid %d %s%s",
 		rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -396,7 +399,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 	rem_nodename = remap_node_name(node_name_map,
 				       port->remoteport->node->guid,
 				       port->remoteport->node->nodedesc);
-
+	if (full_info)
+			fprintf(f, " s=%d w=%d", ispeed, iwidth);

Ditto.

Sasha

Quoted 24 lines
infiniband-diags/src/ibnetdiscover.c +4 -0
 	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
 		port->base_lid, port->lmc, rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -926,6 +930,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 +971,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"},
Signature · 1 line
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 22 lines · Sasha Khapyorsky
Quoted 2 lines · Doron Shoham

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

Seems almost fine. However see the comments below.

Quoted 16 lines
---
 infiniband-diags/src/ibnetdiscover.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +1 -0
index f20058c..0a020a2 100644
@@ -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 = 0;
 
Quoted 12 lines

infiniband-diags/src/ibnetdiscover.c void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) · line 362

Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +2 -0
 /**
  * Define our own conversion functions to maintain compatibility with the old
@@ -357,6 +358,8 @@ 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);
+	if (full_info)
+			fprintf(f, " s=%d w=%d", ispeed, iwidth);

I think that in order to not potentially break any ibnetdiscover output parsers it would be better to put such "f" output after a comment line. Would it work with ibsim in a same way?

ibsim should still work if the output is after the comment.
I still think that it can potentially break ibnetdiscover output parsers (that why I used '-f' flag). Do you want it with '-f' flag and after the comment?
for example:
[1](2c903000020a9) "S-0008f10500650272"[19] # s=2 w=2 lid 6 lmc 0 "Voltaire sLB-4018 Line 10 Chip 1 4700 #4700-B778" lid 3 4xDDR

Quoted 32 lines

infiniband-diags/src/ibnetdiscover.c void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) · line 403

Quoted 11 lines
infiniband-diags/src/ibnetdiscover.c +2 -1
 	fprintf(f, "\t\t# \"%s\" lid %d %s%s",
 		rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -396,7 +399,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 	rem_nodename = remap_node_name(node_name_map,
 				       port->remoteport->node->guid,
 				       port->remoteport->node->nodedesc);
-
+	if (full_info)
+			fprintf(f, " s=%d w=%d", ispeed, iwidth);

Ditto.

Sasha

Quoted 16 lines
infiniband-diags/src/ibnetdiscover.c +3 -0
 	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
 		port->base_lid, port->lmc, rem_nodename,
 		port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -926,6 +930,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 +971,7 @@ int main(int argc, char **argv)
 	ibnd_fabric_t *diff_fabric = NULL;
 
Quoted 8 lines
Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +1 -0
 	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"},
Signature · 1 line
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4C73B34A.4080508-smomgflXvOZWk0Htik3J/[email protected]

#5 lore raw
Quoted 36 lines · Doron Shoham
Quoted 22 lines · Sasha Khapyorsky
Quoted 2 lines · Doron Shoham

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

Seems almost fine. However see the comments below.

Quoted 16 lines

---
 infiniband-diags/src/ibnetdiscover.c |   10 +++++++++-

 1 files changed, 9 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +1 -0
index f20058c..0a020a2 100644
@@ -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 = 0;
 
Quoted 12 lines

infiniband-diags/src/ibnetdiscover.c void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) · line 362

Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +2 -0
  /**
   * Define our own conversion functions to maintain compatibility with the old
@@ -357,6 +358,8 @@ 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);
+    if (full_info)
+                    fprintf(f, " s=%d w=%d", ispeed, iwidth);

I think that in order to not potentially break any ibnetdiscover output parsers it would be better to put such "f" output after a comment line. Would it work with ibsim in a same way?

Quoted 6 lines

ibsim should still work if the output is after the comment.
I still think that it can potentially break ibnetdiscover output parsers (that why I used '-f' flag).
Do you want it with '-f' flag and after the comment?
for example:
[1](2c903000020a9)      "S-0008f10500650272"[19]                #  s=2 w=2 lid 6 lmc 0 "Voltaire sLB-4018    Line 10  Chip 1 4700 #4700-B778" lid 3 4xDDR

Personally, I'd prefer it at the end of the line after 4xDDR and use speed/width rather than s=/w=:

[1](2c903000020a9) "S-0008f10500650272"[19] # lid
6 lmc 0 "Voltaire sLB-4018 Line 10 Chip 1 4700 #4700-B778" lid 3
4xDDR speed 2 width 2

I think that looks better and is more readable. Just my $0.02...

-- Hal

Quoted 32 lines
Quoted 32 lines

infiniband-diags/src/ibnetdiscover.c void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) · line 403

Quoted 11 lines
infiniband-diags/src/ibnetdiscover.c +0 -0
      fprintf(f, "\t\t# \"%s\" lid %d %s%s",
              rem_nodename,

             port->remoteport->node->type == IB_NODE_SWITCH ?

infiniband-diags/src/ibnetdiscover.c +2 -1
@@ -396,7 +399,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
      rem_nodename = remap_node_name(node_name_map,
                                     port->remoteport->node->guid,
                                     port->remoteport->node->nodedesc);
-
+    if (full_info)
+                    fprintf(f, " s=%d w=%d", ispeed, iwidth);

Ditto.

Sasha

Quoted 16 lines
infiniband-diags/src/ibnetdiscover.c +0 -0
      fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
              port->base_lid, port->lmc, rem_nodename,

             port->remoteport->node->type == IB_NODE_SWITCH ?

infiniband-diags/src/ibnetdiscover.c +0 -0
@@ -926,6 +930,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;

infiniband-diags/src/ibnetdiscover.c +0 -0
@@ -964,6 +971,7 @@ int main(int argc, char **argv)
      ibnd_fabric_t *diff_fabric = NULL;
 
Quoted 14 lines
Quoted 8 lines
Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +1 -1
      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 [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): AANLkTi=V9Xb92KPgqKnFFWzp-izSsHi7c+-HXYBmggYN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw
Quoted 47 lines · Hal Rosenstock
Quoted 36 lines · Doron Shoham
Quoted 22 lines · Sasha Khapyorsky
Quoted 2 lines · Doron Shoham

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

Seems almost fine. However see the comments below.

Quoted 16 lines
---
 infiniband-diags/src/ibnetdiscover.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +1 -0
index f20058c..0a020a2 100644
@@ -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 = 0;
 
Quoted 12 lines

infiniband-diags/src/ibnetdiscover.c void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) · line 362

Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +2 -0
 /**
  * Define our own conversion functions to maintain compatibility with the old
@@ -357,6 +358,8 @@ 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);
+    if (full_info)
+                    fprintf(f, " s=%d w=%d", ispeed, iwidth);

I think that in order to not potentially break any ibnetdiscover output parsers it would be better to put such "f" output after a comment line. Would it work with ibsim in a same way?

Quoted 6 lines

ibsim should still work if the output is after the comment.
I still think that it can potentially break ibnetdiscover output parsers (that why I used '-f' flag). Do you want it with '-f' flag and after the comment?
for example:
[1](2c903000020a9) "S-0008f10500650272"[19] # s=2 w=2 lid 6 lmc 0 "Voltaire sLB-4018 Line 10 Chip 1 4700 #4700-B778" lid 3 4xDDR

Personally, I'd prefer it at the end of the line after 4xDDR and use speed/width rather than s=/w=:

Quoted 7 lines

[1](2c903000020a9) "S-0008f10500650272"[19] # lid
6 lmc 0 "Voltaire sLB-4018 Line 10 Chip 1 4700 #4700-B778" lid 3
4xDDR speed 2 width 2

I think that looks better and is more readable. Just my $0.02...

-- Hal

The problem is the ibsim is expecting s=/w= and not speed <number> or width <number>.

What about the flag? do we still need it if we pass the output after the comment?

Doron

Quoted 33 lines
Quoted 33 lines
Quoted 33 lines

infiniband-diags/src/ibnetdiscover.c void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) · line 403

Quoted 12 lines
infiniband-diags/src/ibnetdiscover.c +2 -1
     fprintf(f, "\t\t# \"%s\" lid %d %s%s",
             rem_nodename,
             port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -396,7 +399,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
     rem_nodename = remap_node_name(node_name_map,
                                    port->remoteport->node->guid,
                                    port->remoteport->node->nodedesc);
-
+    if (full_info)
+                    fprintf(f, " s=%d w=%d", ispeed, iwidth);

Ditto.

Sasha

Quoted 16 lines
infiniband-diags/src/ibnetdiscover.c +3 -0
     fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
             port->base_lid, port->lmc, rem_nodename,
             port->remoteport->node->type == IB_NODE_SWITCH ?
@@ -926,6 +930,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 +971,7 @@ int main(int argc, char **argv)
     ibnd_fabric_t *diff_fabric = NULL;
 
Quoted 14 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +1 -1
     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

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4C73C8BC.6010702-smomgflXvOZWk0Htik3J/[email protected]

#9 lore raw
Quoted 52 lines · Doron Shoham
Quoted 51 lines · Hal Rosenstock
Quoted 36 lines · Doron Shoham
Quoted 22 lines · Sasha Khapyorsky
Quoted 2 lines · Doron Shoham

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

Seems almost fine. However see the comments below.

Quoted 16 lines

---
 infiniband-diags/src/ibnetdiscover.c |   10 +++++++++-

 1 files changed, 9 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +1 -0
index f20058c..0a020a2 100644
@@ -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 = 0;
 
Quoted 12 lines

infiniband-diags/src/ibnetdiscover.c void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) · line 362

Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +2 -0
  /**
   * Define our own conversion functions to maintain compatibility with the old
@@ -357,6 +358,8 @@ 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);
+    if (full_info)
+                    fprintf(f, " s=%d w=%d", ispeed, iwidth);

I think that in order to not potentially break any ibnetdiscover output parsers it would be better to put such "f" output after a comment line. Would it work with ibsim in a same way?

Quoted 6 lines

ibsim should still work if the output is after the comment.
I still think that it can potentially break ibnetdiscover output parsers (that why I used '-f' flag).
Do you want it with '-f' flag and after the comment?
for example:
[1](2c903000020a9)      "S-0008f10500650272"[19]                #  s=2 w=2 lid 6 lmc 0 "Voltaire sLB-4018    Line 10  Chip 1 4700 #4700-B778" lid 3 4xDDR

Personally, I'd prefer it at the end of the line after 4xDDR and use speed/width rather than s=/w=:

[1](2c903000020a9)      "S-0008f10500650272"[19]                #  lid 6 lmc 0 "Voltaire sLB-4018    Line 10  Chip 1 4700 #4700-B778" lid 3 4xDDR speed 2 width 2

Quoted 5 lines
Quoted 3 lines

I think that looks better and is more readable. Just my $0.02...

-- Hal

The problem is the ibsim is expecting s=/w= and not speed <number> or width <number>.

Oh, I forgot about that; ugh...

Quoted 1 line

What about the flag? do we still need it if we pass the output after the comment?

I wouldn't think so. I also think we've made commentary changes to the ibnetdiscover output format like this before. If we wanted to be absolutely sure it wouldn't break anything, we'd keep the flag though. It's up to Sasha.

-- Hal

Quoted 51 lines

Doron

Quoted 47 lines
Quoted 47 lines
Quoted 33 lines

infiniband-diags/src/ibnetdiscover.c void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) · line 403

Quoted 12 lines
infiniband-diags/src/ibnetdiscover.c +0 -0
      fprintf(f, "\t\t# \"%s\" lid %d %s%s",
              rem_nodename,

             port->remoteport->node->type == IB_NODE_SWITCH ?

infiniband-diags/src/ibnetdiscover.c +2 -1
@@ -396,7 +399,8 @@ void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
      rem_nodename = remap_node_name(node_name_map,
                                     port->remoteport->node->guid,
                                     port->remoteport->node->nodedesc);
-
+    if (full_info)
+                    fprintf(f, " s=%d w=%d", ispeed, iwidth);

Ditto.

Sasha

Quoted 16 lines
infiniband-diags/src/ibnetdiscover.c +0 -0
      fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
              port->base_lid, port->lmc, rem_nodename,

             port->remoteport->node->type == IB_NODE_SWITCH ?

infiniband-diags/src/ibnetdiscover.c +0 -0
@@ -926,6 +930,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;

infiniband-diags/src/ibnetdiscover.c +0 -0
@@ -964,6 +971,7 @@ int main(int argc, char **argv)
      ibnd_fabric_t *diff_fabric = NULL;
 
Quoted 8 lines
Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +1 -1
      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 [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): AANLkTime9OX4EPS_c+pKwnchuVfyLqeLcuX0rXDjOCgR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#11 lore raw
Quoted 7 lines · Hal Rosenstock
Quoted 2 lines

What about the flag? do we still need it if we pass the output after the comment?

I wouldn't think so. I also think we've made commentary changes to the ibnetdiscover output format like this before. If we wanted to be absolutely sure it wouldn't break anything, we'd keep the flag though. It's up to Sasha.

The '-f' flag could make sense since those information actually duplicates previous 4xDDR, etc. and used by ibsim's parser only.

Also it would be nice to make ibsim's parser to understand both
possibilities: s=2 and speed=2 (Or even to parse "*x*DR" strings :))

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw

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

---
 infiniband-diags/src/ibnetdiscover.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
infiniband-diags/src/ibnetdiscover.c +14 -2
index f20058c..df9e5a6 100644
@@ -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"},
Signature · 6 lines
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4C761B1B.5030804-smomgflXvOZWk0Htik3J/[email protected]

#14 lore raw
Quoted 2 lines · Doron Shoham

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

Just a couple of (output formatting) nits below...

Quoted 18 lines

---
 infiniband-diags/src/ibnetdiscover.c |   16 ++++++++++++++--

 1 files changed, 14 insertions(+), 2 deletions(-)
infiniband-diags/src/ibnetdiscover.c +1 -0
index f20058c..df9e5a6 100644
@@ -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

infiniband-diags/src/ibnetdiscover.c void out_switch_port(ibnd_port_t * port, int group, char *out_prefix) · line 361

Quoted 5 lines
infiniband-diags/src/ibnetdiscover.c +1 -1
@@ -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 ",

I'd leave this alone and move the space below.

Quoted 9 lines
infiniband-diags/src/ibnetdiscover.c +0 -0
                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); +

I'd move the space here before s=

infiniband-diags/src/ibnetdiscover.c void out_ca_port(ibnd_port_t * port, int group, char *out_prefix) · line 404

Quoted 9 lines

       if (ibnd_is_xsigo_tca(port->remoteport->guid)) fprintf(f, " slot %d", port->portnum); else if (ibnd_is_xsigo_hca(port->remoteport->guid))

infiniband-diags/src/ibnetdiscover.c +1 -1
@@ -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 ",

Ditto,

Quoted 8 lines
infiniband-diags/src/ibnetdiscover.c +0 -0
                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);

Ditto.

-- Hal

Quoted 24 lines

+       fprintf(f, "\n");
+
       free(rem_nodename);
 }

infiniband-diags/src/ibnetdiscover.c +0 -0
@@ -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;

infiniband-diags/src/ibnetdiscover.c +1 -1
@@ -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"},
--
Quoted 3 lines

1.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): AANLkTimpAQNGo+wzCY8VmnvGf7zfwqm3cak49eZRQs1V-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#16 lore raw

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

---
 infiniband-diags/src/ibnetdiscover.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
infiniband-diags/src/ibnetdiscover.c +13 -1
index f20058c..92f248b 100644
@@ -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
@@ -364,6 +365,9 @@ void out_switch_port(ibnd_port_t * port, int group, char *out_prefix)
 		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"},
Signature · 6 lines
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4C7668A8.9080806-smomgflXvOZWk0Htik3J/[email protected]

#19 lore raw
In reply to Sasha Khapyorsky
Quoted 7 lines · Sasha Khapyorsky
Quoted 5 lines · Hal Rosenstock
Quoted 1 line

What about the flag? do we still need it if we pass the output after the comment?

I wouldn't think so. I also think we've made commentary changes to the ibnetdiscover output format like this before. If we wanted to be absolutely sure it wouldn't break anything, we'd keep the flag though. It's up to Sasha.

Quoted 5 lines

The '-f' flag could make sense since those information actually duplicates previous 4xDDR, etc. and used by ibsim's parser only.

Also it would be nice to make ibsim's parser to understand both
possibilities: s=2 and speed=2 (Or even to parse "*x*DR" strings :))

Is it valid to assume that "*x*DR" string is always the last token? If so, the patch should be changed

Eli

Quoted 6 lines

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw
Quoted 8 lines · Eli Dorfman (Voltaire)
Quoted 7 lines · Sasha Khapyorsky
Quoted 5 lines · Hal Rosenstock
Quoted 1 line

What about the flag? do we still need it if we pass the output after the comment?

I wouldn't think so. I also think we've made commentary changes to the ibnetdiscover output format like this before. If we wanted to be absolutely sure it wouldn't break anything, we'd keep the flag though. It's up to Sasha.

Quoted 7 lines
Quoted 5 lines

The '-f' flag could make sense since those information actually duplicates previous 4xDDR, etc. and used by ibsim's parser only.

Also it would be nice to make ibsim's parser to understand both
possibilities: s=2 and speed=2 (Or even to parse "*x*DR" strings :))

Is it valid to assume that "*x*DR" string is always the last token?

Not always but for most cases (other than Xsigo devices).

-- Hal

Quoted 11 lines

If so, the patch should be changed

Eli

Quoted 6 lines

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#22 lore raw
In reply to a message not in the archive
Quoted 8 lines · Eli Dorfman (Voltaire)
Quoted 7 lines · Sasha Khapyorsky
Quoted 5 lines · Hal Rosenstock
Quoted 1 line

What about the flag? do we still need it if we pass the output after the comment?

I wouldn't think so. I also think we've made commentary changes to the ibnetdiscover output format like this before. If we wanted to be absolutely sure it wouldn't break anything, we'd keep the flag though. It's up to Sasha.

Quoted 7 lines
Quoted 5 lines

The '-f' flag could make sense since those information actually duplicates previous 4xDDR, etc. and used by ibsim's parser only.

Also it would be nice to make ibsim's parser to understand both
possibilities: s=2 and speed=2 (Or even to parse "*x*DR" strings :))

Is it valid to assume that "*x*DR" string is always the last token?

I think that it would be better to not assume this.

Sasha

Quoted 10 lines

If so, the patch should be changed

Eli

Quoted 6 lines

Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html