[openib-general] [PATCH applied] perftest: fix device lookup by name
Michael S. Tsirkin
mst at mellanox.co.il
Tue Jan 10 05:23:11 PST 2006
The following is already applied on trunk.
---
Fix device lookup by name.
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: openib/src/userspace/perftest/rdma_bw.c
===================================================================
--- openib.orig/src/userspace/perftest/rdma_bw.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/rdma_bw.c 2006-01-10 15:15:49.000000000 +0200
@@ -594,7 +594,7 @@ int main(int argc, char *argv[])
return 1;
}
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev) {
Index: openib/src/userspace/perftest/read_bw.c
===================================================================
--- openib.orig/src/userspace/perftest/read_bw.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/read_bw.c 2006-01-10 15:17:02.000000000 +0200
@@ -688,7 +688,7 @@ int main(int argc, char *argv[])
return 1;
}
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev) {
Index: openib/src/userspace/perftest/read_lat.c
===================================================================
--- openib.orig/src/userspace/perftest/read_lat.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/read_lat.c 2006-01-10 15:16:16.000000000 +0200
@@ -124,7 +124,7 @@ static struct ibv_device *pp_find_dev(co
if (!ib_dev)
fprintf(stderr, "No IB devices found\n");
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev)
Index: openib/src/userspace/perftest/send_bw.c
===================================================================
--- openib.orig/src/userspace/perftest/send_bw.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/send_bw.c 2006-01-10 15:16:21.000000000 +0200
@@ -965,7 +965,7 @@ int main(int argc, char *argv[])
return 1;
}
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev) {
Index: openib/src/userspace/perftest/send_lat.c
===================================================================
--- openib.orig/src/userspace/perftest/send_lat.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/send_lat.c 2006-01-10 15:16:30.000000000 +0200
@@ -132,7 +132,7 @@ static struct ibv_device *pp_find_dev(co
if (!ib_dev)
fprintf(stderr, "No IB devices found\n");
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev)
Index: openib/src/userspace/perftest/write_bw.c
===================================================================
--- openib.orig/src/userspace/perftest/write_bw.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/write_bw.c 2006-01-10 15:17:02.000000000 +0200
@@ -740,7 +740,7 @@ int main(int argc, char *argv[])
return 1;
}
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev) {
Index: openib/src/userspace/perftest/write_lat.c
===================================================================
--- openib.orig/src/userspace/perftest/write_lat.c 2006-01-10 15:02:10.000000000 +0200
+++ openib/src/userspace/perftest/write_lat.c 2006-01-10 15:17:02.000000000 +0200
@@ -122,7 +122,7 @@ static struct ibv_device *pp_find_dev(co
if (!ib_dev)
fprintf(stderr, "No IB devices found\n");
} else {
- for (ib_dev = *dev_list; ib_dev; ++dev_list)
+ for (; (ib_dev = *dev_list); ++dev_list)
if (!strcmp(ibv_get_device_name(ib_dev), ib_devname))
break;
if (!ib_dev)
--
MST
More information about the general
mailing list