All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: leon@kernel.org
Cc: dledford@redhat.com, jgg@mellanox.com,
	linux-rdma@vger.kernel.org, KaiShen@linux.alibaba.com,
	chengyou@linux.alibaba.com
Subject: [PATCH rdma-core 4/5] RDMA-CORE/erdma: Add the application interface
Date: Fri, 24 Dec 2021 14:55:21 +0800	[thread overview]
Message-ID: <20211224065522.29734-5-chengyou@linux.alibaba.com> (raw)
In-Reply-To: <20211224065522.29734-1-chengyou@linux.alibaba.com>

Add the application interface to rdma-core, and make rdma-core can
recogize erdma provider.

Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
---
 kernel-headers/rdma/erdma-abi.h           | 49 +++++++++++++++++++++++
 kernel-headers/rdma/ib_user_ioctl_verbs.h |  1 +
 libibverbs/verbs.h                        |  1 +
 providers/erdma/erdma_abi.h               | 21 ++++++++++
 4 files changed, 72 insertions(+)
 create mode 100644 kernel-headers/rdma/erdma-abi.h
 create mode 100644 providers/erdma/erdma_abi.h

diff --git a/kernel-headers/rdma/erdma-abi.h b/kernel-headers/rdma/erdma-abi.h
new file mode 100644
index 00000000..e3ceef30
--- /dev/null
+++ b/kernel-headers/rdma/erdma-abi.h
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
+/*
+ * Copyright (c) 2020-2021, Alibaba Group.
+ */
+
+#ifndef __ERDMA_USER_H__
+#define __ERDMA_USER_H__
+
+#include <linux/types.h>
+
+#define ERDMA_ABI_VERSION       1
+
+struct erdma_ureq_create_cq {
+	__u64 db_record_va;
+	__u64 qbuf_va;
+	__u32 qbuf_len;
+	__u32 rsvd0;
+};
+
+struct erdma_uresp_create_cq {
+	__u32 cq_id;
+	__u32 num_cqe;
+};
+
+struct erdma_ureq_create_qp {
+	__u64 db_record_va;
+	__u64 qbuf_va;
+	__u32 qbuf_len;
+	__u32 rsvd0;
+};
+
+struct erdma_uresp_create_qp {
+	__u32 qp_id;
+	__u32 num_sqe;
+	__u32 num_rqe;
+	__u32 rq_offset;
+};
+
+struct erdma_uresp_alloc_ctx {
+	__u32 dev_id;
+	__u32 pad;
+	__u32 sdb_type;
+	__u32 sdb_offset;
+	__u64 sdb;
+	__u64 rdb;
+	__u64 cdb;
+};
+
+#endif
diff --git a/kernel-headers/rdma/ib_user_ioctl_verbs.h b/kernel-headers/rdma/ib_user_ioctl_verbs.h
index 3072e5d6..7dd56210 100644
--- a/kernel-headers/rdma/ib_user_ioctl_verbs.h
+++ b/kernel-headers/rdma/ib_user_ioctl_verbs.h
@@ -250,6 +250,7 @@ enum rdma_driver_id {
 	RDMA_DRIVER_QIB,
 	RDMA_DRIVER_EFA,
 	RDMA_DRIVER_SIW,
+	RDMA_DRIVER_ERDMA,
 };
 
 enum ib_uverbs_gid_type {
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 36b41425..c2165ec1 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -2221,6 +2221,7 @@ extern const struct verbs_device_ops verbs_provider_rxe;
 extern const struct verbs_device_ops verbs_provider_siw;
 extern const struct verbs_device_ops verbs_provider_vmw_pvrdma;
 extern const struct verbs_device_ops verbs_provider_all;
+extern const struct verbs_device_ops verbs_provider_erdma;
 extern const struct verbs_device_ops verbs_provider_none;
 void ibv_static_providers(void *unused, ...);
 
diff --git a/providers/erdma/erdma_abi.h b/providers/erdma/erdma_abi.h
new file mode 100644
index 00000000..d95cbf34
--- /dev/null
+++ b/providers/erdma/erdma_abi.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 or OpenIB.org BSD (MIT) See COPYING file */
+/*
+ * Authors: Cheng Xu <chengyou@linux.alibaba.com>
+ * Copyright (c) 2020-2021, Alibaba Group.
+ */
+
+#ifndef __ERDMA_ABI_H__
+#define __ERDMA_ABI_H__
+
+#include <infiniband/kern-abi.h>
+#include <rdma/erdma-abi.h>
+#include <kernel-abi/erdma-abi.h>
+
+DECLARE_DRV_CMD(erdma_cmd_alloc_context, IB_USER_VERBS_CMD_GET_CONTEXT,
+		empty, erdma_uresp_alloc_ctx);
+DECLARE_DRV_CMD(erdma_cmd_create_cq, IB_USER_VERBS_CMD_CREATE_CQ,
+		erdma_ureq_create_cq, erdma_uresp_create_cq);
+DECLARE_DRV_CMD(erdma_cmd_create_qp, IB_USER_VERBS_CMD_CREATE_QP,
+		erdma_ureq_create_qp, erdma_uresp_create_qp);
+
+#endif
-- 
2.27.0


  parent reply	other threads:[~2021-12-24  6:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24  6:55 [PATCH rdma-core 0/5] Elastic RDMA Adapter (ERDMA) userspace provider driver Cheng Xu
2021-12-24  6:55 ` [PATCH rdma-core 1/5] RDMA-CORE/erdma: Add userspace verbs related header files Cheng Xu
2021-12-27  5:48   ` Devesh Sharma
2021-12-27  6:46     ` Cheng Xu
2022-01-03 23:52       ` Jason Gunthorpe
2022-01-05  1:55         ` Cheng Xu
2021-12-24  6:55 ` [PATCH rdma-core 2/5] RDMA-CORE/erdma: Add userspace verbs implementation Cheng Xu
2021-12-27  6:29   ` Devesh Sharma
2021-12-27  7:59     ` Cheng Xu
2021-12-28 12:17       ` [External] : " Devesh Sharma
2021-12-24  6:55 ` [PATCH rdma-core 3/5] RDMA-CORE/erdma: Add the main module of the provider Cheng Xu
2021-12-24  6:55 ` Cheng Xu [this message]
2021-12-24  6:55 ` [PATCH rdma-core 5/5] RDMA-CORE/erdma: Add to the build environment Cheng Xu

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=20211224065522.29734-5-chengyou@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=KaiShen@linux.alibaba.com \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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.