Skip to contentSkip to conversation

infiniband-diags/iblinkinfo.c: Limit some queries to switches

PATCH In review Hal Rosenstock 2 participants 2 messages Oct 27, 2010 – Nov 30, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infiniband-diags/iblinkinfo.c: Limit some queries to switches

infiniband-diags/iblinkinfo.c: Limit certain queries to switches

iblinkinfo man page says:
DESCRIPTION
iblinkinfo reports the link info for each port of each switch
active in
the IB fabric.

OPTIONS
-S <guid>
Output only the switch specified by <guid> (hex format)

-D <direct_route>
Output only the switch specified by the direct route path.

Queries by DR path or GUID should (also) be limited to switches.

---

infiniband-diags/src/iblinkinfo.c +0 -0
index d0c9b13..b129cb6 100644
@@ -2,6 +2,7 @@
  * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
  * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights 

reserved.
+ * Copyright (c) 2010 Mellanox Technologies LTD. All rights reserved. *
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@ -387,7 +388,7 @@ int main(int argc, char **argv)

if (!all && guid_str) {
ibnd_node_t *sw = ibnd_find_node_guid(fabric, guid);
- if (sw)
+ if (sw && sw->type == IB_NODE_TYPE_SWITCH)
print_switch(sw, NULL);
else
fprintf(stderr, "Failed to find switch: %s\n",
@@ -402,7 +403,7 @@ int main(int argc, char **argv)
mad_decode_field(ni, IB_NODE_GUID_F, &(guid));

sw = ibnd_find_node_guid(fabric, guid);
- if (sw)
+ if (sw && sw->type == IB_NODE_TYPE_SWITCH)
print_switch(sw, NULL);
else
fprintf(stderr, "Failed to find switch: %s\n", dr_path);
--
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): 4CC81F4B.4090600-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#2 lore raw
Quoted 12 lines · Hal Rosenstock

infiniband-diags/iblinkinfo.c: Limit certain queries to switches

iblinkinfo man page says:
DESCRIPTION
iblinkinfo reports the link info for each port of each switch
active in
the IB fabric.

OPTIONS
-S <guid>
Output only the switch specified by <guid> (hex format)

Quoted 6 lines

-D <direct_route>
Output only the switch specified by the direct route path.

Queries by DR path or GUID should (also) be limited to switches.

Applied by hands (the patch is malformed). Thanks.

Sasha

Quoted 34 lines

---

infiniband-diags/src/iblinkinfo.c +0 -0
index d0c9b13..b129cb6 100644
@@ -2,6 +2,7 @@
   * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
   * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
   * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights 

reserved.
+ * Copyright (c) 2010 Mellanox Technologies LTD. All rights reserved. *
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU

infiniband-diags/src/iblinkinfo.c +2 -3
@@ -387,7 +388,7 @@ int main(int argc, char **argv)
 
  	if (!all && guid_str) {
  		ibnd_node_t *sw = ibnd_find_node_guid(fabric, guid);
-		if (sw)
+		if (sw && sw->type == IB_NODE_TYPE_SWITCH)
  			print_switch(sw, NULL);
  		else
  			fprintf(stderr, "Failed to find switch: %s\n",
@@ -402,7 +403,7 @@ int main(int argc, char **argv)
  		mad_decode_field(ni, IB_NODE_GUID_F, &(guid));
 
  		sw = ibnd_find_node_guid(fabric, guid);
-		if (sw)
+		if (sw && sw->type == IB_NODE_TYPE_SWITCH)
  			print_switch(sw, NULL);
  		else
  			fprintf(stderr, "Failed to find switch: %s\n", dr_path);
--
Quoted 4 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