[openib-general] [PATCH] GSI: Make pools named

Hal Rosenstock halr at voltaire.com
Fri Aug 13 13:52:29 PDT 2004


Make pools named

Index: gsi_main.c
===================================================================
--- gsi_main.c	(revision 642)
+++ gsi_main.c	(working copy)
@@ -756,8 +756,9 @@
 
 	printk(KERN_DEBUG "Created QP - %d\n", hca->qp->qp_num);
 
-	ret = gsi_dtgrm_pool_create(GSI_QP_RCV_SIZE,
-				    &hca->rcv_dtgrm_pool);
+	ret = gsi_dtgrm_pool_create_named(GSI_QP_RCV_SIZE,
+					  "rcv",
+					  &hca->rcv_dtgrm_pool);
 	if (ret < 0) {
 		printk(KERN_ERR "Could not create receive datagram pool\n");
 		goto error6;
@@ -887,16 +888,18 @@
 
 #ifdef GSI_RMPP_SUPPORT
 	if (rmpp) {
-		if (gsi_dtgrm_pool_create(GSI_RMPP_RCV_POOL_SIZE,
-					  &newinfo->rmpp_rcv_dtgrm_pool) < 0) {
+		if (gsi_dtgrm_pool_create_named(GSI_RMPP_RCV_POOL_SIZE,
+						"rmpp-rcv",
+						&newinfo->rmpp_rcv_dtgrm_pool) < 0) {
 			printk(KERN_ERR \
 				 "Could not create RMPP receive pool\n");
 			ret = -ENOMEM;
 			goto error3;
 		}
 
-		if (gsi_dtgrm_pool_create(GSI_RMPP_SND_POOL_SIZE,
-					  &newinfo->rmpp_snd_dtgrm_pool) < 0) {
+		if (gsi_dtgrm_pool_create_named(GSI_RMPP_SND_POOL_SIZE,
+						"rmpp-snd",
+						&newinfo->rmpp_snd_dtgrm_pool) < 0) {
 			printk(KERN_ERR "Could not create RMPP send pool\n");
 			ret = -ENOMEM;
 			goto error4;
@@ -2942,27 +2945,19 @@
 /*
  * Create datagram pool
  */
-#if 0				/* GSI_POOL_TRACE */
-int gsi_dtgrm_pool_create_named(u32 cnt, void **handle, char *modname)
-#else
-int gsi_dtgrm_pool_create(u32 cnt, void **handle)
-#endif
+int gsi_dtgrm_pool_create_named(u32 cnt, char *pool_name, void
**handle)
 {
 	struct gsi_dtgrm_pool_info_st *pool;
 	char name[GSI_POOL_MAX_NAME_LEN];
 
-#if 0				/* GSI_POOL_TRACE */
 	/*
 	 * Sanity check
 	 */
-	if (!modname || (strlen(modname) > (GSI_POOL_MAX_NAME_LEN - 8))) {
+	if (!pool_name || (strlen(pool_name) > (GSI_POOL_MAX_NAME_LEN - 8))) {
 		printk(KERN_ERR "Invalid pool name\n");
 		return -ENOENT;
 	}
-	sprintf(name, "gsi_%s%-d", modname, gsi_pool_cnt++);
-#else
-	sprintf(name, "gsi%-d", gsi_pool_cnt++);
-#endif
+	sprintf(name, "gsi_%s%-d", pool_name, gsi_pool_cnt++);
 
 	pool = kmalloc(sizeof (*pool), GFP_KERNEL);
 	if (!pool) {
@@ -3158,11 +3153,7 @@
  */
 EXPORT_SYMBOL_NOVERS(gsi_reg_class);
 EXPORT_SYMBOL_NOVERS(gsi_dereg_class);
-#if 0				/* GSI_POOL_TRACE */
 EXPORT_SYMBOL_NOVERS(gsi_dtgrm_pool_create_named);
-#else
-EXPORT_SYMBOL_NOVERS(gsi_dtgrm_pool_create);
-#endif
 EXPORT_SYMBOL_NOVERS(gsi_dtgrm_pool_destroy);
 EXPORT_SYMBOL_NOVERS(gsi_dtgrm_pool_get);
 EXPORT_SYMBOL_NOVERS(gsi_dtgrm_pool_put);
Index: gsi.h
===================================================================
--- gsi.h	(revision 634)
+++ gsi.h	(working copy)
@@ -59,10 +59,6 @@
 #include "mad.h"
 #include "class_port_info.h"
 
-#if 0
-#define GSI_POOL_TRACE
-#endif
-
 #define GSI_DTGRM_POOL_MAX_SIZE   5000
 
 #define GSI_QP1_WELL_KNOWN_Q_KEY   0x80010000
@@ -183,14 +179,8 @@
 /*
  * Create a datagram pool (see struct gsi_dtgrm_t)
  */
-#if 0				/* GSI_POOL_TRACE */
-int gsi_dtgrm_pool_create_named(u32 cnt, void **handle, char *modname);
+int gsi_dtgrm_pool_create_named(u32 cnt, char *pool_name, void
**handle);
 
-#define gsi_dtgrm_pool_create(cnt, handle) 
gsi_dtgrm_pool_create_named((cnt), (handle), (char
*)((THIS_MODULE)->name))
-#else
-int gsi_dtgrm_pool_create(u32 cnt, void **handle);
-#endif
-
 /* 
  * Destroy datagram pool
  */





More information about the general mailing list