From: Cornelia Huck <cohuck@redhat.com>
To: Jason Wang <jasowang@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Eugenio Perez Martin <eperezma@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
virtio-comment@lists.oasis-open.org,
Virtio-Dev <virtio-dev@lists.oasis-open.org>,
Max Gurtovoy <mgurtovoy@nvidia.com>, Oren Duer <oren@nvidia.com>,
Shahaf Shuler <shahafs@nvidia.com>,
Parav Pandit <parav@nvidia.com>, Bodong Wang <bodong@nvidia.com>,
Alexander Mikheev <amikheev@nvidia.com>,
Halil Pasic <pasic@linux.ibm.com>
Subject: [virtio-dev] Re: [virtio-comment] [PATCH V2 2/2] virtio: introduce STOP status bit
Date: Wed, 14 Jul 2021 11:24:42 +0200 [thread overview]
Message-ID: <87sg0hcko5.fsf@redhat.com> (raw)
In-Reply-To: <8da2d88c-760f-8ec8-fa47-806bc491f43f@redhat.com>
On Wed, Jul 14 2021, Jason Wang <jasowang@redhat.com> wrote:
> 在 2021/7/14 下午2:20, Cornelia Huck 写道:
>> On Wed, Jul 14 2021, Jason Wang <jasowang@redhat.com> wrote:
>>> So I had a look at how reset is described for ccw:
>>>
>>> "
>>>
>>> In order to reset a device, a driver sends the CCW_CMD_VDEV_RESET command.
>>>
>>> "
>>>
>>> This implies something similar, that is the success of the command means
>>> the success of the reset.
>> Yes, indeed.
>>
>>> I wonder maybe I can remove the "re-read" from the basic facility and
>>> let the transport to decide what to do.
>>>
>>> - for PCI, if a registers is used, we need re-read
>>> - for CCW, follow the current implication, re-read is not needed and we
>>> can wait/poll for the success of the ccw command
>> If we are going with a status bit, it would be the same as for pci (we
>> have WRITE_STATUS and READ_STATUS commands.)
>
>
> So spec is unclear of the implications of the success of a command:
>
> E.g for RESET (CCW_CMD_VDEV_RESET), the success of the command implies
> the success or the reset.
Yes, sending RESET is basically the ccw equivalent of "write 0 to the
status", and getting a status/interrupt that the command finished
successfully is the equivalent of "get 0 when reading the status back".
[We did not have a "read back status" command originally.]
>
> But for set_status (CCW_CMD_WRITE_STATUS), the success of the command
> does not imply the bit is set by the device.
Yes, the success only indicates that the device has received the command
successfully. It can still refuse to set some values, or only set them
later.
>
> If I understand this correctly, we still need re-read here.
Yes.
[Let me know if we can make this more clear in the spec!]
>
>
>> If we are going with a
>> distinct command, we can skip the re-read.
>
>
> Then it would be better to introduce the STOP as a dedicated device
> facility (as reset):
>
> The device MUST present STOP bit after it has been stopped.
>
> And for PCI:
>
> - it was set via set the bit in the registers
>
> for ccw:
>
> - a distinct command (as reset) is introduced, and STOP is forbidden to
> set via device status?
I think the situation for reset is different: a zero status is a natural
way to express that a device is in its initial state. It does not really
matter whether it is a freshly initialized device, or whether it has
been reset by the driver, or which mechanism the driver is using.
For STOP, we'd end up indicating a certain status, with one way to
actually write the status, and the other a dedicated command. I'd expect
that the driver will still read the status to check whether the STOP bit
is present, as it may take some time, regardless of the transport used
(going by the Linux implementation, the various callbacks to interact
with the device state are assumed to be synchronous, and we have to make
the asynchronous ccw interactions synchronous beneath the covers; if we
stick with that model for STOP, the asynchronous nature of ccw commands
does not buy us anything.)
So, maybe using the same mechanism for every transport is better, if we
end up reading the status back anyway.
>
>
>> (I'd probably go with a more
>> generic 'trigger an action' meta-command, but that would work just the
>> same.)
>>
>>> - for admin virtqueue, it should be something similar to ccw, wait/poll
>>> for the success of the admin virtqueue command
>> Or we should maybe standardize on the admin virtqueue?
>
>
> That's one way to go.
>
>
>> That seems less
>> confusing to me.
>
>
> But it's just one of the possible interface to carry the commands. We
> still need to define the semantic or facility of "stop" first.
>
> And we still need to clarify the implication for the success of each
> specific command as ccw. (E.g whether or not a re-read(get after set) is
> need)
>
> The only difference is the transport: ccw command vs virtqqueue.
Historically, too many differences in how the transports implement
device/driver interactions have lead to some awkwardness (see e.g. the
might_sleep annotations, which are surprising to someone working with
the pci transport.) So I think there's benefit in making the
interactions either very similar, or so different that the transports
can do their own things. (As said above, having an extra ccw command for
STOP is probably only useful if generic code isn't polling the status
for the bit to be set.)
So, maybe either/or
- write STOP to status, read it back (via already existing methods)
- use a virtqueue
The extra ccw command would only make sense if other transports
implemented STOP via e.g. a new register (would that also be an option?)
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
next prev parent reply other threads:[~2021-07-14 9:24 UTC|newest]
Thread overview: 115+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 4:33 [PATCH V2 0/2] Vitqueue State Synchronization Jason Wang
2021-07-06 4:33 ` [PATCH V2 1/2] virtio: introduce virtqueue state as basic facility Jason Wang
2021-07-06 9:32 ` Michael S. Tsirkin
2021-07-06 17:09 ` Eugenio Perez Martin
2021-07-06 19:08 ` Michael S. Tsirkin
2021-07-06 23:49 ` Max Gurtovoy
2021-07-07 2:50 ` Jason Wang
2021-07-07 12:03 ` Max Gurtovoy
2021-07-07 12:11 ` [virtio-comment] " Jason Wang
2021-07-07 2:42 ` Jason Wang
2021-07-07 4:36 ` Jason Wang
2021-07-07 2:41 ` Jason Wang
2021-07-06 12:27 ` [virtio-comment] " Cornelia Huck
2021-07-07 3:29 ` [virtio-dev] " Jason Wang
2021-07-06 4:33 ` [PATCH V2 2/2] virtio: introduce STOP status bit Jason Wang
2021-07-06 9:24 ` [virtio-comment] " Dr. David Alan Gilbert
2021-07-07 3:20 ` Jason Wang
2021-07-09 17:23 ` Eugenio Perez Martin
2021-07-10 20:36 ` Michael S. Tsirkin
2021-07-12 4:00 ` Jason Wang
2021-07-12 9:57 ` Stefan Hajnoczi
2021-07-13 3:27 ` Jason Wang
2021-07-13 8:19 ` Cornelia Huck
2021-07-13 9:13 ` Jason Wang
2021-07-13 11:31 ` Cornelia Huck
2021-07-13 12:23 ` Jason Wang
2021-07-13 12:28 ` Cornelia Huck
2021-07-14 2:47 ` Jason Wang
2021-07-14 6:20 ` Cornelia Huck
2021-07-14 8:53 ` Jason Wang
2021-07-14 9:24 ` Cornelia Huck [this message]
2021-07-15 2:01 ` Jason Wang
2021-07-13 10:00 ` Stefan Hajnoczi
2021-07-13 12:16 ` Jason Wang
2021-07-14 9:53 ` Stefan Hajnoczi
2021-07-14 10:29 ` Jason Wang
2021-07-14 15:07 ` Stefan Hajnoczi
2021-07-14 16:22 ` Max Gurtovoy
2021-07-15 1:38 ` Jason Wang
2021-07-15 9:26 ` Stefan Hajnoczi
2021-07-16 1:48 ` Jason Wang
2021-07-19 12:08 ` Stefan Hajnoczi
2021-07-20 2:46 ` Jason Wang
2021-07-15 21:18 ` Michael S. Tsirkin
2021-07-16 2:19 ` Jason Wang
2021-07-15 1:35 ` Jason Wang
2021-07-15 9:16 ` [virtio-dev] " Stefan Hajnoczi
2021-07-16 1:44 ` Jason Wang
2021-07-19 12:18 ` [virtio-dev] " Stefan Hajnoczi
2021-07-20 2:50 ` Jason Wang
2021-07-20 10:31 ` Cornelia Huck
2021-07-21 2:59 ` Jason Wang
2021-07-15 10:01 ` Stefan Hajnoczi
2021-07-16 2:03 ` Jason Wang
2021-07-16 3:53 ` Jason Wang
2021-07-19 12:45 ` Stefan Hajnoczi
2021-07-20 3:04 ` Jason Wang
2021-07-20 8:50 ` Stefan Hajnoczi
2021-07-20 10:48 ` Cornelia Huck
2021-07-20 12:47 ` Stefan Hajnoczi
2021-07-21 2:29 ` Jason Wang
2021-07-21 10:20 ` Stefan Hajnoczi
2021-07-22 7:33 ` Jason Wang
2021-07-22 10:24 ` Stefan Hajnoczi
2021-07-22 13:08 ` Jason Wang
2021-07-26 15:07 ` Stefan Hajnoczi
2021-07-27 7:43 ` Max Reitz
2021-08-03 6:33 ` Jason Wang
2021-08-03 10:37 ` Stefan Hajnoczi
2021-08-03 11:42 ` Jason Wang
2021-08-03 12:22 ` Dr. David Alan Gilbert
2021-08-04 1:42 ` Jason Wang
2021-08-04 9:07 ` Dr. David Alan Gilbert
2021-08-05 6:38 ` Jason Wang
2021-08-05 8:19 ` Dr. David Alan Gilbert
2021-08-06 6:15 ` Jason Wang
2021-08-08 9:31 ` Max Gurtovoy
2021-08-04 9:20 ` Stefan Hajnoczi
2021-08-05 6:45 ` Jason Wang
2021-08-04 8:38 ` Stefan Hajnoczi
2021-08-04 8:36 ` Stefan Hajnoczi
2021-08-05 6:35 ` Jason Wang
2021-07-19 12:43 ` Stefan Hajnoczi
2021-07-20 3:02 ` Jason Wang
2021-07-20 10:19 ` Stefan Hajnoczi
2021-07-21 2:52 ` Jason Wang
2021-07-21 10:42 ` Stefan Hajnoczi
2021-07-22 2:08 ` Jason Wang
2021-07-22 10:30 ` Stefan Hajnoczi
2021-07-20 12:27 ` Max Gurtovoy
2021-07-20 12:57 ` Stefan Hajnoczi
2021-07-20 13:09 ` Max Gurtovoy
2021-07-21 3:06 ` Jason Wang
2021-07-21 10:48 ` Stefan Hajnoczi
2021-07-21 11:37 ` Max Gurtovoy
2021-07-21 3:09 ` Jason Wang
2021-07-21 11:43 ` Max Gurtovoy
2021-07-22 2:01 ` Jason Wang
2021-07-12 3:53 ` Jason Wang
2021-07-06 12:50 ` [virtio-comment] " Cornelia Huck
2021-07-06 13:18 ` Jason Wang
2021-07-06 14:27 ` [virtio-dev] " Cornelia Huck
2021-07-07 0:05 ` Max Gurtovoy
2021-07-07 3:14 ` Jason Wang
2021-07-07 2:56 ` Jason Wang
2021-07-07 16:45 ` [virtio-comment] " Cornelia Huck
2021-07-08 4:06 ` Jason Wang
2021-07-09 17:35 ` Eugenio Perez Martin
2021-07-12 4:06 ` Jason Wang
2021-07-10 20:40 ` Michael S. Tsirkin
2021-07-12 4:04 ` Jason Wang
2021-07-12 10:12 ` [PATCH V2 0/2] Vitqueue State Synchronization Stefan Hajnoczi
2021-07-13 3:08 ` Jason Wang
2021-07-13 10:30 ` Stefan Hajnoczi
2021-07-13 11:56 ` Jason Wang
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=87sg0hcko5.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=amikheev@nvidia.com \
--cc=bodong@nvidia.com \
--cc=dgilbert@redhat.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=mgurtovoy@nvidia.com \
--cc=mst@redhat.com \
--cc=oren@nvidia.com \
--cc=parav@nvidia.com \
--cc=pasic@linux.ibm.com \
--cc=shahafs@nvidia.com \
--cc=stefanha@redhat.com \
--cc=virtio-comment@lists.oasis-open.org \
--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 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.