aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPramod Kumar <pramod@chelsio.com>2014-11-21 10:36:35 -0500
committerRoland Dreier <roland@purestorage.com>2014-12-15 21:10:46 -0500
commit123bc2a27aa4cd18a5fe4f5d66254e4863870362 (patch)
treee8660a877ac4dc5e564596a6aef98c91a0419af2
parent63a71ba6178a1989dcea1c5f595b6c6a3d48d6d9 (diff)
RDMA/cxgb4: Configure 0B MRs to match HW implementation
0B MRs need some tweaks to work correctly with HW. When writing the TPTE, if the MR length is zero we now: 1) turn off all permissions 2) set the length to -1 While functionality/capabilities of the MR are the same with these changes, it resolves a dapltest 0B RDMA Read test failure. Based on original work by Steve Wise <swise@opengridcomputing.com>. Signed-off-by: Pramod Kumar <pramod@chelsio.com> Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/cxgb4/mem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index 0744455cd88b..6bf14d803e5a 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -369,9 +369,11 @@ static int register_mem(struct c4iw_dev *rhp, struct c4iw_pd *php,
369 int ret; 369 int ret;
370 370
371 ret = write_tpt_entry(&rhp->rdev, 0, &stag, 1, mhp->attr.pdid, 371 ret = write_tpt_entry(&rhp->rdev, 0, &stag, 1, mhp->attr.pdid,
372 FW_RI_STAG_NSMR, mhp->attr.perms, 372 FW_RI_STAG_NSMR, mhp->attr.len ?
373 mhp->attr.perms : 0,
373 mhp->attr.mw_bind_enable, mhp->attr.zbva, 374 mhp->attr.mw_bind_enable, mhp->attr.zbva,
374 mhp->attr.va_fbo, mhp->attr.len, shift - 12, 375 mhp->attr.va_fbo, mhp->attr.len ?
376 mhp->attr.len : -1, shift - 12,
375 mhp->attr.pbl_size, mhp->attr.pbl_addr); 377 mhp->attr.pbl_size, mhp->attr.pbl_addr);
376 if (ret) 378 if (ret)
377 return ret; 379 return ret;