Skip to contentSkip to conversation

perftest fixes

PATCH In review frank zago 2 participants 3 messages Feb 2, 2011 – Feb 15, 2011 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

frank zago

author
#0 lore raw

PATCH 1/1 perftest fixes

Hello,

This fixes a bug in 3 tests where the result of ibv_open_device is not checked. I added a couple missing endlines too.

Frank.

COPYING +0 -0
Makefile +0 -0
README +0 -0
clock_test.c +0 -0
get_clock.c +0 -0
get_clock.h +0 -0
multicast_resources.c +0 -0
multicast_resources.h +0 -0
perftest.spec +0 -0
perftest_resources.c +0 -0
perftest_resources.h +0 -0
rdma_bw.c +0 -0
rdma_lat.c +0 -0
read_bw.c +0 -0
read_lat.c +0 -0
runme +0 -0
send_bw.c +6 -2
index 61ebb52..7d59d8a 100644
@@ -1173,9 +1173,13 @@ int main(int argc, char *argv[])
 
 	// Should be a function over here that computes the inline.
 	context = ibv_open_device(ib_dev);
-	
+	if (!context) {
+		fprintf(stderr, "Failed to open device %s\n",
+				ibv_get_device_name(ib_dev));
+		return 1;
+	}
 	if (ibv_query_device(context, &device_attribute)) {
-		fprintf(stderr, "Failed to query device props");
+		fprintf(stderr, "Failed to query device props\n");
 		return 1;
 	}
 	if ((device_attribute.vendor_part_id == 25408  ||
send_lat.c +0 -0
write_bw.c +6 -1
index 5851835..0f6ca17 100644
@@ -773,8 +773,13 @@ int main(int argc, char *argv[])
 		return 7;
 
 	context = ibv_open_device(ib_dev);
+	if (!context) {
+		fprintf(stderr, " Failed to open device %s\n",
+				ibv_get_device_name(ib_dev));
+		return 1;
+	}
 	if (ibv_query_device(context, &device_attribute)) {
-		fprintf(stderr, " Failed to query device props");
+		fprintf(stderr, " Failed to query device props\n");
 		return 1;
 	}
 	if ((device_attribute.vendor_part_id == 25408 ||
write_bw_postlist.c +6 -1
index 0349c40..0350082 100644
@@ -721,8 +721,13 @@ int main(int argc, char *argv[])
 	}
 
 	context = ibv_open_device(ib_dev);
+	if (!context) {
+		fprintf(stderr, "Failed to open device %s\n",
+				ibv_get_device_name(ib_dev));
+		return 1;
+	}
 	if (ibv_query_device(context, &device_attribute)) {
-		fprintf(stderr, "Failed to query device props");
+		fprintf(stderr, "Failed to query device props\n");
 		return 1;
 	}
 	if ((device_attribute.vendor_part_id == 25408 ||
write_lat.c +0 -0

A message that is not in the archive (sent off-list or not yet received): 4D49A026.4070308-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org

A message that is not in the archive (sent off-list or not yet received): 4D49A475.4020102-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org