diff mbox series

[for-rc,5/8] RDMA/hns: Fix the state of rereg mr

Message ID 1548405030-124329-6-git-send-email-oulijun@huawei.com (mailing list archive)
State Changes Requested
Headers show
Series Some hns bugfixes for 5.0-rc3 | expand

Commit Message

Lijun Ou Jan. 25, 2019, 8:30 a.m. UTC
From: Yixian Liu <liuyixian@huawei.com>

The state of mr after reregister operation should be set to
valid state. Otherwise, it will keep the same as the state
before reregistered.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index c68d72c..a1a87dd 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -1942,6 +1942,9 @@  static int hns_roce_v2_rereg_write_mtpt(struct hns_roce_dev *hr_dev,
 	struct hns_roce_v2_mpt_entry *mpt_entry = mb_buf;
 	int ret = 0;
 
+	roce_set_field(mpt_entry->byte_4_pd_hop_st, V2_MPT_BYTE_4_MPT_ST_M,
+		       V2_MPT_BYTE_4_MPT_ST_S, V2_MPT_ST_VALID);
+
 	if (flags & IB_MR_REREG_PD) {
 		roce_set_field(mpt_entry->byte_4_pd_hop_st, V2_MPT_BYTE_4_PD_M,
 			       V2_MPT_BYTE_4_PD_S, pdn);