From: Jack Morgenstein Date: Wed, 4 Jan 2006 22:42:39 +0000 (-0800) Subject: IB/mthca: fix WQE size calculation in create-srq X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=1d7d2f6f476cf7aa65f9f740a6c932fb75608110;p=linux-edison.git IB/mthca: fix WQE size calculation in create-srq Thinko: 64 bytes is the minimum SRQ WQE size (not the maximum). Signed-off-by: Jack Morgenstein Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index f7d234295ef..e7e153d9c4c 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c @@ -201,7 +201,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, if (mthca_is_memfree(dev)) srq->max = roundup_pow_of_two(srq->max + 1); - ds = min(64UL, + ds = max(64UL, roundup_pow_of_two(sizeof (struct mthca_next_seg) + srq->max_gs * sizeof (struct mthca_data_seg))); srq->wqe_shift = long_log2(ds);