[openib-general] [PATCH] GSI: Create send pool per HCA

Hal Rosenstock halr at voltaire.com
Fri Aug 13 14:14:11 PDT 2004


Create send pool per HCA

Index: gsi_main.c
===================================================================
--- gsi_main.c	(revision 643)
+++ gsi_main.c	(working copy)
@@ -649,6 +649,7 @@
 	gsi_hca_stop(hca);
 	gsi_thread_stop(hca);
 	gsi_dtgrm_pool_destroy(hca->rcv_dtgrm_pool);
+	gsi_dtgrm_pool_destroy(hca->snd_dtgrm_pool);
 	ib_destroy_qp(hca->qp);
 	ib_destroy_cq(hca->cq);
 	kfree(hca);
@@ -764,6 +765,14 @@
 		goto error6;
 	}
 
+	ret = gsi_dtgrm_pool_create_named(GSI_QP_SND_SIZE,
+					  "snd",
+					  &hca->snd_dtgrm_pool);
+	if (ret < 0) {
+		 printk(KERN_ERR "Could not create send datagram pool\n");
+		 goto error7;
+	}
+
 	spin_lock_init(&hca->rcv_list_lock);
 	spin_lock_init(&hca->snd_list_lock);
 
@@ -774,7 +783,7 @@
 	ret = gsi_hca_start(hca);
 	if (ret) {
 		printk(KERN_ERR "Could not start device\n");
-		goto error7;
+		goto error8;
 	}
 
 	GSI_HCA_LIST_LOCK();
@@ -783,9 +792,11 @@
 
 	return 0;
 
-error7:
+error8:
 	gsi_thread_stop(hca);
 
+	gsi_dtgrm_pool_destroy(hca->snd_dtgrm_pool);
+error7:
 	gsi_dtgrm_pool_destroy(hca->rcv_dtgrm_pool);
 error6:
 	ib_destroy_qp(hca->qp);
@@ -852,7 +863,8 @@
 #endif
 		if ((ret = gsi_register_redirection(hca_name,
 						    hca->port,
-						    class, &class_port_info))) {
+						    class, 
+						    &class_port_info))) {
 			printk(KERN_ERR \
 				 "Could not register redirection for class (0x%x)!\n",
 				 class);
@@ -877,6 +889,7 @@
 	newinfo->send_compl_cb = send_compl_cb;
 	newinfo->receive_cb = receive_cb;
 	newinfo->context = context;
+	newinfo->snd_dtgrm_pool = hca->snd_dtgrm_pool;
 	newinfo->client_id = server ? GSI_SERVER_ID : gsi_curr_client_id++;
 
 	spin_lock_init(&newinfo->redirect_class_port_info_list_lock);
@@ -2473,15 +2486,19 @@
 		else
 			printk("DOWN\n");
 
-		printk("   tx:%-8u err:%-5u\n",
-		       hca_info->stat.snd_cnt, hca_info->stat.snd_err_cnt);
-
 		printk
 		    ("   rx:%-8u err:%-5u posted:%-6d pool size:%-6d dtgrm in
pool:%-6d\n",
 		     hca_info->stat.rcv_cnt, hca_info->stat.rcv_err_cnt,
 		     hca_info->stat.rcv_posted_cnt,
 		     gsi_dtgrm_pool_size(hca_info->rcv_dtgrm_pool),
 		     gsi_dtgrm_pool_dtgrm_cnt(hca_info->rcv_dtgrm_pool));
+
+		printk
+		    ("   tx:%-8u err:%-5u posted:%-6d pool size:%-6d dtgrm in
pool:%-6d\n",
+		     hca_info->stat.snd_cnt, hca_info->stat.snd_err_cnt,
+		     hca_info->stat.snd_posted_cnt,
+		     gsi_dtgrm_pool_size(hca_info->snd_dtgrm_pool),
+		     gsi_dtgrm_pool_dtgrm_cnt(hca_info->snd_dtgrm_pool));
 	}
 	GSI_HCA_LIST_UNLOCK();
 
Index: gsi_priv.h
===================================================================
--- gsi_priv.h	(revision 635)
+++ gsi_priv.h	(working copy)
@@ -184,6 +184,7 @@
 	int up;
 
 	void *rcv_dtgrm_pool;
+	void *snd_dtgrm_pool;
 
 	spinlock_t snd_list_lock;
 
@@ -244,6 +245,7 @@
 	gsi_receive_cb_t receive_cb;
 
 	void *context;
+	void *snd_dtgrm_pool;
 	void *rmpp_h;
 	void *rmpp_rcv_dtgrm_pool;
 	void *rmpp_snd_dtgrm_pool;





More information about the general mailing list