diff mbox

[v4,rdma-next,06/10] iw_cxgb4: initialize ib_mr fields for user mrs

Message ID 062d56cc8c77ca5b431dceb1ee304ec0e47e4e48.1520002437.git.swise@opengridcomputing.com (mailing list archive)
State Accepted
Headers show

Commit Message

Steve Wise March 1, 2018, 9:57 p.m. UTC
Some of the struct ib_mr fields weren't getting initialized.  This was
benign, but will cause problems when dumping the mr resource via
nldev/restrack.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 drivers/infiniband/hw/cxgb4/mem.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Leon Romanovsky March 8, 2018, 2:03 p.m. UTC | #1
On Thu, Mar 01, 2018 at 01:57:58PM -0800, Steve Wise wrote:
> Some of the struct ib_mr fields weren't getting initialized.  This was
> benign, but will cause problems when dumping the mr resource via
> nldev/restrack.
>
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  drivers/infiniband/hw/cxgb4/mem.c | 3 +++
>  1 file changed, 3 insertions(+)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
diff mbox

Patch

diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index 7e0eb20..e90f2fd 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -391,6 +391,9 @@  static int finish_mem_reg(struct c4iw_mr *mhp, u32 stag)
 	mhp->attr.stag = stag;
 	mmid = stag >> 8;
 	mhp->ibmr.rkey = mhp->ibmr.lkey = stag;
+	mhp->ibmr.length = mhp->attr.len;
+	mhp->ibmr.iova = mhp->attr.va_fbo;
+	mhp->ibmr.page_size = 1U << (mhp->attr.page_size + 12);
 	pr_debug("mmid 0x%x mhp %p\n", mmid, mhp);
 	return insert_handle(mhp->rhp, &mhp->rhp->mmidr, mhp, mmid);
 }