Blob Blame History Raw
From: Lijun Ou <oulijun@huawei.com>
Date: Sat, 8 Dec 2018 18:40:07 +0800
Subject: RDMA/hns: Init qp context when modify qp from reset to init
Patch-mainline: v5.0-rc1
Git-commit: 9f5071010347b2134e1139dca2396a0cea8130dc
References: bsc#1104427 FATE#326416

It needs to clear qp context previous when init qp context.  Otherwise,
the newly created qp context residue has the contents of the qp context
before the uninstall, and the qp context content is disordered, causing
the task to fail.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -3687,6 +3687,7 @@ static int hns_roce_v2_modify_qp(struct
 	 */
 	memset(qpc_mask, 0xff, sizeof(*qpc_mask));
 	if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
+		memset(qpc_mask, 0, sizeof(*qpc_mask));
 		modify_qp_reset_to_init(ibqp, attr, attr_mask, context,
 					qpc_mask);
 	} else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_INIT) {