All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weihang Li <liweihang@huawei.com>
To: <dledford@redhat.com>, <jgg@nvidia.com>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
	<linuxarm@huawei.com>, Yangyang Li <liyangyang20@huawei.com>,
	Weihang Li <liweihang@huawei.com>
Subject: [PATCH for-next 05/10] RDMA/hns: Delete unnecessary branch of hns_roce_v2_query_qp
Date: Fri, 18 Jun 2021 18:10:15 +0800	[thread overview]
Message-ID: <1624011020-16992-6-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1624011020-16992-1-git-send-email-liweihang@huawei.com>

From: Yangyang Li <liyangyang20@huawei.com>

When query_qp is called by userspace, max_send_wr and max_send_sge are set
to 0 by the kernel driver. However, the userspace does not use these two
return values from the kernel driver, but uses its own calculated values.
So there is no need for special treatment.

Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC")
Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 65ed472..8d8f4d4 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -5403,13 +5403,8 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
 	qp_attr->cap.max_recv_sge = hr_qp->rq.max_gs - hr_qp->rq.rsv_sge;
 	qp_attr->cap.max_inline_data = hr_qp->max_inline_data;
 
-	if (!ibqp->uobject) {
-		qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
-		qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;
-	} else {
-		qp_attr->cap.max_send_wr = 0;
-		qp_attr->cap.max_send_sge = 0;
-	}
+	qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
+	qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;
 
 	qp_init_attr->qp_context = ibqp->qp_context;
 	qp_init_attr->qp_type = ibqp->qp_type;
-- 
2.7.4


  parent reply	other threads:[~2021-06-18 10:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 10:10 [PATCH for-next 00/10] RDMA/hns: Updates for 5.14 Weihang Li
2021-06-18 10:10 ` [PATCH for-next 01/10] RDMA/hns: Force rewrite inline flag of WQE Weihang Li
2021-06-18 10:10 ` [PATCH for-next 02/10] RDMA/hns: Fix uninitialized variable Weihang Li
2021-06-18 10:10 ` [PATCH for-next 03/10] RDMA/hns: Fix some print issues Weihang Li
2021-06-18 10:10 ` [PATCH for-next 04/10] RDMA/hns: Add member assignments for qp_init_attr Weihang Li
2021-06-18 10:10 ` Weihang Li [this message]
2021-06-18 10:10 ` [PATCH for-next 06/10] RDMA/hns: Clean definitions of EQC structure Weihang Li
2021-06-18 10:10 ` [PATCH for-next 07/10] RDMA/hns: Modify function return value type Weihang Li
2021-06-18 10:10 ` [PATCH for-next 08/10] RDMA/hns: Encapsulate flushing CQE as a function Weihang Li
2021-06-18 10:10 ` [PATCH for-next 09/10] RDMA/hns: Simplify the judgment in hns_roce_v2_post_send() Weihang Li
2021-06-18 10:10 ` [PATCH for-next 10/10] RDMA/hns: Fix spelling mistakes of original Weihang Li
2021-06-22 18:25 ` [PATCH for-next 00/10] RDMA/hns: Updates for 5.14 Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1624011020-16992-6-git-send-email-liweihang@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liyangyang20@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.