public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: ynachum@amazon.com
Cc: jgg@nvidia.com, linux-rdma@vger.kernel.org, sleybo@amazon.com,
	matua@amazon.com, mrgolin@amazon.com,
	Firas Jahjah <firasj@amazon.com>
Subject: Re: [PATCH] RDMA/efa: Add rdma write capability to device caps
Date: Sun, 9 Apr 2023 10:32:28 +0300	[thread overview]
Message-ID: <20230409073228.GA14869@unreal> (raw)
In-Reply-To: <20230404154313.35194-1-ynachum@amazon.com>

On Tue, Apr 04, 2023 at 03:43:13PM +0000, ynachum@amazon.com wrote:
> From: Yonatan Nachum <ynachum@amazon.com>
> 
> Add rdma write capability that is propagated from the device to
> rdma-core.
> Enable MR creation with remote write permissions according to this
> device capability.
> 
> Reviewed-by: Firas Jahjah <firasj@amazon.com>
> Reviewed-by: Michael Margolin <mrgolin@amazon.com>
> Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
> ---
>  .../infiniband/hw/efa/efa_admin_cmds_defs.h   | 12 ++++--
>  drivers/infiniband/hw/efa/efa_io_defs.h       | 42 +++++++++++++------
>  drivers/infiniband/hw/efa/efa_verbs.c         |  6 ++-
>  include/uapi/rdma/efa-abi.h                   |  1 +
>  4 files changed, 44 insertions(+), 17 deletions(-)

<...>

>  #endif /* _EFA_IO_H_ */
> diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
> index c27c36418f7f..a394011a598c 100644
> --- a/drivers/infiniband/hw/efa/efa_verbs.c
> +++ b/drivers/infiniband/hw/efa/efa_verbs.c
> @@ -253,6 +253,9 @@ int efa_query_device(struct ib_device *ibdev,
>  		if (EFA_DEV_CAP(dev, DATA_POLLING_128))
>  			resp.device_caps |= EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128;
>  
> +		if (EFA_DEV_CAP(dev, RDMA_WRITE))
> +			resp.device_caps |= EFA_QUERY_DEVICE_CAPS_RDMA_WRITE;
> +
>  		if (dev->neqs)
>  			resp.device_caps |= EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS;
>  
> @@ -1571,7 +1574,8 @@ static struct efa_mr *efa_alloc_mr(struct ib_pd *ibpd, int access_flags,
>  
>  	supp_access_flags =
>  		IB_ACCESS_LOCAL_WRITE |
> -		(EFA_DEV_CAP(dev, RDMA_READ) ? IB_ACCESS_REMOTE_READ : 0);
> +		(EFA_DEV_CAP(dev, RDMA_READ) ? IB_ACCESS_REMOTE_READ : 0) |
> +		(EFA_DEV_CAP(dev, RDMA_WRITE) ? IB_ACCESS_REMOTE_WRITE : 0);
>  
>  	access_flags &= ~IB_ACCESS_OPTIONAL;
>  	if (access_flags & ~supp_access_flags) {
> diff --git a/include/uapi/rdma/efa-abi.h b/include/uapi/rdma/efa-abi.h
> index 74406b4817ce..d94c32f28804 100644
> --- a/include/uapi/rdma/efa-abi.h
> +++ b/include/uapi/rdma/efa-abi.h
> @@ -121,6 +121,7 @@ enum {
>  	EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
>  	EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID     = 1 << 3,
>  	EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
> +	EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,

Why do you need special device capability while all rdma-core users
set IBV_ACCESS_REMOTE_WRITE anyway without relying on anything from
providers?

Thanks

>  };
>  
>  struct efa_ibv_ex_query_device_resp {
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-04-09  7:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 15:43 [PATCH] RDMA/efa: Add rdma write capability to device caps ynachum
2023-04-09  7:32 ` Leon Romanovsky [this message]
2023-04-09 11:28   ` Nachum, Yonatan
2023-04-09 17:21     ` Leon Romanovsky
2023-04-10 12:24       ` Nachum, Yonatan
2023-04-10 12:38         ` Leon Romanovsky
2023-04-10 14:14           ` Nachum, Yonatan
2023-04-13  8:22             ` Leon Romanovsky
2023-04-13 13:43               ` Nachum, Yonatan
2023-04-18 14:03                 ` Nachum, Yonatan
2023-04-21 22:20 ` 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=20230409073228.GA14869@unreal \
    --to=leon@kernel.org \
    --cc=firasj@amazon.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matua@amazon.com \
    --cc=mrgolin@amazon.com \
    --cc=sleybo@amazon.com \
    --cc=ynachum@amazon.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