diff options
author | Steve Wise <swise@opengridcomputing.com> | 2009-02-10 19:38:22 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-02-10 19:38:22 -0500 |
commit | 900f4c16c338f742b80f3aa500e12ceb017e86af (patch) | |
tree | 70b527f55d262c531ad2ec622ef947df1e443e46 /drivers/infiniband | |
parent | f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b (diff) |
RDMA/cxgb3: sgl/pbl offset calculation needs 64 bits
The variable 'offset' in iwch_sgl2pbl_map() needs to be a u64.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_qp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c index 19661b2f0406..c84ac5bfb107 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_qp.c +++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c | |||
@@ -195,15 +195,12 @@ static int build_inv_stag(union t3_wr *wqe, struct ib_send_wr *wr, | |||
195 | return 0; | 195 | return 0; |
196 | } | 196 | } |
197 | 197 | ||
198 | /* | ||
199 | * TBD: this is going to be moved to firmware. Missing pdid/qpid check for now. | ||
200 | */ | ||
201 | static int iwch_sgl2pbl_map(struct iwch_dev *rhp, struct ib_sge *sg_list, | 198 | static int iwch_sgl2pbl_map(struct iwch_dev *rhp, struct ib_sge *sg_list, |
202 | u32 num_sgle, u32 * pbl_addr, u8 * page_size) | 199 | u32 num_sgle, u32 * pbl_addr, u8 * page_size) |
203 | { | 200 | { |
204 | int i; | 201 | int i; |
205 | struct iwch_mr *mhp; | 202 | struct iwch_mr *mhp; |
206 | u32 offset; | 203 | u64 offset; |
207 | for (i = 0; i < num_sgle; i++) { | 204 | for (i = 0; i < num_sgle; i++) { |
208 | 205 | ||
209 | mhp = get_mhp(rhp, (sg_list[i].lkey) >> 8); | 206 | mhp = get_mhp(rhp, (sg_list[i].lkey) >> 8); |
@@ -235,8 +232,8 @@ static int iwch_sgl2pbl_map(struct iwch_dev *rhp, struct ib_sge *sg_list, | |||
235 | return -EINVAL; | 232 | return -EINVAL; |
236 | } | 233 | } |
237 | offset = sg_list[i].addr - mhp->attr.va_fbo; | 234 | offset = sg_list[i].addr - mhp->attr.va_fbo; |
238 | offset += ((u32) mhp->attr.va_fbo) % | 235 | offset += mhp->attr.va_fbo & |
239 | (1UL << (12 + mhp->attr.page_size)); | 236 | ((1UL << (12 + mhp->attr.page_size)) - 1); |
240 | pbl_addr[i] = ((mhp->attr.pbl_addr - | 237 | pbl_addr[i] = ((mhp->attr.pbl_addr - |
241 | rhp->rdev.rnic_info.pbl_base) >> 3) + | 238 | rhp->rdev.rnic_info.pbl_base) >> 3) + |
242 | (offset >> (12 + mhp->attr.page_size)); | 239 | (offset >> (12 + mhp->attr.page_size)); |