[openib-general] Re: FW: SDP problems with 64K page size

Roland Dreier rolandd at cisco.com
Sun Sep 25 09:39:34 PDT 2005


    Michael> Roland, I might check in the patch that you posted to
    Michael> work around this problem for 64K page users, until I have
    Michael> a final fix ready.  Is that OK with everyone?

Fine with me... you might want to use this patch instead (change from
min() to min_t() to avoid some compile warnings):


Limit SDP buffers to 16K to avoid overflows with 64K pages.

Signed-off-by: Roland Dreier <rolandd at cisco.com>

Index: infiniband/ulp/sdp/sdp_buff.c
===================================================================
--- infiniband/ulp/sdp/sdp_buff.c	(revision 3531)
+++ infiniband/ulp/sdp/sdp_buff.c	(working copy)
@@ -330,7 +330,7 @@ static struct sdpc_buff *sdp_buff_pool_a
 		return NULL;
 	}
 
-	buff->end         = buff->head + PAGE_SIZE;
+	buff->end         = buff->head + sdp_buff_pool_buff_size();
 	buff->data        = buff->head;
 	buff->tail        = buff->head;
 	buff->sge.lkey    = 0;
@@ -350,7 +350,7 @@ int sdp_buff_pool_init(void)
 	int result;
 
 	main_pool.pool_cache = kmem_cache_create("sdp_buff_pool",
-						  PAGE_SIZE,
+						  sdp_buff_pool_buff_size(),
 						  0, 0,
 						  NULL, NULL);
 	if (!main_pool.pool_cache) {
Index: infiniband/ulp/sdp/sdp_buff.h
===================================================================
--- infiniband/ulp/sdp/sdp_buff.h	(revision 3531)
+++ infiniband/ulp/sdp/sdp_buff.h	(working copy)
@@ -101,6 +101,6 @@ struct sdpc_buff_root {
  */
 #define sdp_buff_q_size(pool) ((pool)->size)
 
-#define sdp_buff_pool_buff_size() PAGE_SIZE
+#define sdp_buff_pool_buff_size() min_t(int, PAGE_SIZE, 16384)
 
 #endif /* _SDP_BUFF_H */



More information about the general mailing list