From: Wenpeng Liang <liangwenpeng@huawei.com>
To: <jgg@nvidia.com>, <leon@kernel.org>
Cc: <linux-rdma@vger.kernel.org>, <linuxarm@huawei.com>,
<liangwenpeng@huawei.com>
Subject: [PATCH for-next 2/4] RDMA/hns: Add more restrack attributes to CQ
Date: Mon, 24 Jan 2022 20:46:22 +0800 [thread overview]
Message-ID: <20220124124624.55352-3-liangwenpeng@huawei.com> (raw)
In-Reply-To: <20220124124624.55352-1-liangwenpeng@huawei.com>
Add arm_st, shift and cqe_size of CQ.
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
---
drivers/infiniband/hw/hns/hns_roce_restrack.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_restrack.c b/drivers/infiniband/hw/hns/hns_roce_restrack.c
index 4420639445a1..a0d601cd2cb6 100644
--- a/drivers/infiniband/hw/hns/hns_roce_restrack.c
+++ b/drivers/infiniband/hw/hns/hns_roce_restrack.c
@@ -15,7 +15,8 @@
#define _HR_REG_CFG(type, h, l) _HR_REG_MASK(h, l), l
#define HR_REG_CFG(field) _HR_REG_CFG(field)
-static int hns_roce_fill_cq(struct sk_buff *msg,
+static int hns_roce_fill_cq(struct hns_roce_cq *hr_cq,
+ struct sk_buff *msg,
struct hns_roce_v2_cq_context *context)
{
static struct {
@@ -24,8 +25,11 @@ static int hns_roce_fill_cq(struct sk_buff *msg,
u32 l;
} reg[] = {
{ "cq_st", HR_REG_CFG(CQC_CQ_ST) },
+ { "arm_st", HR_REG_CFG(CQC_ARM_ST) },
+ { "shift", HR_REG_CFG(CQC_SHIFT) },
{ "ceqn", HR_REG_CFG(CQC_CEQN) },
{ "cqn", HR_REG_CFG(CQC_CQN) },
+ { "cqe_size", HR_REG_CFG(CQC_CQE_SIZE) },
{ "hopnum", HR_REG_CFG(CQC_CQE_HOP_NUM) },
{ "pi", HR_REG_CFG(CQC_CQ_PRODUCER_IDX) },
{ "ci", HR_REG_CFG(CQC_CQ_CONSUMER_IDX) },
@@ -43,6 +47,9 @@ static int hns_roce_fill_cq(struct sk_buff *msg,
(reg[i].l % 32)))
goto err;
+ if (rdma_nl_put_driver_u32_hex(msg, "soft_cq_ci", hr_cq->cons_index))
+ goto err;
+
return 0;
err:
@@ -68,7 +75,7 @@ int hns_roce_fill_res_cq_entry(struct sk_buff *msg, struct ib_cq *ibcq)
if (!table_attr)
return -EMSGSIZE;
- if (hns_roce_fill_cq(msg, &context))
+ if (hns_roce_fill_cq(hr_cq, msg, &context))
goto err_cancel_table;
nla_nest_end(msg, table_attr);
--
2.33.0
next prev parent reply other threads:[~2022-01-24 12:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 12:46 [PATCH for-next 0/4] RDMA/hns: Add more restrack attributes to hns driver Wenpeng Liang
2022-01-24 12:46 ` [PATCH for-next 1/4] RDMA/hns: Refactor the restrack code of CQ Wenpeng Liang
2022-01-24 12:46 ` Wenpeng Liang [this message]
2022-01-24 12:46 ` [PATCH for-next 3/4] RDMA/hns: Add support for QP's restrack attributes Wenpeng Liang
2022-01-25 8:28 ` Leon Romanovsky
2022-01-27 1:29 ` Wenpeng Liang
2022-01-24 12:46 ` [PATCH for-next 4/4] RDMA/hns: Add support for MR's " Wenpeng Liang
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=20220124124624.55352-3-liangwenpeng@huawei.com \
--to=liangwenpeng@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox