public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
From: Zhu Lingshan <lingshan.zhu@amd.com>
To: David Stevens <stevensd@chromium.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: "Parav Pandit" <parav@nvidia.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"virtio-comment@lists.linux.dev" <virtio-comment@lists.linux.dev>,
	"Eugenio Pérez" <eperezma@redhat.com>
Subject: Re: [PATCH v5] virtio: introduce SUSPEND bit in device status
Date: Thu, 13 Jun 2024 17:59:12 +0800	[thread overview]
Message-ID: <40c1d6fb-c04e-41b4-a4d3-baf36aba7d15@amd.com> (raw)
In-Reply-To: <CAD=HUj5oeJa3Przmsd+MYDO0AAEhs-4sDvFQoiMhVTjnveNONw@mail.gmail.com>



On 6/13/2024 1:58 PM, David Stevens wrote:
> On Wed, Jun 12, 2024 at 9:20 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>> On Wed, Jun 12, 2024 at 11:26:39AM +0000, Parav Pandit wrote:
>>> No locks are needed. Hypervisor is accessing the admin vq on the PF.
>> I'm not even going to try and get through a jumble of this thread
>> heavily corrupted by outlook and whatnot, but from the glimpses I got
>> this discussion looks like just two people talking past each other.
>> Lingshan, Parav's not the only one bothered by how the device seemingly
>> has to block a transaction until it completes suspend. Parav, I feel how
>> to address this is up to the author to resolve really, leave it at that.
> IIUC, Prava's concern here is that with the current proposal, the
> device's state can't be determined unambiguously by reading the device
> status field. If the SUSPEND bit is 0, it's ambiguous as to whether
> the device is running normally or if it's in the process of
> suspending, and there is a corresponding issue for suspended vs
> resuming. The device and driver can know based on their internal
> information what state the device is in. However, some hypothetical
> admin tool in guest userspace wouldn't be able to tell simply by
> reading the values in the PCI BAR.
>
> Assuming that's actually a problem that we want to solve, then I think
> the most straightforward way to address this would be to use another
> bit in the status field as a SUSPEND_TRANSITION bit, with something
> like:
>
> "After the driver writes or clears the SUSPEND bit, the device MUST
> present the SUSPEND_TRANSITION bit until it completes the requested
> suspend or resume transition. If the device is unable to successfully
> complete the transition, it MUST present DEVICE_NEEDS_RESET."
>
> Doing that would give distinct values for each of the
> running/suspending/suspended/resuming states. That said, although the
> device status field doesn't have a defined width, both the PCI and
> channel transports assume that it's a single byte, so we'd be using
> the last remaining bits those transports have available.
Current spec does not handle status transitions well, not only for SUSPEND and resuming.
other status transitions may also take longer time than expect depends on how
the device is implemented, it can be sluggish if implemented by SW during high traffic,
even when handling FEATURES_OK or present NEEDS_RESET.

This patch wants to copy the mechanism of handling FEATURES_OK, but if we want to
resolve the problem of device status transition, I agree to add a new status bit: TRANSITION.

The device should present TRANSITION until it complete the requested status transition.
Combining the knowledge of the device, the driver can tell the exact device status.

Any thoughts?

Thanks
Zhu Lingshan
>
> -David


  reply	other threads:[~2024-06-13  9:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07  7:42 [PATCH v5] virtio: introduce SUSPEND bit in device status Zhu Lingshan
2024-06-10 16:04 ` Cornelia Huck
2024-06-11  5:17   ` Parav Pandit
2024-06-11  8:26     ` Zhu Lingshan
2024-06-11  8:48       ` Parav Pandit
2024-06-11  9:33         ` Zhu Lingshan
2024-06-11  9:43           ` Parav Pandit
2024-06-11 10:12             ` Zhu Lingshan
2024-06-11 10:37               ` Parav Pandit
2024-06-12  9:19                 ` Zhu Lingshan
2024-06-12 10:07                   ` Parav Pandit
2024-06-12 10:30                     ` Zhu Lingshan
2024-06-12 11:26                       ` Parav Pandit
2024-06-12 12:20                         ` Michael S. Tsirkin
2024-06-13  5:58                           ` David Stevens
2024-06-13  9:59                             ` Zhu Lingshan [this message]
2024-06-15  4:33                               ` Parav Pandit
2024-06-17  2:22                                 ` Jason Wang
2024-06-17  3:00                                   ` Parav Pandit
2024-06-13  9:47                         ` Zhu Lingshan
2024-06-12 12:10     ` Michael S. Tsirkin
2024-06-11  8:20   ` Zhu Lingshan
2024-06-11 16:26     ` Michael S. Tsirkin
2024-06-12  9:53       ` Zhu Lingshan
2024-06-12 12:23         ` Michael S. Tsirkin
2024-06-12  7:43     ` David Stevens

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=40c1d6fb-c04e-41b4-a4d3-baf36aba7d15@amd.com \
    --to=lingshan.zhu@amd.com \
    --cc=cohuck@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=stevensd@chromium.org \
    --cc=virtio-comment@lists.linux.dev \
    /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