diff options
author | Mike Marciniszyn <mike.marciniszyn@qlogic.com> | 2011-09-23 13:16:39 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-10-21 12:38:52 -0400 |
commit | 9e1c0e43257b6df1ef012dd37c3f0f93b1ee47af (patch) | |
tree | be40833860d385491b1ac8fa13dffe414954ee76 /drivers/infiniband/hw/qib/qib_iba7220.c | |
parent | cc6ea1385b43487f6ef03bdc91416c8366d28311 (diff) |
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_iba7220.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_iba7220.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c index e1f947446c2a..3f1d562ba898 100644 --- a/drivers/infiniband/hw/qib/qib_iba7220.c +++ b/drivers/infiniband/hw/qib/qib_iba7220.c | |||
@@ -4085,6 +4085,8 @@ static int qib_init_7220_variables(struct qib_devdata *dd) | |||
4085 | /* we always allocate at least 2048 bytes for eager buffers */ | 4085 | /* we always allocate at least 2048 bytes for eager buffers */ |
4086 | ret = ib_mtu_enum_to_int(qib_ibmtu); | 4086 | ret = ib_mtu_enum_to_int(qib_ibmtu); |
4087 | dd->rcvegrbufsize = ret != -1 ? max(ret, 2048) : QIB_DEFAULT_MTU; | 4087 | dd->rcvegrbufsize = ret != -1 ? max(ret, 2048) : QIB_DEFAULT_MTU; |
4088 | BUG_ON(!is_power_of_2(dd->rcvegrbufsize)); | ||
4089 | dd->rcvegrbufsize_shift = ilog2(dd->rcvegrbufsize); | ||
4088 | 4090 | ||
4089 | qib_7220_tidtemplate(dd); | 4091 | qib_7220_tidtemplate(dd); |
4090 | 4092 | ||