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>, Weihang Li <liweihang@huawei.com>
Subject: [PATCH for-next 1/9] RDMA/hns: Avoid enabling RQ inline on UD
Date: Fri, 2 Apr 2021 17:07:26 +0800	[thread overview]
Message-ID: <1617354454-47840-2-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1617354454-47840-1-git-send-email-liweihang@huawei.com>

RQ inline is not supported on UD/GSI QP, it should be disabled in QPC.

Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 7 +++++--
 drivers/infiniband/hw/hns/hns_roce_qp.c    | 4 +++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index cc334d5c..b48bdc9 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -4106,8 +4106,11 @@ static void modify_qp_reset_to_init(struct ib_qp *ibqp,
 		       ((u32)hr_qp->rdb.dma) >> 1);
 	context->rq_db_record_addr = cpu_to_le32(hr_qp->rdb.dma >> 32);
 
-	roce_set_bit(context->byte_76_srqn_op_en, V2_QPC_BYTE_76_RQIE_S,
-		    (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE) ? 1 : 0);
+	if (ibqp->qp_type != IB_QPT_UD && ibqp->qp_type != IB_QPT_GSI)
+		roce_set_bit(context->byte_76_srqn_op_en,
+			     V2_QPC_BYTE_76_RQIE_S,
+			     !!(hr_dev->caps.flags &
+				HNS_ROCE_CAP_FLAG_RQ_INLINE));
 
 	roce_set_field(context->byte_80_rnr_rx_cqn, V2_QPC_BYTE_80_RX_CQN_M,
 		       V2_QPC_BYTE_80_RX_CQN_S, get_cqn(ibqp->recv_cq));
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c
index 268d460..f214bd0 100644
--- a/drivers/infiniband/hw/hns/hns_roce_qp.c
+++ b/drivers/infiniband/hw/hns/hns_roce_qp.c
@@ -487,7 +487,9 @@ static int set_rq_size(struct hns_roce_dev *hr_dev, struct ib_qp_cap *cap,
 					    hr_qp->rq.max_gs);
 
 	hr_qp->rq.wqe_cnt = cnt;
-	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE)
+	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE &&
+	    hr_qp->ibqp.qp_type != IB_QPT_UD &&
+	    hr_qp->ibqp.qp_type != IB_QPT_GSI)
 		hr_qp->rq_inl_buf.wqe_cnt = cnt;
 	else
 		hr_qp->rq_inl_buf.wqe_cnt = 0;
-- 
2.8.1


  reply	other threads:[~2021-04-02  9:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  9:07 [PATCH for-next 0/9] RDMA/hns: Misc updates for 5.13 Weihang Li
2021-04-02  9:07 ` Weihang Li [this message]
2021-04-02  9:07 ` [PATCH for-next 2/9] RDMA/hns: Fix missing assignment of max_inline_data Weihang Li
2021-04-02  9:07 ` [PATCH for-next 3/9] RDMA/hns: Delete redundant condition judgment related to eq Weihang Li
2021-04-02  9:07 ` [PATCH for-next 4/9] RDMA/hns: Delete redundant abnormal interrupt status Weihang Li
2021-04-02  9:07 ` [PATCH for-next 5/9] RDMA/hns: Delete unused members in the structure hns_roce_hw Weihang Li
2021-04-02  9:07 ` [PATCH for-next 6/9] RDMA/hns: Remove unsupported QP types Weihang Li
2021-04-02  9:07 ` [PATCH for-next 7/9] RDMA/hns: Add XRC subtype in QPC and XRC type in SRQC Weihang Li
2021-04-02  9:07 ` [PATCH for-next 8/9] RDMA/hns: Simplify the function config_eqc() Weihang Li
2021-04-08 19:13   ` Jason Gunthorpe
2021-04-09  1:39     ` liweihang
2021-04-02  9:07 ` [PATCH for-next 9/9] RDMA/hns: Prevent le32 from being implicitly converted to u32 Weihang Li
2021-04-08 19:14 ` [PATCH for-next 0/9] RDMA/hns: Misc updates for 5.13 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=1617354454-47840-2-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 \
    /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.