qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: "Eugenio Pérez" <eperezma@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Liuxiangdong <liuxiangdong5@huawei.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Harpreet Singh Anand" <hanand@xilinx.com>,
	"Gautam Dawar" <gdawar@xilinx.com>,
	"Zhu Lingshan" <lingshan.zhu@intel.com>,
	"Cindy Lu" <lulu@redhat.com>,
	"Si-Wei Liu" <si-wei.liu@oracle.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Eli Cohen" <elic@nvidia.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>
Subject: Re: [RFC PATCH for 8.0 10/13] virtio-net: Migrate vhost inflight descriptors
Date: Wed, 11 Jan 2023 13:51:06 +0800	[thread overview]
Message-ID: <CACGkMEvriASFy1JTXHPrnP2O99B+mjYY+NMB9x9dHbiG0J7Y3w@mail.gmail.com> (raw)
In-Reply-To: <PH0PR12MB548141C98FA3C7593E4B3C40DCFC9@PH0PR12MB5481.namprd12.prod.outlook.com>

On Wed, Jan 11, 2023 at 12:40 PM Parav Pandit <parav@nvidia.com> wrote:
>
>
> > From: Jason Wang <jasowang@redhat.com>
> > Sent: Tuesday, January 10, 2023 11:35 PM
> >
> > On Tue, Jan 10, 2023 at 11:02 AM Parav Pandit <parav@nvidia.com> wrote:
> > >
> > > Hi Jason,
> > >
> > > > From: Jason Wang <jasowang@redhat.com>
> > > > Sent: Monday, December 5, 2022 10:25 PM
> > >
> > > >
> > > > A dumb question, any reason we need bother with virtio-net? It looks
> > > > to me it's not a must and would complicate migration compatibility.
> > >
> > > Virtio net vdpa device is processing the descriptors out of order.
> > > This vdpa device doesn’t offer IN_ORDER flag.
> > >
> > > And when a VQ is suspended it cannot complete these descriptors as some
> > dummy zero length completions.
> > > The guest VM is flooded with [1].
> >
> > Yes, but any reason for the device to do out-of-order for RX?
> >
> For some devices it is more optimal to process them out of order.
> And its not limited to RX.

TX should be fine, since the device can anyhow pretend to send all
packets, so we won't have any in-flight descriptors.

>
> > >
> > > So it is needed for the devices that doesn’t offer IN_ORDER feature.
> > >
> > > [1]
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tre
> > > e/drivers/net/virtio_net.c?h=v6.2-rc3#n1252
> >
> > It is only enabled in a debug kernel which should be harmless?
> it is KERN_DEBUG log level. Its is not debug kernel, just the debug log level.

Ok, but the production environment should not use that level anyhow.

> And regardless, generating zero length packets for debug kernel is even more confusing.

Note that it is allowed in the virtio-spec[1] (we probably can fix
that in the driver) and we have pr_debug() all over this drivers and
other places. It doesn't cause any side effects except for the
debugging purpose.

So I think having inflight tracking is useful, but I'm not sure it's
worth bothering with virtio-net (or worth to bothering now):

- zero length is allowed
- it only helps for debugging
- may cause issues for migration compatibility
- requires new infrastructure to be invented

Thanks

[1] spec said

"
Note: len is particularly useful for drivers using untrusted buffers:
if a driver does not know exactly how much has been written by the
device, the driver would have to zero the buffer in advance to ensure
no data leakage occurs.
"



  reply	other threads:[~2023-01-11  5:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 17:04 [RFC PATCH for 8.0 00/13] vDPA-net inflight descriptors migration with SVQ Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 01/13] vhost: add available descriptor list in SVQ Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 02/13] vhost: iterate only available descriptors at SVQ stop Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 03/13] vhost: merge avail list and next avail descriptors detach Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 04/13] vhost: add vhost_svq_save_inflight Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 05/13] virtio: Specify uint32_t as VirtQueueElementOld members type Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 06/13] virtio: refactor qemu_get_virtqueue_element Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 07/13] virtio: refactor qemu_put_virtqueue_element Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 08/13] virtio: expose VirtQueueElementOld Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 09/13] virtio: add vmstate_virtqueue_element_old Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 10/13] virtio-net: Migrate vhost inflight descriptors Eugenio Pérez
2022-12-05 20:52   ` Parav Pandit
2022-12-07  8:40     ` Eugenio Perez Martin
2022-12-06  3:24   ` Jason Wang
2022-12-07  8:56     ` Eugenio Perez Martin
2023-01-16 21:01       ` Michael S. Tsirkin
2023-01-17  3:38         ` Jason Wang
2023-01-10  3:02     ` Parav Pandit
2023-01-11  4:34       ` Jason Wang
2023-01-11  4:40         ` Parav Pandit
2023-01-11  5:51           ` Jason Wang [this message]
2023-01-16 19:53             ` Parav Pandit
2023-01-16 20:58             ` Michael S. Tsirkin
2023-01-17  6:54               ` Jason Wang
2022-12-05 17:04 ` [RFC PATCH for 8.0 11/13] virtio-net: save inflight descriptors at vhost shutdown Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 12/13] vhost: expose vhost_svq_add_element Eugenio Pérez
2022-12-05 17:04 ` [RFC PATCH for 8.0 13/13] vdpa: Recover inflight descriptors Eugenio Pérez
2022-12-06  7:07 ` [RFC PATCH for 8.0 00/13] vDPA-net inflight descriptors migration with SVQ Jason Wang
2022-12-07  8:59   ` Eugenio Perez Martin
2022-12-08  7:31     ` 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=CACGkMEvriASFy1JTXHPrnP2O99B+mjYY+NMB9x9dHbiG0J7Y3w@mail.gmail.com \
    --to=jasowang@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=elic@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=lingshan.zhu@intel.com \
    --cc=liuxiangdong5@huawei.com \
    --cc=lulu@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=stefanha@redhat.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).