All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugenio Perez Martin <eperezma@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev <netdev@vger.kernel.org>,
	virtualization <virtualization@lists.linux-foundation.org>,
	"Michael S. Tsirkin" <mst@redhat.com>, kvm <kvm@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Parav Pandit <parav@nvidia.com>,
	Zhang Min <zhang.min9@zte.com.cn>,
	Harpreet Singh Anand <hanand@xilinx.com>,
	Zhu Lingshan <lingshan.zhu@intel.com>,
	tanuj.kamde@amd.com, "Dawar, Gautam" <gautam.dawar@amd.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Xie Yongji <xieyongji@bytedance.com>,
	Dinan Gunawardena <dinang@xilinx.com>,
	habetsm.xilinx@gmail.com, Eli Cohen <elic@nvidia.com>,
	Pablo Cascon Katchadourian <pabloc@xilinx.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Cindy Lu <lulu@redhat.com>,
	Wu Zongyong <wuzongyong@linux.alibaba.com>,
	ecree.xilinx@gmail.com, "Uminski,
	Piotr" <Piotr.Uminski@intel.com>,
	Martin Porter <martinpo@xilinx.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Si-Wei Liu <si-wei.liu@oracle.com>,
	Longpeng <longpeng2@huawei.com>,
	Martin Petrus Hubertus Habets <martinh@xilinx.com>
Subject: Re: [PATCH v2 0/4] Implement vdpasim stop operation
Date: Wed, 25 May 2022 08:42:52 +0200	[thread overview]
Message-ID: <CAJaqyWd6vwPJqFRrY6z0-Q9CpW-FABE_8+hw77q_x5qXQTXKfw@mail.gmail.com> (raw)
In-Reply-To: <CACGkMEvHRL7a6njivA0+ae-+nXUB9Dng=oaQny0cHu-Ra+bcFg@mail.gmail.com>

On Wed, May 25, 2022 at 4:49 AM Jason Wang <jasowang@redhat.com> wrote:
>
> On Wed, May 25, 2022 at 1:06 AM Eugenio Pérez <eperezma@redhat.com> wrote:
> >
> > Implement stop operation for vdpa_sim devices, so vhost-vdpa will offer
> > that backend feature and userspace can effectively stop the device.
> >
> > This is a must before get virtqueue indexes (base) for live migration,
> > since the device could modify them after userland gets them. There are
> > individual ways to perform that action for some devices
> > (VHOST_NET_SET_BACKEND, VHOST_VSOCK_SET_RUNNING, ...) but there was no
> > way to perform it for any vhost device (and, in particular, vhost-vdpa).
> >
> > After the return of ioctl with stop != 0, the device MUST finish any
> > pending operations like in flight requests. It must also preserve all
> > the necessary state (the virtqueue vring base plus the possible device
> > specific states) that is required for restoring in the future. The
> > device must not change its configuration after that point.
>
> I'd suggest documenting this in the code maybe around ops->stop()?
>

I agree it'd be better to put in the source code, but both
vdpa_config_ops and ops->stop don't have a lot of space for docs.

Would it work to document at drivers/vdpa/vdpa.c:vhost_vdpa_stop() and
redirect config ops like "for more info, see vhost_vdpa_stop"?

Thanks!

> Thanks
>
> >
> > After the return of ioctl with stop == 0, the device can continue
> > processing buffers as long as typical conditions are met (vq is enabled,
> > DRIVER_OK status bit is enabled, etc).
> >
> > In the future, we will provide features similar to VHOST_USER_GET_INFLIGHT_FD
> > so the device can save pending operations.
> >
> > Comments are welcome.
> >
> > v2:
> > * Replace raw _F_STOP with BIT_ULL(_F_STOP).
> > * Fix obtaining of stop ioctl arg (it was not obtained but written).
> > * Add stop to vdpa_sim_blk.
> >
> > Eugenio Pérez (4):
> >   vdpa: Add stop operation
> >   vhost-vdpa: introduce STOP backend feature bit
> >   vhost-vdpa: uAPI to stop the device
> >   vdpa_sim: Implement stop vdpa op
> >
> >  drivers/vdpa/vdpa_sim/vdpa_sim.c     | 21 +++++++++++++++++
> >  drivers/vdpa/vdpa_sim/vdpa_sim.h     |  1 +
> >  drivers/vdpa/vdpa_sim/vdpa_sim_blk.c |  3 +++
> >  drivers/vdpa/vdpa_sim/vdpa_sim_net.c |  3 +++
> >  drivers/vhost/vdpa.c                 | 34 +++++++++++++++++++++++++++-
> >  include/linux/vdpa.h                 |  6 +++++
> >  include/uapi/linux/vhost.h           |  3 +++
> >  include/uapi/linux/vhost_types.h     |  2 ++
> >  8 files changed, 72 insertions(+), 1 deletion(-)
> >
> > --
> > 2.27.0
> >
> >
>


      reply	other threads:[~2022-05-25  6:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 17:06 [PATCH v2 0/4] Implement vdpasim stop operation Eugenio Pérez
2022-05-24 17:06 ` [PATCH v2 1/4] vdpa: Add " Eugenio Pérez
2022-05-24 17:06 ` [PATCH v2 2/4] vhost-vdpa: introduce STOP backend feature bit Eugenio Pérez
2022-05-24 17:06 ` [PATCH v2 3/4] vhost-vdpa: uAPI to stop the device Eugenio Pérez
2022-05-25  2:51   ` Jason Wang
2022-05-25  2:51     ` Jason Wang
2022-05-25  6:43     ` Eugenio Perez Martin
2022-05-24 17:06 ` [PATCH v2 4/4] vdpa_sim: Implement stop vdpa op Eugenio Pérez
2022-05-25  2:54   ` Jason Wang
2022-05-25  2:54     ` Jason Wang
2022-05-25  8:40     ` Eugenio Perez Martin
2022-05-25  7:41   ` Stefano Garzarella
2022-05-25  7:41     ` Stefano Garzarella
2022-05-25  2:49 ` [PATCH v2 0/4] Implement vdpasim stop operation Jason Wang
2022-05-25  2:49   ` Jason Wang
2022-05-25  6:42   ` Eugenio Perez Martin [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=CAJaqyWd6vwPJqFRrY6z0-Q9CpW-FABE_8+hw77q_x5qXQTXKfw@mail.gmail.com \
    --to=eperezma@redhat.com \
    --cc=Piotr.Uminski@intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=dinang@xilinx.com \
    --cc=ecree.xilinx@gmail.com \
    --cc=elic@nvidia.com \
    --cc=gautam.dawar@amd.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=hanand@xilinx.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lingshan.zhu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longpeng2@huawei.com \
    --cc=lulu@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=martinh@xilinx.com \
    --cc=martinpo@xilinx.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabloc@xilinx.com \
    --cc=parav@nvidia.com \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=tanuj.kamde@amd.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wuzongyong@linux.alibaba.com \
    --cc=xieyongji@bytedance.com \
    --cc=zhang.min9@zte.com.cn \
    /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.