Skip to content

Commit

Permalink
IB/mthca: Fix check of size in SRQ creation
Browse files Browse the repository at this point in the history
The previous patch for Tavor broke MemFree logic.

The driver should 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).

Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Jack Morgenstein authored and Roland Dreier committed Mar 29, 2006
1 parent 3f89f83 commit a07bacc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mthca/mthca_srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
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);
Expand Down

0 comments on commit a07bacc

Please sign in to comment.