From: Damien Le Moal <dlemoal@kernel.org>
To: Alistair Francis <Alistair.Francis@wdc.com>,
"mani@kernel.org" <mani@kernel.org>,
"cassel@kernel.org" <cassel@kernel.org>
Cc: "alistair23@gmail.com" <alistair23@gmail.com>,
"jasowangio@gmail.com" <jasowangio@gmail.com>,
"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
"den@valinux.co.jp" <den@valinux.co.jp>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"eperezma@redhat.com" <eperezma@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Frank.Li@kernel.org" <Frank.Li@kernel.org>,
"mie@igel.co.jp" <mie@igel.co.jp>,
"mkp@kernel.org" <mkp@kernel.org>,
"mst@redhat.com" <mst@redhat.com>,
"James.Bottomley@hansenpartnership.com"
<James.Bottomley@hansenpartnership.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"kishon@kernel.org" <kishon@kernel.org>
Subject: Re: [PATCH 0/2] scsi: Initial commit of VirtIO PCIe Endpoint Driver
Date: Fri, 4 Sep 2026 13:41:20 +0900 [thread overview]
Message-ID: <d4bd2363-48d4-4fe9-838d-7ef4a0f4e0e0@kernel.org> (raw)
In-Reply-To: <2daeb43d582f0d960370fcd415c3b5bd3d94c67c.camel@wdc.com>
On 9/4/26 12:19, Alistair Francis wrote:
>>> Most of these pain points will go away if you use virtio-msg [1]
>>> transport
>>> instead of the virtio-pci transport. Using the virtio-pci transport
>>> on a real
>>> PCIe device without a way to trap and emulate the config space
>>> requests will
>>> always be racy.
>>
>> There is nothing inherently racy about the config space. It is about
>> the fact
>> that most PCI endpoint controllers:
>> 1) Do not raise an interrupt when PCI BARs or config space is written
>> by the
>> host RC, and
>> 2) All PCI endpoint controllers that Linux supports do not allow
>> drivers to
>> create extended capabilities in the config space that can then be
>> emulated in
>> the endpoint driver (enabling that would require 1 to be supported,
>> obviously).
>>
>> (2) can be delt with quirks. Not great, but simple enough. And in
>> this case, we
>> need it more because of the virtio-pci specs, which are not great to
>> start with.
>>
>> And for (1), the only real problem that causes is that an endpoint
>> driver needs
>> to poll PCI BARs/submission queues to see if the host issued
>> commands. Again not
>> great, but that works just fine. Alistair's point about burning a CPU
>> doing that
>> is simply so that we can reduce command latency and get good enough
>> performance.
>
> It is actually racy. If we don't burn a CPU to check we end up racing,
> with the host as we are too slow to update the config space.
How come ? At least for nvme, it does not matter how slow the endpoint is to
pull commands from the SQ: if the SQ becomes full, the host just stops
submitting. There is no race. I would expect virtio-pci/scsi to have a similar
race-safe protocol mechanism. If there is indeed a race, then we are talking
about a deficiency of the protocols rather than the transport.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-09-04 4:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 1:46 [PATCH 0/2] scsi: Initial commit of VirtIO PCIe Endpoint Driver alistair23
2026-09-01 1:46 ` [PATCH 1/2] virtio_pci: Add a quirk to force DMA Map API for certain legacy devices alistair23
2026-09-01 8:43 ` Michael S. Tsirkin
2026-09-04 3:21 ` Alistair Francis
2026-10-02 2:35 ` Alistair Francis
2026-09-01 1:46 ` [PATCH 2/2] scsi: Initial commit of VirtIO PCIe Endpoint Driver alistair23
2026-09-01 2:06 ` sashiko-bot
2026-09-01 9:03 ` Niklas Cassel
2026-09-01 11:04 ` Michael S. Tsirkin
2026-09-01 8:35 ` [PATCH 0/2] " Niklas Cassel
2026-09-03 11:51 ` Manivannan Sadhasivam
2026-09-04 0:12 ` Damien Le Moal
2026-09-04 3:19 ` Alistair Francis
2026-09-04 4:41 ` Damien Le Moal [this message]
2026-09-04 5:26 ` Alistair Francis
2026-09-05 15:46 ` Manivannan Sadhasivam
2026-09-01 9:20 ` Damien Le Moal
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=d4bd2363-48d4-4fe9-838d-7ef4a0f4e0e0@kernel.org \
--to=dlemoal@kernel.org \
--cc=Alistair.Francis@wdc.com \
--cc=Frank.Li@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=alistair23@gmail.com \
--cc=cassel@kernel.org \
--cc=den@valinux.co.jp \
--cc=eperezma@redhat.com \
--cc=jasowangio@gmail.com \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mie@igel.co.jp \
--cc=mkp@kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--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.