qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Hannes Reinecke <hare@suse.de>
Subject: [Qemu-devel] [PULL 04/11] megasas: Enable MSI-X support
Date: Fri, 16 May 2014 12:37:37 +0200	[thread overview]
Message-ID: <1400236664-32334-5-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1400236664-32334-1-git-send-email-pbonzini@redhat.com>

From: Hannes Reinecke <hare@suse.de>

MSI-X support has been fixed in qemu, so we can enable it again.

Signed-off-by: Hannes Reinecke <hare@suse.de>
[Do not change VMSTATE_PCI_DEVICE to PCIE. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/megasas.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 1781525..c40e48b 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2085,6 +2085,7 @@ static const VMStateDescription vmstate_megasas = {
     .minimum_version_id_old = 0,
     .fields      = (VMStateField[]) {
         VMSTATE_PCI_DEVICE(parent_obj, MegasasState),
+        VMSTATE_MSIX(parent_obj, MegasasState),
 
         VMSTATE_INT32(fw_state, MegasasState),
         VMSTATE_INT32(intr_mask, MegasasState),
@@ -2100,9 +2101,7 @@ static void megasas_scsi_uninit(PCIDevice *d)
 {
     MegasasState *s = MEGASAS(d);
 
-#ifdef USE_MSIX
-    msix_uninit(d, &s->mmio_io);
-#endif
+    msix_uninit(d, &s->mmio_io, &s->mmio_io);
     memory_region_destroy(&s->mmio_io);
     memory_region_destroy(&s->port_io);
     memory_region_destroy(&s->queue_io);
@@ -2141,15 +2140,11 @@ static int megasas_scsi_init(PCIDevice *dev)
     memory_region_init_io(&s->queue_io, OBJECT(s), &megasas_queue_ops, s,
                           "megasas-queue", 0x40000);
 
-#ifdef USE_MSIX
-    /* MSI-X support is currently broken */
     if (megasas_use_msix(s) &&
-        msix_init(dev, 15, &s->mmio_io, 0, 0x2000)) {
+        msix_init(dev, 15, &s->mmio_io, 0, 0x2000,
+                  &s->mmio_io, 0, 0x3800, 0x68)) {
         s->flags &= ~MEGASAS_MASK_USE_MSIX;
     }
-#else
-    s->flags &= ~MEGASAS_MASK_USE_MSIX;
-#endif
 
     bar_type = PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64;
     pci_register_bar(dev, 0, bar_type, &s->mmio_io);
@@ -2168,7 +2163,7 @@ static int megasas_scsi_init(PCIDevice *dev)
         s->sas_addr |= PCI_FUNC(dev->devfn);
     }
     if (!s->hba_serial) {
-	s->hba_serial = g_strdup(MEGASAS_HBA_SERIAL);
+        s->hba_serial = g_strdup(MEGASAS_HBA_SERIAL);
     }
     if (s->fw_sge >= MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE) {
         s->fw_sge = MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE;
@@ -2213,10 +2208,8 @@ static Property megasas_properties[] = {
                        MEGASAS_DEFAULT_FRAMES),
     DEFINE_PROP_STRING("hba_serial", MegasasState, hba_serial),
     DEFINE_PROP_UINT64("sas_address", MegasasState, sas_addr, 0),
-#ifdef USE_MSIX
     DEFINE_PROP_BIT("use_msix", MegasasState, flags,
                     MEGASAS_FLAG_USE_MSIX, false),
-#endif
     DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
                     MEGASAS_FLAG_USE_JBOD, false),
     DEFINE_PROP_END_OF_LIST(),
-- 
1.8.3.1

  parent reply	other threads:[~2014-05-16 10:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 10:37 [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15 Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 01/11] scsi-disk: Improve error messager if can't get version number Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 02/11] scsi: Improve error messages more Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 03/11] megasas: Implement LD_LIST_QUERY Paolo Bonzini
2014-05-16 10:37 ` Paolo Bonzini [this message]
2014-05-16 10:37 ` [Qemu-devel] [PULL 05/11] megasas: Add MSI support Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 06/11] MAINTAINERS: mark megasas as maintained Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 07/11] block/iscsi: allow fall back to WRITE SAME without UNMAP Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 08/11] block/iscsi: speed up read for unallocated sectors Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 09/11] block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 10/11] block/iscsi: allow cluster_size of 4K and greater Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 11/11] [PATCH] block/iscsi: bump year in copyright notice Paolo Bonzini
2014-05-19 11:52 ` [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15 Peter Maydell

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=1400236664-32334-5-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=hare@suse.de \
    --cc=qemu-devel@nongnu.org \
    /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).