RDMA/hns: Bugfix for the scene without receiver queue
authorLijun Ou <oulijun@huawei.com>
Wed, 12 Dec 2018 09:49:07 +0000 (17:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:22 +0000 (09:21 +0100)
[ Upstream commit 4d103905eb1e4f14cb62fcf962c9d35da7005dea ]

In some application scenario, the user could not have receive queue when
run rdma write or read operation.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_qp.c

index 54d2286..af24698 100644 (file)
@@ -522,7 +522,8 @@ static int hns_roce_qp_has_sq(struct ib_qp_init_attr *attr)
 static int hns_roce_qp_has_rq(struct ib_qp_init_attr *attr)
 {
        if (attr->qp_type == IB_QPT_XRC_INI ||
-           attr->qp_type == IB_QPT_XRC_TGT || attr->srq)
+           attr->qp_type == IB_QPT_XRC_TGT || attr->srq ||
+           !attr->cap.max_recv_wr)
                return 0;
 
        return 1;