Skip to content

Commit

Permalink
RDMA/cxgb3: fail get_dma_mr on 64 bit arches
Browse files Browse the repository at this point in the history
T3 HW only supports 32 bit MRs.  If the system uses 64 bit memory
addresses, then a registered 32 bit MR will wrap and write to the
wrong memory when used with addresses > 4GB.  To prevent this,
simply fail to allocate an MR on 64 bit machines (other means
of registering memory are still available and software can still
work, we just don't allow this means of memory registration).

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Steve Wise authored and Doug Ledford committed Jul 24, 2015
1 parent d8b2ba7 commit 49fa63d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/infiniband/hw/cxgb3/iwch_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,10 @@ static struct ib_mr *iwch_get_dma_mr(struct ib_pd *pd, int acc)
/*
* T3 only supports 32 bits of size.
*/
if (sizeof(phys_addr_t) > 4) {
pr_warn_once(MOD "Cannot support dma_mrs on this platform.\n");
return ERR_PTR(-ENOTSUPP);
}
bl.size = 0xffffffff;
bl.addr = 0;
kva = 0;
Expand Down

0 comments on commit 49fa63d

Please sign in to comment.