[ofw] [PATCH 1/6] [ib-diag] ibnetdiscover: add support for WinOF

Sean Hefty sean.hefty at intel.com
Wed Feb 18 17:46:05 PST 2009


Mainly fixing datatypes to avoid type mismatches.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
Also attaching patch in case my mailer wraps the lines.

 infiniband-diags/src/grouping.c      |   28 ++++++++++++++--------------
 infiniband-diags/src/ibnetdiscover.c |    8 ++++----
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/infiniband-diags/src/grouping.c b/infiniband-diags/src/grouping.c
index 0ea139f..0266af4 100644
--- a/infiniband-diags/src/grouping.c
+++ b/infiniband-diags/src/grouping.c
@@ -265,20 +265,20 @@ int is_chassis_switch(Node *node)
 }
 
 /* these structs help find Line (Anafa) slot number while using spine portnum */
-int line_slot_2_sfb4[25]        = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 };
-int anafa_line_slot_2_sfb4[25]  = { 0, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2 };
-int line_slot_2_sfb12[25]       = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10, 10, 11, 11, 12, 12 };
-int anafa_line_slot_2_sfb12[25] = { 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 };
+char line_slot_2_sfb4[25]        = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 };
+char anafa_line_slot_2_sfb4[25]  = { 0, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2 };
+char line_slot_2_sfb12[25]       = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10, 10, 11, 11, 12, 12 };
+char anafa_line_slot_2_sfb12[25] = { 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 };
 
 /* IPR FCR modules connectivity while using sFB4 port as reference */
-int ipr_slot_2_sfb4_port[25]    = { 0, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1 };
+char ipr_slot_2_sfb4_port[25]    = { 0, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1 };
 
 /* these structs help find Spine (Anafa) slot number while using spine portnum */
-int spine12_slot_2_slb[25]      = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-int anafa_spine12_slot_2_slb[25]= { 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-int spine4_slot_2_slb[25]       = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-int anafa_spine4_slot_2_slb[25] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-/*	reference                     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
*/
+char spine12_slot_2_slb[25]      = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+char anafa_spine12_slot_2_slb[25]= { 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+char spine4_slot_2_slb[25]       = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+char anafa_spine4_slot_2_slb[25] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+/* reference                       { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 }; */
 
 static void get_sfb_slot(Node *node, Port *lineport)
 {
@@ -309,7 +309,7 @@ static void get_sfb_slot(Node *node, Port *lineport)
 static void get_router_slot(Node *node, Port *spineport)
 {
 	ChassisRecord *ch = node->chrecord;
-	int guessnum = 0;
+	uint64_t guessnum = 0;
 
 	if (!ch) {
 		if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
@@ -460,7 +460,7 @@ static void insert_line_router(Node *node, ChassisList *chassislist)
 		return;		/* already filled slot */
 
 	chassislist->linenode[i] = node;
-	node->chrecord->chassisnum = chassislist->chassisnum;
+	node->chrecord->chassisnum = (unsigned char) chassislist->chassisnum;
 }
 
 static void insert_spine(Node *node, ChassisList *chassislist)
@@ -471,7 +471,7 @@ static void insert_spine(Node *node, ChassisList *chassislist)
 		return;		/* already filled slot */
 
 	chassislist->spinenode[i] = node;
-	node->chrecord->chassisnum = chassislist->chassisnum;
+	node->chrecord->chassisnum = (unsigned char) chassislist->chassisnum;
 }
 
 static void pass_on_lines_catch_spines(ChassisList *chassislist)
@@ -770,7 +770,7 @@ ChassisList *group_nodes()
 					if (!node->chrecord) {
 						if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
 							IBPANIC("out of mem");
-						node->chrecord->chassisnum = chassis->chassisnum;
+						node->chrecord->chassisnum = (unsigned char) chassis->chassisnum;
 					}
 				}
 			}
diff --git a/infiniband-diags/src/ibnetdiscover.c b/infiniband-diags/src/ibnetdiscover.c
index 466d522..27afd6a 100644
--- a/infiniband-diags/src/ibnetdiscover.c
+++ b/infiniband-diags/src/ibnetdiscover.c
@@ -47,7 +47,7 @@
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <complib/cl_nodenamemap.h>
 
 #include "ibnetdiscover.h"
 #include "grouping.h"
@@ -212,7 +212,7 @@ extend_dpath(ib_dr_path_t *path, int nextport)
 	++path->cnt;
 	if (path->cnt > maxhops_discovered)
 		maxhops_discovered = path->cnt;
-	path->p[path->cnt] = nextport;
+	path->p[path->cnt] = (uint8_t) nextport;
 	return path->cnt;
 }
 
@@ -517,7 +517,7 @@ out_chassis(int chassisnum)
 	uint64_t guid;
 
 	fprintf(f, "\nChassis %d", chassisnum);
-	guid = get_chassis_guid(chassisnum);
+	guid = get_chassis_guid((unsigned char) chassisnum);
 	if (guid)
 		fprintf(f, " (guid 0x%" PRIx64 ")", guid);
 	fprintf(f, "\n");
@@ -964,7 +964,7 @@ int main(int argc, char **argv)
 		{ "Router_list", 'R', 0, NULL, "list of connected routers" },
 		{ "node-name-map", 1, 1, "<file>", "node name map file" },
 		{ "ports", 'p', 0, NULL, "obtain a ports report" },
-		{ }
+		{ 0 }
 	};
 	char usage_args[] = "[topology-file]";
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-win-ibnet
Type: application/octet-stream
Size: 5992 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090218/72896822/attachment.obj>


More information about the ofw mailing list