mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Boeuf, Sebastien" <sebastien.boeuf@intel.com>
To: "eperezma@redhat.com" <eperezma@redhat.com>
Cc: "virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	"mst@redhat.com" <mst@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 4/4] vdpa_sim: Implement resume vdpa op
Date: Wed, 19 Oct 2022 09:37:37 +0000	[thread overview]
Message-ID: <c1849397292bd036132c15836d0ed8e8e4d5b27c.camel@intel.com> (raw)
In-Reply-To: <CAJaqyWdePmapASK060=k+LvqHJHWppMApcQ65N2=THfuCmbjkw@mail.gmail.com>

On Wed, 2022-10-19 at 11:31 +0200, Eugenio Perez Martin wrote:
> On Tue, Oct 18, 2022 at 10:38 AM <sebastien.boeuf@intel.com> wrote:
> > 
> > From: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > 
> > Implement resume operation for vdpa_sim devices, so vhost-vdpa will
> > offer that backend feature and userspace can effectively resume the
> > device.
> > 
> > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > ---
> >  drivers/vdpa/vdpa_sim/vdpa_sim.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > index b071f0d842fb..05e3802fb746 100644
> > --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > @@ -527,6 +527,18 @@ static int vdpasim_suspend(struct vdpa_device
> > *vdpa)
> >         return 0;
> >  }
> > 
> > +static int vdpasim_resume(struct vdpa_device *vdpa)
> > +{
> > +       struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
> > +       int i;
> > +
> > +       spin_lock(&vdpasim->lock);
> > +       vdpasim->running = true;
> > +       spin_unlock(&vdpasim->lock);
> > +
> > +       return 0;
> > +}
> > +
> 
> To never kick at resuming is not the right thing to do :).
> 
> Maybe to store in the vdpasim_virtqueue if it was kicked during the
> suspend window?
> 
> Thanks!

Let's hear what Michael think about this approach?
I just want to make sure we're all on the same page before I send the
next version :)

Thanks,
Sebastien

> 
> 
> 
> >  static size_t vdpasim_get_config_size(struct vdpa_device *vdpa)
> >  {
> >         struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
> > @@ -717,6 +729,7 @@ static const struct vdpa_config_ops
> > vdpasim_config_ops = {
> >         .set_status             = vdpasim_set_status,
> >         .reset                  = vdpasim_reset,
> >         .suspend                = vdpasim_suspend,
> > +       .resume                 = vdpasim_resume,
> >         .get_config_size        = vdpasim_get_config_size,
> >         .get_config             = vdpasim_get_config,
> >         .set_config             = vdpasim_set_config,
> > @@ -750,6 +763,7 @@ static const struct vdpa_config_ops
> > vdpasim_batch_config_ops = {
> >         .set_status             = vdpasim_set_status,
> >         .reset                  = vdpasim_reset,
> >         .suspend                = vdpasim_suspend,
> > +       .resume                 = vdpasim_resume,
> >         .get_config_size        = vdpasim_get_config_size,
> >         .get_config             = vdpasim_get_config,
> >         .set_config             = vdpasim_set_config,
> > --
> > 2.34.1
> > 
> > -------------------------------------------------------------------
> > --
> > Intel Corporation SAS (French simplified joint stock company)
> > Registered headquarters: "Les Montalets"- 2, rue de Paris,
> > 92196 Meudon Cedex, France
> > Registration Number:  302 456 199 R.C.S. NANTERRE
> > Capital: 5 208 026.16 Euros
> > 
> > This e-mail and any attachments may contain confidential material
> > for
> > the sole use of the intended recipient(s). Any review or
> > distribution
> > by others is strictly prohibited. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> > 
> 

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 5 208 026.16 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

      reply	other threads:[~2022-10-19 10:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  8:37 [PATCH v4 0/4] vdpa: Add resume operation sebastien.boeuf
2022-10-18  8:37 ` [PATCH v4 1/4] " sebastien.boeuf
2022-10-18  8:37 ` [PATCH v4 2/4] vhost-vdpa: Introduce RESUME backend feature bit sebastien.boeuf
2022-10-18  8:37 ` [PATCH v4 3/4] vhost-vdpa: uAPI to resume the device sebastien.boeuf
2022-10-18  8:37 ` [PATCH v4 4/4] vdpa_sim: Implement resume vdpa op sebastien.boeuf
2022-10-18 10:53   ` kernel test robot
2022-10-19  9:31   ` Eugenio Perez Martin
2022-10-19  9:37     ` Boeuf, Sebastien [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=c1849397292bd036132c15836d0ed8e8e4d5b27c.camel@intel.com \
    --to=sebastien.boeuf@intel.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.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

all inboxes | Powered by JetHome®