All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yishai Hadas <yishaih@mellanox.com>
To: linux-rdma@vger.kernel.org, jgg@mellanox.com, dledford@redhat.com
Cc: saeedm@mellanox.com, yishaih@mellanox.com, maorg@mellanox.com,
	michaelgur@mellanox.com, netdev@vger.kernel.org
Subject: [PATCH rdma-next 09/10] RDMA/core: Add the core support field to METHOD_GET_CONTEXT
Date: Wed,  8 Jan 2020 20:05:39 +0200	[thread overview]
Message-ID: <1578506740-22188-10-git-send-email-yishaih@mellanox.com> (raw)
In-Reply-To: <1578506740-22188-1-git-send-email-yishaih@mellanox.com>

From: Michael Guralnik <michaelgur@mellanox.com>

Add the core support field to METHOD_GET_CONTEXT, this field should
represent capabilities that are not device-specific.

Return support for optional access flags for memory regions. User-space
will use this capability to mask the optional access flags for
unsupporting kernels.

Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
---
 drivers/infiniband/core/uverbs_std_types_device.c | 8 ++++++++
 include/uapi/rdma/ib_user_ioctl_cmds.h            | 1 +
 include/uapi/rdma/ib_user_ioctl_verbs.h           | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/drivers/infiniband/core/uverbs_std_types_device.c b/drivers/infiniband/core/uverbs_std_types_device.c
index 2c59435..ae4a59d 100644
--- a/drivers/infiniband/core/uverbs_std_types_device.c
+++ b/drivers/infiniband/core/uverbs_std_types_device.c
@@ -204,6 +204,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_GET_CONTEXT)(
 	struct uverbs_attr_bundle *attrs)
 {
 	u32 num_comp = attrs->ufile->device->num_comp_vectors;
+	u64 core_support = IB_UVERBS_CORE_SUPPORT_OPTIONAL_MR_ACCESS;
 	int ret;
 
 	ret = uverbs_copy_to(attrs, UVERBS_ATTR_GET_CONTEXT_NUM_COMP_VECTORS,
@@ -211,6 +212,11 @@ static int UVERBS_HANDLER(UVERBS_METHOD_GET_CONTEXT)(
 	if (IS_UVERBS_COPY_ERR(ret))
 		return ret;
 
+	ret = uverbs_copy_to(attrs, UVERBS_ATTR_GET_CONTEXT_CORE_SUPPORT,
+			     &core_support, sizeof(core_support));
+	if (IS_UVERBS_COPY_ERR(ret))
+		return ret;
+
 	ret = ib_alloc_ucontext(attrs);
 	if (ret)
 		return ret;
@@ -227,6 +233,8 @@ static int UVERBS_HANDLER(UVERBS_METHOD_GET_CONTEXT)(
 	UVERBS_METHOD_GET_CONTEXT,
 	UVERBS_ATTR_PTR_OUT(UVERBS_ATTR_GET_CONTEXT_NUM_COMP_VECTORS,
 			    UVERBS_ATTR_TYPE(u32), UA_OPTIONAL),
+	UVERBS_ATTR_PTR_OUT(UVERBS_ATTR_GET_CONTEXT_CORE_SUPPORT,
+			    UVERBS_ATTR_TYPE(u64), UA_OPTIONAL),
 	UVERBS_ATTR_UHW());
 
 DECLARE_UVERBS_NAMED_METHOD(
diff --git a/include/uapi/rdma/ib_user_ioctl_cmds.h b/include/uapi/rdma/ib_user_ioctl_cmds.h
index da6c63c..d4ddbe4 100644
--- a/include/uapi/rdma/ib_user_ioctl_cmds.h
+++ b/include/uapi/rdma/ib_user_ioctl_cmds.h
@@ -84,6 +84,7 @@ enum uverbs_attrs_query_port_cmd_attr_ids {
 
 enum uverbs_attrs_get_context_attr_ids {
 	UVERBS_ATTR_GET_CONTEXT_NUM_COMP_VECTORS,
+	UVERBS_ATTR_GET_CONTEXT_CORE_SUPPORT,
 };
 
 enum uverbs_attrs_create_cq_cmd_attr_ids {
diff --git a/include/uapi/rdma/ib_user_ioctl_verbs.h b/include/uapi/rdma/ib_user_ioctl_verbs.h
index 2a165f4..a640bb8 100644
--- a/include/uapi/rdma/ib_user_ioctl_verbs.h
+++ b/include/uapi/rdma/ib_user_ioctl_verbs.h
@@ -44,6 +44,10 @@
 #define IB_UVERBS_ACCESS_OPTIONAL_FIRST (1 << 20)
 #define IB_UVERBS_ACCESS_OPTIONAL_LAST (1 << 29)
 
+enum ib_uverbs_core_support {
+	IB_UVERBS_CORE_SUPPORT_OPTIONAL_MR_ACCESS = 1 << 0,
+};
+
 enum ib_uverbs_access_flags {
 	IB_UVERBS_ACCESS_LOCAL_WRITE = 1 << 0,
 	IB_UVERBS_ACCESS_REMOTE_WRITE = 1 << 1,
-- 
1.8.3.1


  parent reply	other threads:[~2020-01-08 18:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 18:05 [PATCH rdma-next 00/10] Relaxed ordering memory regions Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 01/10] net/mlx5: Expose relaxed ordering bits Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 02/10] RDMA/core: Add UVERBS_METHOD_ASYNC_EVENT_ALLOC Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 03/10] RDMA/core: Remove ucontext_lock from the uverbs_destry_ufile_hw() path Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 04/10] RDMA/uverbs: Add ioctl command to get a device context Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 05/10] RDMA/uverbs: Verify MR access flags Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 06/10] RDMA/core: Add optional access flags range Yishai Hadas
2020-01-08 18:05 ` [PATCH rdma-next 07/10] RDMA/efa: Allow passing of optional access flags for MR registration Yishai Hadas
2020-01-21 16:37   ` Gal Pressman
2020-01-21 16:57     ` Yishai Hadas
2020-01-22  7:51       ` Gal Pressman
2020-01-08 18:05 ` [PATCH rdma-next 08/10] RDMA/uverbs: Add new relaxed ordering memory region access flag Yishai Hadas
2020-01-09  9:38   ` Sergei Shtylyov
2020-01-15 18:05   ` Jason Gunthorpe
2020-01-08 18:05 ` Yishai Hadas [this message]
2020-01-08 18:05 ` [PATCH rdma-next 10/10] RDMA/mlx5: Set relaxed ordering when requested Yishai Hadas
2020-01-15 18:08 ` [PATCH rdma-next 00/10] Relaxed ordering memory regions Jason Gunthorpe
2020-01-16  9:20   ` Leon Romanovsky
2020-01-16 20:11     ` 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=1578506740-22188-10-git-send-email-yishaih@mellanox.com \
    --to=yishaih@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@mellanox.com \
    --cc=michaelgur@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.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.