virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: Virtualization List <virtualization@lists.linux-foundation.org>
Subject: Re: [RFC PATCH 8/8] virtio: net: Add freeze, restore handlers to support S4
Date: Fri, 29 Jul 2011 07:31:16 +0300	[thread overview]
Message-ID: <20110729043116.GG31888@redhat.com> (raw)
In-Reply-To: <20110729042802.GD24868@amit-x200.redhat.com>

On Fri, Jul 29, 2011 at 09:58:02AM +0530, Amit Shah wrote:
> On (Fri) 29 Jul 2011 [07:13:35], Michael S. Tsirkin wrote:
> > > +static int virtnet_restore(struct virtio_device *vdev)
> > > +{
> > > +	struct virtnet_info *vi = vdev->priv;
> > > +	struct virtqueue *vqs[3];
> > > +	vq_callback_t *callbacks[] = { skb_recv_done, skb_xmit_done, NULL};
> > > +	const char *names[] = { "input", "output", "control" };
> > > +	int nvqs, err;
> > > +
> > > +	/* We expect two virtqueues, receive then send,
> > > +	 * and optionally control. */
> > > +	nvqs = virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ) ? 3 : 2;
> > > +
> > > +	err = vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names);
> > > +	if (err)
> > > +		return err;
> > > +
> > > +	vi->rvq = vqs[0];
> > > +	vi->svq = vqs[1];
> > > +
> > > +	if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) {
> > > +		vi->cvq = vqs[2];
> > > +	}
> > > +
> > > +	/* Last of all, set up some receive buffers. */
> > > +	try_fill_recv(vi, GFP_KERNEL);

I guess we should schedule work on failure, as well.

> > 
> > should probably update carrier status too.
> 
> Will add that.
> 
> I think most of these restore routines are incomplete; I just pulled
> in the most important things from the probe routines, but before the
> final submission I'll do a thorough walk-through and ensure I get all
> the bits necessary.
> 
> 		Amit

In some cases, it might be a good idea to use common
code for that.

-- 
MST

  reply	other threads:[~2011-07-29  4:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 14:35 [RFC PATCH 0/8] virtio: Support for hibernation (S4) Amit Shah
2011-07-28 14:35 ` [RFC PATCH 1/8] virtio: pci: switch to new PM API Amit Shah
2011-07-28 14:35 ` [RFC PATCH 2/8] virtio-pci: add PM notification handlers for restore, freeze, thaw, poweroff Amit Shah
2011-07-28 14:35 ` [RFC PATCH 3/8] virtio-pci: save/restore config space across S4 Amit Shah
2011-07-29  4:07   ` Michael S. Tsirkin
2011-07-29  4:20     ` Amit Shah
2011-07-28 14:35 ` [RFC PATCH 4/8] virtio: console: Ignore port name update request if name already set Amit Shah
2011-07-29  4:19   ` Michael S. Tsirkin
2011-07-29  4:26     ` Amit Shah
2011-07-29  4:27       ` Michael S. Tsirkin
2011-07-28 14:35 ` [RFC PATCH 5/8] virtio: console: Use wait_event_freezable instead of _interruptible Amit Shah
2011-07-28 14:35 ` [RFC PATCH 6/8] virtio: console: Add freeze and restore handlers to support S4 Amit Shah
2011-07-28 14:35 ` [RFC PATCH 7/8] virtio: block: Add freeze, " Amit Shah
2011-07-28 14:35 ` [RFC PATCH 8/8] virtio: net: " Amit Shah
2011-07-29  4:13   ` Michael S. Tsirkin
2011-07-29  4:28     ` Amit Shah
2011-07-29  4:31       ` Michael S. Tsirkin [this message]
2011-07-29  5:08         ` Amit Shah
2011-08-10 10:53 ` [RFC PATCH 0/8] virtio: Support for hibernation (S4) Amit Shah

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=20110729043116.GG31888@redhat.com \
    --to=mst@redhat.com \
    --cc=amit.shah@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;
as well as URLs for NNTP newsgroup(s).