qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-serial: pci: Allow MSI to be disabled
@ 2010-02-12 13:22 Amit Shah
  2010-02-12 13:34 ` [Qemu-devel] " Michael S. Tsirkin
  2010-02-19 21:47 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Amit Shah @ 2010-02-12 13:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Amit Shah, Michael S. Tsirkin

Michael noted we don't allow disabling of MSI for the virtio-serial-pci
device. Fix that.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
---
 hw/virtio-pci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index f3373ae..bcd40f7 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -500,8 +500,8 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
     if (!vdev) {
         return -1;
     }
-    vdev->nvectors = proxy->nvectors ? proxy->nvectors
-                                     : proxy->max_virtserial_ports + 1;
+    vdev->nvectors = proxy->nvectors == -1 ? proxy->max_virtserial_ports + 1
+                                           : proxy->nvectors;
     virtio_init_pci(proxy, vdev,
                     PCI_VENDOR_ID_REDHAT_QUMRANET,
                     PCI_DEVICE_ID_VIRTIO_CONSOLE,
@@ -585,7 +585,7 @@ static PCIDeviceInfo virtio_info[] = {
         .init      = virtio_serial_init_pci,
         .exit      = virtio_exit_pci,
         .qdev.props = (Property[]) {
-            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
+            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, -1),
             DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
             DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
             DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] virtio-serial: pci: Allow MSI to be disabled
  2010-02-12 13:22 [Qemu-devel] [PATCH] virtio-serial: pci: Allow MSI to be disabled Amit Shah
@ 2010-02-12 13:34 ` Michael S. Tsirkin
  2010-02-19 21:47 ` [Qemu-devel] " Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2010-02-12 13:34 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu-devel

On Fri, Feb 12, 2010 at 06:52:38PM +0530, Amit Shah wrote:
> Michael noted we don't allow disabling of MSI for the virtio-serial-pci
> device. Fix that.
> 
> Signed-off-by: Amit Shah <amit.shah@redhat.com>
> CC: "Michael S. Tsirkin" <mst@redhat.com>

How about using a symbolic constant for -1?
We have NIC_NVECTORS_UNSPECIFIED in net.h,
generalize it to DEV_NVECTORS_UNSPECIFIED?

Acked-by: Michael S. Tsirkin <mst@redhat.com>

As a side note, I think directly allocating a ton
of vectors before some benchmark shows it's a measureable
win for serial is a mistake. But that's a subject
for another patch.

> ---
>  hw/virtio-pci.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index f3373ae..bcd40f7 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -500,8 +500,8 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
>      if (!vdev) {
>          return -1;
>      }
> -    vdev->nvectors = proxy->nvectors ? proxy->nvectors
> -                                     : proxy->max_virtserial_ports + 1;
> +    vdev->nvectors = proxy->nvectors == -1 ? proxy->max_virtserial_ports + 1
> +                                           : proxy->nvectors;
>      virtio_init_pci(proxy, vdev,
>                      PCI_VENDOR_ID_REDHAT_QUMRANET,
>                      PCI_DEVICE_ID_VIRTIO_CONSOLE,
> @@ -585,7 +585,7 @@ static PCIDeviceInfo virtio_info[] = {
>          .init      = virtio_serial_init_pci,
>          .exit      = virtio_exit_pci,
>          .qdev.props = (Property[]) {
> -            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
> +            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, -1),
>              DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
>              DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
>              DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
> -- 
> 1.6.2.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-serial: pci: Allow MSI to be disabled
  2010-02-12 13:22 [Qemu-devel] [PATCH] virtio-serial: pci: Allow MSI to be disabled Amit Shah
  2010-02-12 13:34 ` [Qemu-devel] " Michael S. Tsirkin
@ 2010-02-19 21:47 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2010-02-19 21:47 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu-devel, Michael S. Tsirkin

On 02/12/2010 07:22 AM, Amit Shah wrote:
> Michael noted we don't allow disabling of MSI for the virtio-serial-pci
> device. Fix that.
>
> Signed-off-by: Amit Shah<amit.shah@redhat.com>
> CC: "Michael S. Tsirkin"<mst@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   hw/virtio-pci.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index f3373ae..bcd40f7 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -500,8 +500,8 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
>       if (!vdev) {
>           return -1;
>       }
> -    vdev->nvectors = proxy->nvectors ? proxy->nvectors
> -                                     : proxy->max_virtserial_ports + 1;
> +    vdev->nvectors = proxy->nvectors == -1 ? proxy->max_virtserial_ports + 1
> +                                           : proxy->nvectors;
>       virtio_init_pci(proxy, vdev,
>                       PCI_VENDOR_ID_REDHAT_QUMRANET,
>                       PCI_DEVICE_ID_VIRTIO_CONSOLE,
> @@ -585,7 +585,7 @@ static PCIDeviceInfo virtio_info[] = {
>           .init      = virtio_serial_init_pci,
>           .exit      = virtio_exit_pci,
>           .qdev.props = (Property[]) {
> -            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
> +            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, -1),
>               DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
>               DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
>               DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
>    

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-19 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12 13:22 [Qemu-devel] [PATCH] virtio-serial: pci: Allow MSI to be disabled Amit Shah
2010-02-12 13:34 ` [Qemu-devel] " Michael S. Tsirkin
2010-02-19 21:47 ` [Qemu-devel] " Anthony Liguori

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).