gen2_basic - handle other vendor devices for max QP count

When choosing the actual max QP number, handle non-Mellanox devices too.
Make sure we only clean up the QPs we actually created.

Signed-off by: Robert Walsh <robert.walsh@qlogic.com>

diff -rNu a/gen2_basic/test_qp.c b/gen2_basic/test_qp.c
--- a/gen2_basic/test_qp.c	2006-09-13 19:18:03.655058000 -0700
+++ b/gen2_basic/test_qp.c	2006-08-14 14:16:57.911621000 -0700
@@ -1289,13 +1289,12 @@
 	CHECK_PTR("ibv_create_cq", cq, goto cleanup);
 
         switch (device_attr.vendor_part_id) {
-	case 23108:
-	case 25208:
-		num_qp = device_attr.max_qp; 
-		break;
 	case 25218:
 	case 25204:
		num_qp = 15872; /* Found in experiments to be the max for memfree per process */
+		break;
+	default:
+		num_qp = device_attr.max_qp; 
 		break;
 	}
 
@@ -1330,7 +1329,7 @@
 	WAIT_CLEANUP;
 
 	if (qp) {
-		for (i = 0; i < device_attr.max_qp + 1; ++ i) {
+		for (i = 0; i < num_qp + 1; ++ i) {
 			if (qp[i]) {
 				rc = ibv_destroy_qp(qp[i]);
 				CHECK_VALUE("ibv_destroy_qp", rc, 0, test_result = -1);
