diff mbox

[2/2] cxgb4/rdma: configure 0B MRs to match HW implementation

Message ID 1413452189-5427-3-git-send-email-pramod@chelsio.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Pramod Kumar Oct. 16, 2014, 9:36 a.m. UTC
0B MRs need some tweaks to work correctly with HW.
So when writing the TPTE, if the MR length is zero we now do:

1) turn off all permissions
2) set the length to -1

While functionality/capabilities of the MR is 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>
---
 drivers/infiniband/hw/cxgb4/mem.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Comments

Or Gerlitz Oct. 16, 2014, 10:22 a.m. UTC | #1
On 10/16/2014 12:36 PM, Pramod Kumar wrote:
> 0B MRs need some tweaks to work correctly with HW.

  What's the use case?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise Oct. 16, 2014, 2:17 p.m. UTC | #2
> -----Original Message-----
> From: Or Gerlitz [mailto:ogerlitz@mellanox.com]
> Sent: Thursday, October 16, 2014 5:23 AM
> To: Pramod Kumar
> Cc: linux-rdma@vger.kernel.org; roland@purestorage.com; swise@opengridcomputing.com; hariprasad@chelsio.com
> Subject: Re: [PATCH 2/2] cxgb4/rdma: configure 0B MRs to match HW implementation
> 
> 
> On 10/16/2014 12:36 PM, Pramod Kumar wrote:
> > 0B MRs need some tweaks to work correctly with HW.
> 
>   What's the use case?

The dapltest tool does this if you run the transaction test and do 0B IO. A customer discovered the issue.

Steve.



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index ec7a298..a299ba8 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,
 	int ret;
 
 	ret = write_tpt_entry(&rhp->rdev, 0, &stag, 1, mhp->attr.pdid,
-			      FW_RI_STAG_NSMR, mhp->attr.perms,
+			      FW_RI_STAG_NSMR, mhp->attr.len ?
+			      mhp->attr.perms : 0,
 			      mhp->attr.mw_bind_enable, mhp->attr.zbva,
-			      mhp->attr.va_fbo, mhp->attr.len, shift - 12,
+			      mhp->attr.va_fbo, mhp->attr.len ?
+			      mhp->attr.len : -1, shift - 12,
 			      mhp->attr.pbl_size, mhp->attr.pbl_addr);
 	if (ret)
 		return ret;