RDMA/hns: Not support qp transition from reset to reset for hip06
authoroulijun <oulijun@huawei.com>
Fri, 4 May 2018 02:57:08 +0000 (10:57 +0800)
committerDoug Ledford <dledford@redhat.com>
Wed, 9 May 2018 14:45:18 +0000 (10:45 -0400)
Because hip06 hardware is not support for qp transition from
reset to reset state, it need to return errno when qp
transited from reset to reset. This patch fixes it.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_qp.c

index cdfb774e28ff392f42871839f35dc9344da0bca0..baaf906f7c2e4d2546c4d53333123eca3350c38b 100644 (file)
@@ -956,7 +956,14 @@ int hns_roce_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
        }
 
        if (cur_state == new_state && cur_state == IB_QPS_RESET) {
-               ret = 0;
+               if (hr_dev->caps.min_wqes) {
+                       ret = -EPERM;
+                       dev_err(dev, "cur_state=%d new_state=%d\n", cur_state,
+                               new_state);
+               } else {
+                       ret = 0;
+               }
+
                goto out;
        }