qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 2/2] virtio: enable msi-x for console+balloon


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 2/2] virtio: enable msi-x for console+balloon
Date: Mon, 7 Dec 2009 11:37:17 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

Sorry, I missed this the first time this was posted, and I see this in
staging now. Gerd, could you please explain the motivation for this
patch?

I assumed console/baloon interrupts are not performance critical, so
would we not be better off using a shared interrupt for these,
reserving MSI vectors for where performance matters?


On Wed, Nov 25, 2009 at 09:16:48AM +0100, Gerd Hoffmann wrote:
> Enable MSI-X for virtio-console-pci and virtio-balloon-pci.
> Add entries to the compatibility machine types so MSI-X will
> be disabled for pc-0.10 and pc-0.11.
> 
> Signed-off-by: Gerd Hoffmann <address@hidden>
> ---
>  hw/pc.c         |   16 ++++++++++++++++
>  hw/virtio-pci.c |   11 +++++++++++
>  2 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/pc.c b/hw/pc.c
> index fdaa52c..cb78923 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -1297,6 +1297,14 @@ static QEMUMachine pc_machine_v0_11 = {
>              .driver   = "virtio-blk-pci",
>              .property = "vectors",
>              .value    = stringify(0),
> +        },{
> +            .driver   = "virtio-balloon-pci",
> +            .property = "vectors",
> +            .value    = stringify(0),
> +        },{
> +            .driver   = "virtio-console-pci",
> +            .property = "vectors",
> +            .value    = stringify(0),
>          },
>          { /* end of list */ }
>      }
> @@ -1324,6 +1332,14 @@ static QEMUMachine pc_machine_v0_10 = {
>              .driver   = "virtio-blk-pci",
>              .property = "vectors",
>              .value    = stringify(0),
> +        },{
> +            .driver   = "virtio-balloon-pci",
> +            .property = "vectors",
> +            .value    = stringify(0),
> +        },{
> +            .driver   = "virtio-console-pci",
> +            .property = "vectors",
> +            .value    = stringify(0),
>          },
>          { /* end of list */ }
>      },
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index aebcf9d..cb8ab21 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -483,10 +483,13 @@ static int virtio_console_init_pci(PCIDevice *pci_dev)
>      if (!vdev) {
>          return -1;
>      }
> +    vdev->nvectors = proxy->nvectors;
>      virtio_init_pci(proxy, vdev,
>                      PCI_VENDOR_ID_REDHAT_QUMRANET,
>                      PCI_DEVICE_ID_VIRTIO_CONSOLE,
>                      proxy->class_code, 0x00);
> +    /* make the actual value visible */
> +    proxy->nvectors = vdev->nvectors;
>      return 0;
>  }
>  
> @@ -531,11 +534,14 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev)
>      VirtIODevice *vdev;
>  
>      vdev = virtio_balloon_init(&pci_dev->qdev);
> +    vdev->nvectors = proxy->nvectors;
>      virtio_init_pci(proxy, vdev,
>                      PCI_VENDOR_ID_REDHAT_QUMRANET,
>                      PCI_DEVICE_ID_VIRTIO_BALLOON,
>                      PCI_CLASS_MEMORY_RAM,
>                      0x00);
> +    /* make the actual value visible */
> +    proxy->nvectors = vdev->nvectors;
>      return 0;
>  }
>  
> @@ -569,6 +575,7 @@ static PCIDeviceInfo virtio_info[] = {
>          .init      = virtio_console_init_pci,
>          .exit      = virtio_exit_pci,
>          .qdev.props = (Property[]) {
> +            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
>              DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
>              DEFINE_PROP_END_OF_LIST(),
>          },
> @@ -579,6 +586,10 @@ static PCIDeviceInfo virtio_info[] = {
>          .init      = virtio_balloon_init_pci,
>          .exit      = virtio_exit_pci,
>          .qdev.reset = virtio_pci_reset,
> +        .qdev.props = (Property[]) {
> +            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3),
> +            DEFINE_PROP_END_OF_LIST(),
> +        },
>      },{
>          /* end of list */
>      }
> -- 
> 1.6.2.5
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]