From: Klaus Jensen <its@irrelevant.dk>
To: Jinhao Fan <fanjinhao21s@ict.ac.cn>
Cc: qemu-devel <qemu-devel@nongnu.org>,
Keith Busch <kbusch@kernel.org>,
Stefan Hajnoczi <stefanha@gmail.com>,
"open list:nvme" <qemu-block@nongnu.org>
Subject: Re: [PATCH v3 4/4] hw/nvme: add polling support
Date: Fri, 4 Nov 2022 07:32:12 +0100 [thread overview]
Message-ID: <Y2Sx7O4MFHKrvXQA@cormorant.local> (raw)
In-Reply-To: <3ffebed8-997d-e276-bf4a-c75508b0be11@ict.ac.cn>
[-- Attachment #1: Type: text/plain, Size: 718 bytes --]
On Nov 3 21:19, Jinhao Fan wrote:
> On 11/3/2022 8:10 PM, Klaus Jensen wrote:
> > I agree that the spec is a little unclear on this point. In any case, in
> > Linux, when the driver has decided that the sq tail must be updated,
> > it will use this check:
> >
> > (new_idx - event_idx - 1) < (new_idx - old)
>
> When eventidx is already behind, it's like:
>
> 0
> 1 <- event_idx
> 2 <- old
> 3 <- new_idx
> 4
> .
> .
> .
>
> In this case, (new_idx - event_idx - 1) = 3-1-1 = 1 >= (new_idx - old) =
> 3-2=1, so the host won't update sq tail. Where am I wrong in this example?
>
That becomes 1 >= 1, i.e. "true". So this will result in the driver
doing an mmio doorbell write.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-11-04 6:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 9:12 [PATCH v3 0/4] irqfd, iothread and polling support Jinhao Fan
2022-08-27 9:12 ` [PATCH v3 1/4] hw/nvme: support irq(de)assertion with eventfd Jinhao Fan
2022-08-27 9:12 ` [PATCH v3 2/4] hw/nvme: use KVM irqfd when available Jinhao Fan
2022-08-27 9:12 ` [PATCH v3 3/4] hw/nvme: add iothread support Jinhao Fan
2022-10-20 11:13 ` Klaus Jensen
2022-11-03 1:51 ` Jinhao Fan
2022-11-03 12:11 ` Klaus Jensen
2022-11-03 13:10 ` Jinhao Fan
2022-08-27 9:12 ` [PATCH v3 4/4] hw/nvme: add polling support Jinhao Fan
2022-10-20 11:10 ` Klaus Jensen
2022-11-03 2:18 ` Jinhao Fan
2022-11-03 12:10 ` Klaus Jensen
2022-11-03 13:19 ` Jinhao Fan
2022-11-04 6:32 ` Klaus Jensen [this message]
2022-11-08 12:39 ` John Levon
2022-11-08 14:11 ` Klaus Jensen
2022-11-09 4:35 ` Jinhao Fan
2022-10-20 11:16 ` [PATCH v3 0/4] irqfd, iothread and " Klaus Jensen
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=Y2Sx7O4MFHKrvXQA@cormorant.local \
--to=its@irrelevant.dk \
--cc=fanjinhao21s@ict.ac.cn \
--cc=kbusch@kernel.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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 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).