Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: Cornelia Huck <cohuck@redhat.com>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	Max Gurtovoy <mgurtovoy@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>, Oren Duer <oren@nvidia.com>
Subject: Re: [PATCH v2] Add device reset timeout field
Date: Thu, 14 Oct 2021 18:28:35 -0400	[thread overview]
Message-ID: <20211014182437-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <PH0PR12MB5481C5C0EB93191416E36D4EDCB89@PH0PR12MB5481.namprd12.prod.outlook.com>

On Thu, Oct 14, 2021 at 05:35:37PM +0000, Parav Pandit wrote:
> Hi Michael, Cornelia,	
> 
> > From: Parav Pandit
> > Sent: Tuesday, October 12, 2021 2:42 PM
> > 
> > > From: Michael S. Tsirkin <mst@redhat.com>
> > > Sent: Tuesday, October 12, 2021 2:32 PM
> > >
> > > On Tue, Oct 12, 2021 at 08:51:34AM +0000, Parav Pandit wrote:
> > > >
> > > >
> > > > > From: Michael S. Tsirkin <mst@redhat.com>
> > > > > Sent: Monday, October 11, 2021 9:30 PM
> > > > >
> > > > > On Mon, Oct 11, 2021 at 03:44:14PM +0000, Parav Pandit wrote:
> > > > > > > > This is unlikely to work the reset is completed. Because a
> > > > > > > > real device
> > > > > > > implementing this would prefer to do this in fw for 1000
> > > > > > > virtio devices sitting on the physical card.
> > > > > > > > And it is very much driven by such implementation at device devel.
> > > > > > > > So it cannot update the counter value if reset is not
> > > > > > > > completed for the
> > > > > device.
> > > > > > > >
> > > > > > > > I think read only device reset timeout is most elegant
> > > > > > > > option during device
> > > > > > > initialization phase that eliminates infinite loop of today.
> > > > > > >
> > > > > > > Why can't a driver just go ahead and do a timeout regardless?
> > > > > > o.k. lets consider this thought exercise. What is the timeout
> > > > > > value that driver
> > > > > will choose if device doesn't specify one?
> > > > > > I explained in previous thread and you acked that actual fw
> > > > > > based device
> > > > > may take longer to initialize than pure sw implementation backend.
> > > > > > In second example a pre-boot device can take even longer
> > > > > > initialization
> > > time.
> > > > > > Sriov VF device may initialize lot faster.
> > > > > > Instead of driver having such transport, and device specific
> > > > > > checks, (or some
> > > > > very short or very long timeout), we propose, that let device
> > > > > mention such timeout value.
> > > > >
> > > > > Parav I think you are conflating reset with initialization time.
> > > > > initialization is just for host boot which takes seconds anyway -
> > > > > but no, minutes is not reasonable their, either.
> > > > > reset affects guest boot. This needs to complete in milliseconds.
> > > > >
> > > > I cannot promise, but with newer generation devices usually
> > > > functionality
> > > improves.
> > > > Enforcing in milliseconds doesn't look practical for type of devices.
> > > > Some of the block devices may need to establish TCP connections in
> > > > the
> > > backend.
> > > > It is more useful to wait for few more seconds to initialize device
> > > > after power
> > > on the system, instead of giving up booting the server completely.
> > > > For example, a nvme block device starts with a minimum timeout of
> > > 500msec.
> > > >
> > > > Yes, I agree to your point that a device given to a guest VM will
> > > > likely have
> > > very short reset time that should complete in milliseconds.
> > > >
> > > > > This conflation is IMHO one of the problems with this proposal.
> > > >
> > > > Device initialization consist of device reset from the spec section 3.1.1.
> > >
> > > It does. But maybe we need to create a way for driver to distinguish
> > > between the two. When under reset, use a driver supplied timeout.
> > This make sense, because as we discussed when device undergo a reset with
> > active DMA, after timeout expires, driver still cannot cleanup.
> > So this can be short driver decided value as longer timeout is not useful.
> > 
> > > When powering up, use a longer device supplied one.
> > In v0, v1 I initially considered only the powering up case of the device
> > initialization. There was text around that.
> > And v2 I removed the initialization text, and I totally missed the above case with
> > active DMA.
> > This should work.
> > We should word this part of the spec accordingly.
> 
> Below changes are good for v3?
> 1. driver should use device reset time during initialization stage

How does driver identify this though?

> 2. remove feature bit as feature bits are only readable after reset is completed
> 3. device reset timeout field of zero indicates that device doesn't support it.

I'm not sure about 3. I think each transport will need its own way to do it.

So I propose: maybe a capability like this, with a timeout field?
And within VMs, we can just do without, since it got out of reset once
it will surely get out of reset again...

-- 
MST


  reply	other threads:[~2021-10-14 22:28 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 14:10 [PATCH v2] Add device reset timeout field Parav Pandit
2021-10-06 15:22 ` Michael S. Tsirkin
2021-10-06 16:11   ` Parav Pandit
2021-10-06 20:53     ` Michael S. Tsirkin
2021-10-07  3:42       ` Parav Pandit
2021-10-07 16:10         ` [virtio-dev] " Cornelia Huck
2021-10-07 17:58           ` Parav Pandit
2021-10-08 10:00             ` [virtio-dev] " Cornelia Huck
2021-10-08 10:19               ` Parav Pandit
2021-10-08 10:12             ` Michael S. Tsirkin
2021-10-08 10:51               ` Parav Pandit
2021-10-08 11:18                 ` [virtio-dev] " Michael S. Tsirkin
2021-10-08 12:55                   ` Parav Pandit
2021-10-08 10:44         ` Michael S. Tsirkin
2021-10-08 10:59           ` Parav Pandit
2021-10-08 11:21             ` Michael S. Tsirkin
2021-10-08 11:45               ` Parav Pandit
2021-10-08 11:47               ` [virtio-dev] " Cornelia Huck
2021-10-08 12:12                 ` Parav Pandit
2021-10-08 12:57                   ` Michael S. Tsirkin
2021-10-08 13:23                     ` Parav Pandit
2021-10-08 23:09                       ` Michael S. Tsirkin
2021-10-11 14:29                         ` Parav Pandit
2021-10-11 14:59                           ` [virtio-dev] " Cornelia Huck
2021-10-11 15:44                             ` Parav Pandit
2021-10-11 16:00                               ` Michael S. Tsirkin
2021-10-12  8:51                                 ` Parav Pandit
2021-10-12  9:01                                   ` Michael S. Tsirkin
2021-10-12  9:12                                     ` Parav Pandit
2021-10-14 17:35                                       ` Parav Pandit
2021-10-14 22:28                                         ` Michael S. Tsirkin [this message]
2021-10-15  4:36                                           ` Parav Pandit
2021-10-15  5:15                                             ` [virtio-dev] " Jason Wang
2021-10-15  5:20                                               ` Parav Pandit
2021-10-15  6:40                                                 ` Jason Wang
2021-10-15  6:42                                                 ` Jason Wang
2021-10-15  6:48                                                   ` Parav Pandit
2021-10-15  7:02                                                     ` Jason Wang
2021-10-15  8:21                                                       ` Parav Pandit
2021-10-15  8:42                                                         ` Jason Wang
2021-10-22  7:20                                                           ` Parav Pandit
2021-10-25  5:41                                                             ` Jason Wang
2021-10-25  6:11                                                               ` Parav Pandit
2021-10-26  4:03                                                                 ` Jason Wang
2021-10-27  8:04                                                                   ` Parav Pandit
2021-10-27  8:26                                                                     ` Michael S. Tsirkin
2021-10-28  4:01                                                                       ` Parav Pandit
2021-10-28  5:50                                                                         ` Michael S. Tsirkin
2021-10-28  6:06                                                                           ` Parav Pandit
2021-10-15  6:51                                             ` Cornelia Huck
2021-10-15  8:09                                               ` Parav Pandit
2021-10-15  9:25                                                 ` [virtio-dev] " Cornelia Huck
2021-10-22  6:29                                                   ` Parav Pandit
2021-10-11 16:22                               ` [virtio-dev] " Cornelia Huck
2021-10-12 10:35                                 ` Parav Pandit

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=20211014182437-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=oren@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=virtio-dev@lists.oasis-open.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