[openib-general] [PATCH v2] mthca: return error if set SRQ limit greater than SRQ size

Jack Morgenstein jackm at mellanox.co.il
Sun Mar 26 07:01:12 PST 2006


Previous patch for Tavor broke memfree logic. 

Need to perform limit check only for Tavor.  For memfree, the check is 
incorrect, since ds (WQE stride) is always a power-of-2 (although the 
max_desc_size may not be). 

In Tavor, however, WQE stride and desc_size are the same, and
are not necessarily power-of-2.

The check was really for the WQE stride (and it Tavor, we use max_desc_size
for the stride).

This patch installs over the previous one.

Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>

Index: src/drivers/infiniband/hw/mthca/mthca_srq.c
===================================================================
--- src/drivers/infiniband/hw/mthca/mthca_srq.c	(revision 6005)
+++ src/drivers/infiniband/hw/mthca/mthca_srq.c	(working copy)
@@ -206,7 +206,7 @@ int mthca_alloc_srq(struct mthca_dev *de
 		 roundup_pow_of_two(sizeof (struct mthca_next_seg) +
 				    srq->max_gs * sizeof (struct mthca_data_seg)));
 
-	if (ds > dev->limits.max_desc_sz)
+	if (!mthca_is_memfree(dev) && (ds > dev->limits.max_desc_sz))
 		return -EINVAL;
 
 	srq->wqe_shift = long_log2(ds);



More information about the general mailing list