linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Weihang Li <liweihang@huawei.com>
To: <dledford@redhat.com>, <jgg@ziepe.ca>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>, <linuxarm@huawei.com>
Subject: [PATCH v2 for-next 1/4] RDMA/hns: Export hardware capability flags to userspace
Date: Thu, 20 Aug 2020 21:17:46 +0800	[thread overview]
Message-ID: <1597929469-22674-2-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1597929469-22674-1-git-send-email-liweihang@huawei.com>

From: Xi Wang <wangxi11@huawei.com>

The libhns in userspace for HIP09 will use the hardware's capability to
enable some features. So export the hardware capablility flags to userspace
by reusing the reserved fields in structure
"hns_roce_ib_alloc_ucontext_resp".

Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_main.c | 1 +
 include/uapi/rdma/hns-abi.h               | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index 5907cfd..98945df 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -313,6 +313,7 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
 		return -EAGAIN;
 
 	resp.qp_tab_size = hr_dev->caps.num_qps;
+	resp.cap_flags = (u32)hr_dev->caps.flags;
 
 	ret = hns_roce_uar_alloc(hr_dev, &context->uar);
 	if (ret)
diff --git a/include/uapi/rdma/hns-abi.h b/include/uapi/rdma/hns-abi.h
index eb76b38..5c38758 100644
--- a/include/uapi/rdma/hns-abi.h
+++ b/include/uapi/rdma/hns-abi.h
@@ -73,7 +73,7 @@ struct hns_roce_ib_create_qp_resp {
 
 struct hns_roce_ib_alloc_ucontext_resp {
 	__u32	qp_tab_size;
-	__u32	reserved;
+	__u32	cap_flags;
 };
 
 struct hns_roce_ib_alloc_pd_resp {
-- 
2.8.1


  reply	other threads:[~2020-08-20 13:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 13:17 [PATCH v2 for-next 0/4] RDMA/hns: Extend some capabilities for HIP09 Weihang Li
2020-08-20 13:17 ` Weihang Li [this message]
2020-08-27 12:40   ` [PATCH v2 for-next 1/4] RDMA/hns: Export hardware capability flags to userspace Jason Gunthorpe
2020-08-31  7:46     ` liweihang
2020-08-20 13:17 ` [PATCH v2 for-next 2/4] RDMA/hns: Add support for EQE in size of 64 Bytes Weihang Li
2020-08-20 13:17 ` [PATCH v2 for-next 3/4] RDMA/hns: Add support for CQE " Weihang Li
2020-08-20 13:17 ` [PATCH v2 for-next 4/4] RDMA/hns: Add support for QPC in size of 512 Bytes Weihang Li

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=1597929469-22674-2-git-send-email-liweihang@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --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;
as well as URLs for NNTP newsgroup(s).