[openib-general] Re: [openib-commits] r1932 - gen2/trunk/src/linux-kernel/infiniband/ulp/sdp

Libor Michalek libor at topspin.com
Tue Mar 1 09:58:21 PST 2005


On Tue, Mar 01, 2005 at 09:46:26AM -0800, Tom Duffy wrote:
> On Tue, 2005-03-01 at 09:43 -0800, libor at openib.org wrote:
> > Modified: gen2/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_buff_p.h
> > ===================================================================
> > --- gen2/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_buff_p.h	2005-02-28 23:43:10 UTC (rev 1931)
> > +++ gen2/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_buff_p.h	2005-03-01 17:43:14 UTC (rev 1932)
> > @@ -74,3 +74,15 @@
> >  };
>
> Checkin turd.

  That's odd. It doesn't make much sense to have a seperate header file
for a single structure which is used in the same place as sdp_buff.h and
four constants. Here's a patch to get rid of the file.

 4 files changed, 28 insertions(+), 91 deletions(-)

-Libor

Signed-off-by: Libor Michalek <libor at topspin.com>

Index: sdp_main.h
===================================================================
--- sdp_main.h	(revision 1932)
+++ sdp_main.h	(working copy)
@@ -115,6 +115,4 @@
 #include "sdp_advt.h"
 #include "sdp_iocb.h"
 
-#include "sdp_buff_p.h"
-
 #endif /* _SDP_MAIN_H */
Index: sdp_dev.h
===================================================================
--- sdp_dev.h	(revision 1932)
+++ sdp_dev.h	(working copy)
@@ -111,8 +111,14 @@
 #define SDP_SEND_POST_FRACTION   0x06
 #define SDP_SEND_POST_SLOW   0x01
 #define SDP_SEND_POST_COUNT  0x0A
-
 /*
+ * Buffer pool initialization defaul values.
+ */
+#define SDP_BUFF_POOL_COUNT_MIN 1024
+#define SDP_BUFF_POOL_COUNT_MAX 1048576
+#define SDP_BUFF_POOL_COUNT_INC 128
+#define SDP_BUFF_POOL_FREE_MARK 1024
+/*
  * SDP experimental parameters.
  */
 
Index: sdp_buff.h
===================================================================
--- sdp_buff.h	(revision 1932)
+++ sdp_buff.h	(working copy)
@@ -76,6 +76,27 @@
 	u32 lkey; /* component of scather/gather list (key) */
 };
 
+struct sdpc_buff_root {
+	/*
+	 * variant
+	 */
+	struct sdpc_buff_q pool;  /* actual pool of buffers */
+	spinlock_t lock;          /* spin lock for pool access */
+	/*
+	 * invariant
+	 */
+	kmem_cache_t *pool_cache; /* cache of pool objects */
+	kmem_cache_t *buff_cache; /* cache of buffer descriptor objects */
+
+	int buff_min;   /* minimum allocated buffers */
+	int buff_max;   /* maximum allocated buffers */
+	int buff_cur;   /* total allocated buffers */
+	int buff_size;	/* size of each buffer in the pool */
+
+	int alloc_inc;  /* allocation increment */
+	int free_mark;  /* start freeing unused buffers */
+};
+
 /*
  * buffer flag defintions
  */
Index: sdp_buff_p.h
===================================================================
--- sdp_buff_p.h	(revision 1932)
+++ sdp_buff_p.h	(working copy)
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2005 Topspin Communications.  All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * $Id$
- */
-
-#ifndef _SDP_BUFF_P_H
-#define _SDP_BUFF_P_H
-/*
- * linux types
- */
-#include <asm/atomic.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-
-#include "sdp_buff.h"
-/*
- * definitions
- */
-#define SDP_BUFF_POOL_COUNT_MIN 1024
-#define SDP_BUFF_POOL_COUNT_MAX 1048576
-#define SDP_BUFF_POOL_COUNT_INC 128
-#define SDP_BUFF_POOL_FREE_MARK 1024
-/*
- * structures
- */
-struct sdpc_buff_root {
-	/*
-	 * variant
-	 */
-	struct sdpc_buff_q pool;  /* actual pool of buffers */
-	spinlock_t lock;          /* spin lock for pool access */
-	/*
-	 * invariant
-	 */
-	kmem_cache_t *pool_cache; /* cache of pool objects */
-	kmem_cache_t *buff_cache; /* cache of buffer descriptor objects */
-
-	int buff_min;   /* minimum allocated buffers */
-	int buff_max;   /* maximum allocated buffers */
-	int buff_cur;   /* total allocated buffers */
-	int buff_size;	/* size of each buffer in the pool */
-
-	int alloc_inc;  /* allocation increment */
-	int free_mark;  /* start freeing unused buffers */
-};
-
-#endif /* _SDP_BUFF_P_H */
-
-
-
-
-
-
-
-
-
-
-
-






More information about the general mailing list