diff mbox

libibnetdisc: remove not needed num_smps_outstanding counter

Message ID 20100418161028.GL11943@me (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sasha Khapyorsky April 18, 2010, 4:10 p.m. UTC
None
diff mbox

Patch

diff --git a/infiniband-diags/libibnetdisc/src/internal.h b/infiniband-diags/libibnetdisc/src/internal.h
index 57034f9..571b2f4 100644
--- a/infiniband-diags/libibnetdisc/src/internal.h
+++ b/infiniband-diags/libibnetdisc/src/internal.h
@@ -80,7 +80,6 @@  struct smp_engine {
 	ibnd_smp_t *smp_queue_tail;
 	void *user_data;
 	cl_qmap_t smps_on_wire;
-	int num_smps_outstanding;
 	int max_smps_on_wire;
 	unsigned total_smps;
 };
diff --git a/infiniband-diags/libibnetdisc/src/query_smp.c b/infiniband-diags/libibnetdisc/src/query_smp.c
index d38c2ef..7234844 100644
--- a/infiniband-diags/libibnetdisc/src/query_smp.c
+++ b/infiniband-diags/libibnetdisc/src/query_smp.c
@@ -100,7 +100,6 @@  static int process_smp_queue(smp_engine_t * engine)
 			free(smp);
 			return rc;
 		}
-		engine->num_smps_outstanding++;
 		cl_qmap_insert(&engine->smps_on_wire, (uint32_t) smp->rpc.trid,
 			       (cl_map_item_t *) smp);
 		engine->total_smps++;
@@ -171,7 +170,6 @@  static int process_one_recv(smp_engine_t * engine)
 		return -1;
 	}
 
-	engine->num_smps_outstanding--;
 	rc = process_smp_queue(engine);
 	if (rc)
 		goto error;
@@ -199,7 +197,6 @@  void smp_engine_init(smp_engine_t * engine, struct ibmad_port *ibmad_port,
 	engine->ibmad_port = ibmad_port;
 	engine->user_data = user_data;
 	cl_qmap_init(&engine->smps_on_wire);
-	engine->num_smps_outstanding = 0;
 	engine->max_smps_on_wire = max_smps_on_wire;
 }
 
@@ -224,16 +221,13 @@  void smp_engine_destroy(smp_engine_t * engine)
 		cl_qmap_remove_item(&engine->smps_on_wire, item);
 		free(item);
 	}
-
-	engine->num_smps_outstanding = 0;
 }
 
 int process_mads(smp_engine_t * engine)
 {
-	int rc = 0;
-	while (engine->num_smps_outstanding > 0)
-		while (!cl_is_qmap_empty(&engine->smps_on_wire))
-			if ((rc = process_one_recv(engine)) != 0)
-				return rc;
+	int rc;
+	while (!cl_is_qmap_empty(&engine->smps_on_wire))
+		if ((rc = process_one_recv(engine)) != 0)
+			return rc;
 	return 0;
 }