From: Lijun Ou Date: Wed, 12 Dec 2018 09:49:07 +0000 (+0800) Subject: RDMA/hns: Bugfix for the scene without receiver queue X-Git-Tag: archive/raspbian/5.2.17-1+rpi1^2^2^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=72fcec06a808030724f7b93b9c3655c16d5f28cd;p=linux.git RDMA/hns: Bugfix for the scene without receiver queue In some application scenario, the user could not have receive queue when run rdma write or read operation. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe Gbp-Pq: Topic bugfix/arm64/huawei-taishan Gbp-Pq: Name 0028-RDMA-hns-Bugfix-for-the-scene-without-receiver-queue.patch --- diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index efb7e961ca6..de1676e2582 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -503,7 +503,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;