diff options
author | Mike Marciniszyn <mike.marciniszyn@qlogic.com> | 2011-09-23 21:16:39 +0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-10-21 20:38:52 +0400 |
commit | 9e1c0e43257b6df1ef012dd37c3f0f93b1ee47af (patch) | |
tree | be40833860d385491b1ac8fa13dffe414954ee76 /drivers/infiniband/hw/qib/qib_iba6120.c | |
parent | cc6ea1385b43487f6ef03bdc91416c8366d28311 (diff) | |
download | linux-9e1c0e43257b6df1ef012dd37c3f0f93b1ee47af.tar.xz |
IB/qib: Eliminate divide/mod in converting idx to egr buf pointer
The context init now saves a shift from rcvegrbufs_perchunk
rcvegrbufs_perchunk_shift using ilog2. A BUG_ON() protects the
power of 2 assumption.
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_iba6120.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_iba6120.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c index d8ca0a0b970d..781a802a321f 100644 --- a/drivers/infiniband/hw/qib/qib_iba6120.c +++ b/drivers/infiniband/hw/qib/qib_iba6120.c @@ -3273,6 +3273,8 @@ static int init_6120_variables(struct qib_devdata *dd) /* we always allocate at least 2048 bytes for eager buffers */ ret = ib_mtu_enum_to_int(qib_ibmtu); dd->rcvegrbufsize = ret != -1 ? max(ret, 2048) : QIB_DEFAULT_MTU; + BUG_ON(!is_power_of_2(dd->rcvegrbufsize)); + dd->rcvegrbufsize_shift = ilog2(dd->rcvegrbufsize); qib_6120_tidtemplate(dd); |