On Thu, Jun 2, 2022 at 4:59 AM Parav Pandit <parav@xxxxxxxxxx> wrote: > > > > From: Jason Wang <jasowang@xxxxxxxxxx> > > Sent: Wednesday, June 1, 2022 10:00 PM > > > > On Thu, Jun 2, 2022 at 2:58 AM Parav Pandit <parav@xxxxxxxxxx> wrote: > > > > > > > > > > From: Jason Wang <jasowang@xxxxxxxxxx> > > > > Sent: Tuesday, May 31, 2022 10:42 PM > > > > > > > > Well, the ability to query the virtqueue state was proposed as > > > > another feature (Eugenio, please correct me). This should be > > > > sufficient for making virtio-net to be live migrated. > > > > > > > The device is stopped, it won't answer to this special vq config done here. > > > > This depends on the definition of the stop. Any query to the device state > > should be allowed otherwise it's meaningless for us. > > > > > Programming all of these using cfg registers doesn't scale for on-chip > > memory and for the speed. > > > > Well, they are orthogonal and what I want to say is, we should first define > > the semantics of stop and state of the virtqueue. > > > > Such a facility could be accessed by either transport specific method or admin > > virtqueue, it totally depends on the hardware architecture of the vendor. > > > I find it hard to believe that a vendor can implement a CVQ but not AQ and chose to expose tens of hundreds of registers. > But maybe, it fits some specific hw. > > I like to learn the advantages of such method other than simplicity. > > We can clearly that we are shifting away from such PCI registers with SIOV, IMS and other scalable solutions. > virtio drifting in reverse direction by introducing more registers as transport. > I expect it to an optional transport like AQ. > > > > > > > Next would be to program hundreds of statistics of the 64 VQs through a > > giant PCI config space register in some busy polling scheme. > > > > We don't need giant config space, and this method has been implemented > > by some vDPA vendors. > > > There are tens of 64-bit counters per VQs. These needs to programmed on destination side. > Programming these via registers requires exposing them on the registers. > In one of the proposals, I see them being queried via CVQ from the device. > > Programming them via cfg registers requires large cfg space or synchronous programming until receiving ACK from it. > This means one entry at a time... > > Programming them via CVQ needs replicate and align cmd values etc on all device types. All duplicate and hard to maintain. > I think this discussion should be moved to the proposals on virtio-comment. In the vdpa context, they should be covered. This one is about exposing the basic facility of stopping and resuming a device to userland, and it fits equally well if the device implements it via cfg registers, via admin vq, via channel I/O, or via whatever transport the vdpa backend prefers. To ask for the state is already covered in the vhost layer, and this proposal does not affect it. Given the flexibility of vdpa, we can even ask vq state using backend-specific methods, cache it (knowing that there will be no change of them until resume or DRIVER_OK), and expose them to qemu using config space interface or any other batch method. Same as with the enable_vq problem. And the same applies to stats. And we maintain compatibility with all vendor-specific control plane. Would that work for devices that cannot or does not want to expose them via config space? Thanks! > > > > > > > I can clearly see how all these are inefficient for faster LM. > > > We need an efficient AQ to proceed with at minimum. > > > > I'm fine with admin virtqueue, but the stop and state are orthogonal to that. > > And using admin virtqueue for stop/state will be more natural if we use > > admin virtqueue as a transport. > Ok. > We should have defined it bit earlier that all vendors can use. :(