From: Eugenio Perez Martin <eperezma@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Maxime Coquelin <mcoqueli@redhat.com>,
Yongji Xie <xieyongji@bytedance.com>,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Dragos Tatulea DE <dtatulea@nvidia.com>,
jasowang@redhat.com, Cindy Lu <lulu@redhat.com>
Subject: Re: [RFC 1/2] virtio_net: timeout control virtqueue commands
Date: Mon, 16 Mar 2026 10:26:44 +0100 [thread overview]
Message-ID: <CAJaqyWdaMb0EABOL4WB8+PVKPeU4vzD3V22z63N10jzNESO1sQ@mail.gmail.com> (raw)
In-Reply-To: <20260313080611-mutt-send-email-mst@kernel.org>
On Fri, Mar 13, 2026 at 1:06 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Fri, Mar 13, 2026 at 12:32:18PM +0100, Eugenio Perez Martin wrote:
> > On Fri, Mar 13, 2026 at 12:31 PM Eugenio Perez Martin
> > <eperezma@redhat.com> wrote:
> > >
> > > On Sun, Nov 9, 2025 at 10:47 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > >
> > > > On Wed, Nov 05, 2025 at 10:02:48AM +0100, Eugenio Perez Martin wrote:
> > > > > On Tue, Oct 28, 2025 at 3:57 PM Eugenio Perez Martin
> > > > > <eperezma@redhat.com> wrote:
> > > > > >
> > > > > > On Tue, Oct 28, 2025 at 3:42 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > > >
> > > > > > > On Tue, Oct 28, 2025 at 03:37:09PM +0100, Eugenio Perez Martin wrote:
> > > > > > > > On Tue, Oct 28, 2025 at 3:10 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 22, 2025 at 02:55:18PM +0200, Eugenio Perez Martin wrote:
> > > > > > > > > > On Wed, Oct 22, 2025 at 1:43 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Wed, Oct 22, 2025 at 12:50:53PM +0200, Eugenio Perez Martin wrote:
> > > > > > > > > > > > Let me switch to MQ as I think it illustrates the point better.
> > > > > > > > > > > >
> > > > > > > > > > > > IIUC the workflow:
> > > > > > > > > > > > a) virtio-net sends MQ_VQ_PAIRS_SET 2 to the device
> > > > > > > > > > > > b) VDUSE CVQ sends ok to the virtio-net driver
> > > > > > > > > > > > c) VDUSE CVQ sends the command to the VDUSE device
> > > > > > > > > > > > d) Now the virtio-net driver sends virtio-net sends MQ_VQ_PAIRS_SET 1
> > > > > > > > > > > > e) VDUSE CVQ sends ok to the virtio-net driver
> > > > > > > > > > > >
> > > > > > > > > > > > The device didn't process the MQ_VQ_PAIRS_SET 1 command at this point,
> > > > > > > > > > > > so it potentially uses the second rx queue. But, by the standard:
> > > > > > > > > > > >
> > > > > > > > > > > > The device MUST NOT queue packets on receive queues greater than
> > > > > > > > > > > > virtqueue_pairs once it has placed the VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
> > > > > > > > > > > > command in a used buffer.
> > > > > > > > > > > >
> > > > > > > > > > > > So the driver does not expect rx buffers on that queue at all. From
> > > > > > > > > > > > the driver's POV, the device is invalid, and it could mark it as
> > > > > > > > > > > > broken.
> > > > > > > > > > >
> > > > > > > > > > > ok intresting. Note that if userspace processes vqs it should process
> > > > > > > > > > > cvq too. I don't know what to do in this case yet, I'm going on
> > > > > > > > > > > vacation, let me ponder this a bit.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Sure.
> > > > > > > > >
> > > > > > > > > So let me ask you this, how are you going to handle device reset?
> > > > > > > > > Same issue, it seems to me.
> > > > > > > > >
> > > > > > > >
> > > > > > > > Well my proposal is to mark it as broken so it needs to be reset
> > > > > > > > manually.
> > > > > > >
> > > > > > >
> > > > > > > Heh but guest assumes after reset device does not poke at guest
> > > > > > > memory, and will free up and reuse that memory.
> > > > > > > If userspace still pokes at it -> plus plus ungood.
> > > > > > >
> > > > > >
> > > > > > I don't get this part. Once the device is reset, the device should not
> > > > > > poke at guest memory (unless it is malicious or similar). Why would it
> > > > > > do it?
> > > > >
> > > > > Friendly ping.
> > > >
> > > >
> > > >
> > > > OK I thought about it a bunch. A lot of net drivers actually
> > > > just queue ethtool commands and finish them asynchronously.
> > > > Thinkably virtio could expose an API on whether it is safe to
> > > > wait for buffers to be used. virtio-net would then either
> > > > send commands directly or do the asynchronous thing.
> > > > Hmm?
> > > >
> > >
> > > I think it's the best solution too, yes. The series [1] implements for
> > > set_rx_mode. We can do it for all the CVQ commands and then whitelist
> > > them in VDUSE code. Am I missing something? Does anyone foresee any
> > > command that will not be possible to convert?
> > >
> >
> > Adding the [1] link...
> >
> > [1] https://lore.kernel.org/netdev/20260112181626.20117-1-viswanathiyyappan@gmail.com/
>
> what's the status of that one?
>
Still under review.
Aleksandr Loktionov <aleksandr.loktionov@intel.com> added the
Reviewed-by tag to most of patches but he spotted a sync issue in the
realtek 8139cp driver.
https://lore.kernel.org/lkml/IA3PR11MB8986856F0C1BC5A02F29B32EE540A@IA3PR11MB8986.namprd11.prod.outlook.com/
next prev parent reply other threads:[~2026-03-16 9:27 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 13:06 [RFC 0/2] Lift restriction about VDUSE net devices with CVQ Eugenio Pérez
2025-10-07 13:06 ` [RFC 1/2] virtio_net: timeout control virtqueue commands Eugenio Pérez
2025-10-11 7:44 ` Jason Wang
2025-10-14 7:30 ` Eugenio Perez Martin
2025-10-14 8:29 ` Michael S. Tsirkin
2025-10-14 9:14 ` Maxime Coquelin
2025-10-14 9:25 ` Michael S. Tsirkin
2025-10-14 10:21 ` Maxime Coquelin
2025-10-15 4:44 ` Jason Wang
2025-10-15 6:07 ` Michael S. Tsirkin
2025-10-15 6:08 ` Eugenio Perez Martin
2025-10-15 6:33 ` Michael S. Tsirkin
2025-10-15 6:52 ` Eugenio Perez Martin
2025-10-15 7:04 ` Michael S. Tsirkin
2025-10-15 7:45 ` Eugenio Perez Martin
2025-10-15 8:03 ` Maxime Coquelin
2025-10-15 8:09 ` Michael S. Tsirkin
2025-10-15 9:16 ` Maxime Coquelin
2025-10-15 10:36 ` Eugenio Perez Martin
2025-10-16 5:39 ` Jason Wang
2025-10-16 5:45 ` Michael S. Tsirkin
2025-10-16 6:03 ` Jason Wang
2025-10-16 6:22 ` Michael S. Tsirkin
2025-10-16 6:25 ` Eugenio Perez Martin
2025-10-17 6:36 ` Eugenio Perez Martin
2025-10-17 6:39 ` Michael S. Tsirkin
2025-10-17 7:21 ` Eugenio Perez Martin
2025-10-22 9:46 ` Eugenio Perez Martin
2025-10-22 10:06 ` Michael S. Tsirkin
2025-10-22 10:09 ` Michael S. Tsirkin
2025-10-22 10:50 ` Eugenio Perez Martin
2025-10-22 11:43 ` Michael S. Tsirkin
2025-10-22 12:55 ` Eugenio Perez Martin
2025-10-28 14:09 ` Michael S. Tsirkin
2025-10-28 14:37 ` Eugenio Perez Martin
2025-10-28 14:42 ` Michael S. Tsirkin
2025-10-28 14:57 ` Eugenio Perez Martin
2025-10-29 0:36 ` Jason Wang
2025-11-05 9:02 ` Eugenio Perez Martin
2025-11-09 21:46 ` Michael S. Tsirkin
2026-03-13 11:31 ` Eugenio Perez Martin
2026-03-13 11:32 ` Eugenio Perez Martin
2026-03-13 12:06 ` Michael S. Tsirkin
2026-03-16 9:26 ` Eugenio Perez Martin [this message]
2025-10-07 13:06 ` [RFC 2/2] vduse: lift restriction about net devices with CVQ Eugenio Pérez
2025-10-09 13:14 ` Maxime Coquelin
2025-10-15 6:11 ` Eugenio Perez Martin
2025-10-14 8:31 ` Michael S. Tsirkin
2025-10-15 6:25 ` Eugenio Perez Martin
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=CAJaqyWdaMb0EABOL4WB8+PVKPeU4vzD3V22z63N10jzNESO1sQ@mail.gmail.com \
--to=eperezma@redhat.com \
--cc=dtatulea@nvidia.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lulu@redhat.com \
--cc=mcoqueli@redhat.com \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xieyongji@bytedance.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox