public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: jgg@ziepe.ca, Dean Luick <dean.luick@cornelisnetworks.com>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next] RDMA/core: Add writev to uverbs file descriptor
Date: Mon, 16 Mar 2026 15:46:02 +0200	[thread overview]
Message-ID: <20260316134602.GA61385@unreal> (raw)
In-Reply-To: <177325041723.52970.2153579331168741909.stgit@awdrv-04.cornelisnetworks.com>

On Wed, Mar 11, 2026 at 01:33:37PM -0400, Dennis Dalessandro wrote:
> From: Dean Luick <dean.luick@cornelisnetworks.com>
> 
> Add a writev pass-through between the uverbs file descriptor and
> infiniband devices.  Interested devices may subscribe to this
> functionality.
> 
> The goal is to keep all the semantics of the user interface the same so
> it's an easy migration to the uverbs cdev from the private cdev. The idea
> is that all the command and control is still ioctl, but the "data path" is
> still using the writev() to pass in the iovecs.
> 
> Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
> 
> ---
> Changes since v1:
> Updated commit message to indiate why we are keeping the
> writev semantic.
> ---
>  drivers/infiniband/core/device.c      |    1 +
>  drivers/infiniband/core/uverbs_main.c |   22 ++++++++++++++++++++++
>  include/rdma/ib_verbs.h               |    2 ++
>  3 files changed, 25 insertions(+)
> 
> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> index 1b5f1ee0a557..e94aebea16e1 100644
> --- a/drivers/infiniband/core/device.c
> +++ b/drivers/infiniband/core/device.c
> @@ -2805,6 +2805,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
>  	SET_DEVICE_OP(dev_ops, set_vf_link_state);
>  	SET_DEVICE_OP(dev_ops, ufile_hw_cleanup);
>  	SET_DEVICE_OP(dev_ops, report_port_event);
> +	SET_DEVICE_OP(dev_ops, write_iter);
>  
>  	SET_OBJ_SIZE(dev_ops, ib_ah);
>  	SET_OBJ_SIZE(dev_ops, ib_counters);
> diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
> index 7b68967a6301..b393d3a0f11c 100644
> --- a/drivers/infiniband/core/uverbs_main.c
> +++ b/drivers/infiniband/core/uverbs_main.c
> @@ -713,6 +713,26 @@ static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma)
>  	return ret;
>  }
>  
> +static ssize_t ib_uverbs_write_iter(struct kiocb *kiocb, struct iov_iter *from)
> +{
> +	struct ib_uverbs_file *file = kiocb->ki_filp->private_data;
> +	struct ib_ucontext *ucontext;
> +	ssize_t ret = -EOPNOTSUPP;
> +	int srcu_key;

I see that this function is modeled after ib_uverbs_mmap(), not
ib_uverbs_write(). Why is ib_safe_file_access(ki_filp) not used here?

Also, this should be documented as a narrow, migration‑only path for the
legacy hfi1 driver, and it must not be used by any other new code.

Thanks

      reply	other threads:[~2026-03-16 13:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 17:33 [PATCH for-next] RDMA/core: Add writev to uverbs file descriptor Dennis Dalessandro
2026-03-16 13:46 ` Leon Romanovsky [this message]

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=20260316134602.GA61385@unreal \
    --to=leon@kernel.org \
    --cc=dean.luick@cornelisnetworks.com \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=jgg@ziepe.ca \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox