From: Cornelia Huck <cohuck@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Virtio-Dev <virtio-dev@lists.oasis-open.org>
Subject: [virtio-dev] Re: [PATCH v4 2/3] virtio: pci support virtqueue reset
Date: Thu, 30 Sep 2021 13:08:18 +0200 [thread overview]
Message-ID: <87lf3e48yl.fsf@redhat.com> (raw)
In-Reply-To: <CACGkMEt4ohctFGKvi5Z95C_YSrHDmSRq0D+9BGsrXx-yspoy9w@mail.gmail.com>
On Thu, Sep 30 2021, Jason Wang <jasowang@redhat.com> wrote:
> On Thu, Sep 30, 2021 at 12:33 AM Cornelia Huck <cohuck@redhat.com> wrote:
>>
>> On Wed, Sep 29 2021, Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
>>
>> > On Tue, 28 Sep 2021 12:20:46 +0200, Cornelia Huck <cohuck@redhat.com> wrote:
>> >> On Tue, Sep 28 2021, Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
>> >> > +The device MUST reset the queue when 1 is written to \field{queue_reset}, and
>> >> > +present a 1 in \field{queue_reset} after the queue has been reset, until the
>> >> > +driver re-enables the queue via \field{queue_enable}. (see \ref{sec:Virtqueues / Virtqueue Reset}).
>> >>
>> >> "...or the device is reset." ?
>> >>
>> >
>> > The device MUST reset the queue when 1 is written to \field{queue_reset}, and
>> > present a 1 in \field{queue_reset} after the queue has been reset, until the
>> > driver re-enables the queue via \field{queue_enable} or the device is reset. (see \ref{sec:Virtqueues / Virtqueue Reset}).
>> >
>> > Is that so? Doesn't it feel necessary?
>>
>> Is queue_reset supposed to persist across device reset? That feels a bit
>> odd to me.
>
> I think it's better to follow e.g the pci "status".
>
> Driver writes 1 to queue_reset. And the device notified the completion
> by presenting 0. This looks easier to be dealt with during device
> reset.
Indeed, that might be more clear, let's go with that (same with MMIO.)
>
>
>>
>> >
>> >
>> >> Maybe also
>> >>
>> >> "The device MAY change the value of \field{queue_size} if the queue has
>> >> been reset." ?
>> >>
>> >> Should it always set that field to the currently maximum supported queue
>> >> size (assuming that can change dynamically)? Do we need some kind of
>> >> synchronization for those changes?
>> >
>> > When the queue is reset, all states of this queue MUST be modified to the
>> > initial value. For example, queue_size MUST be reset to the maximum value
>> > supported by the device. Because in the last reset queue or the entire device
>> > reset process, the driver will modify the queue_size of the device so that its
>> > value may be less than the maximum value.
>>
>> I think the question is whether the device may choose a different
>> initial maximum value once the queue has been reset. If it does change
>> the value, there may be a race where the driver has reset the queue,
>> read queue_reset back, read the max queue size, and the device only then
>> changing the max queue size. Maybe I'm overthinking this.
>
> I think the driver should do the exact same steps as the device initialization.
>
> Not sure it's worth mentioning here.
Hm, we might have similar problems there... but they are probably not
really problems in practice. So just a note that the device may fill in
the fields with different values might be enough. Like
"The device MAY present different default values after queue reset."
?
---------------------------------------------------------------------
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-09-30 11:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 7:55 [PATCH v4 0/3] virtio: introduce VIRTIO_F_RING_RESET for reset queue Xuan Zhuo
2021-09-28 7:55 ` [PATCH v4 1/3] virtio: introduce virtqueue reset as basic facility Xuan Zhuo
2021-09-28 10:06 ` [virtio-dev] " Cornelia Huck
2021-09-29 2:01 ` Xuan Zhuo
2021-09-29 2:19 ` Jason Wang
2021-09-29 16:24 ` Cornelia Huck
2021-09-30 1:21 ` Jason Wang
2021-09-30 11:02 ` Cornelia Huck
2021-09-28 7:55 ` [PATCH v4 2/3] virtio: pci support virtqueue reset Xuan Zhuo
2021-09-28 10:20 ` [virtio-dev] " Cornelia Huck
2021-09-29 2:44 ` Xuan Zhuo
2021-09-29 16:33 ` [virtio-dev] " Cornelia Huck
2021-09-30 1:18 ` Jason Wang
2021-09-30 11:08 ` Cornelia Huck [this message]
2021-10-11 2:42 ` Jason Wang
2021-09-28 7:55 ` [PATCH v4 3/3] virtio: mmio " Xuan Zhuo
2021-09-28 10:43 ` [virtio-dev] " Cornelia Huck
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=87lf3e48yl.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=jasowang@redhat.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=xuanzhuo@linux.alibaba.com \
/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.