qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Xiaoyao Li" <xiaoyao.li@intel.com>
Subject: [PULL 24/27] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition
Date: Wed, 28 May 2025 12:05:04 +0200	[thread overview]
Message-ID: <20250528100507.313906-25-thuth@redhat.com> (raw)
In-Reply-To: <20250528100507.313906-1-thuth@redhat.com>

From: Philippe Mathieu-Daudé <philmd@linaro.org>

VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS was only used by the
hw_compat_2_5[] array, via the 'x-old-msi-offsets=on' property.
We removed all machines using that array, lets remove all the
code around VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20250512083948.39294-18-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/net/vmxnet3.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 83d942af179..3cf5d71f478 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -42,18 +42,13 @@
 #define VMXNET3_MSIX_BAR_SIZE 0x2000
 
 /* Compatibility flags for migration */
-#define VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT 0
-#define VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS \
-    (1 << VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT)
 #define VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT 1
 #define VMXNET3_COMPAT_FLAG_DISABLE_PCIE \
     (1 << VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT)
 
 #define VMXNET3_EXP_EP_OFFSET (0x48)
-#define VMXNET3_MSI_OFFSET(s) \
-    ((s)->compat_flags & VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS ? 0x50 : 0x84)
-#define VMXNET3_MSIX_OFFSET(s) \
-    ((s)->compat_flags & VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS ? 0 : 0x9c)
+#define VMXNET3_MSI_OFFSET    (0x84)
+#define VMXNET3_MSIX_OFFSET   (0x9c)
 #define VMXNET3_DSN_OFFSET     (0x100)
 
 #define VMXNET3_BAR0_IDX      (0)
@@ -61,8 +56,7 @@
 #define VMXNET3_MSIX_BAR_IDX  (2)
 
 #define VMXNET3_OFF_MSIX_TABLE (0x000)
-#define VMXNET3_OFF_MSIX_PBA(s) \
-    ((s)->compat_flags & VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS ? 0x800 : 0x1000)
+#define VMXNET3_OFF_MSIX_PBA   (0x1000)
 
 /* Link speed in Mbps should be shifted by 16 */
 #define VMXNET3_LINK_SPEED      (1000 << 16)
@@ -2122,8 +2116,8 @@ vmxnet3_init_msix(VMXNET3State *s)
                         &s->msix_bar,
                         VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_TABLE,
                         &s->msix_bar,
-                        VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_PBA(s),
-                        VMXNET3_MSIX_OFFSET(s), NULL);
+                        VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_PBA,
+                        VMXNET3_MSIX_OFFSET, NULL);
 
     if (0 > res) {
         VMW_WRPRN("Failed to initialize MSI-X, error %d", res);
@@ -2221,7 +2215,7 @@ static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp)
     /* Interrupt pin A */
     pci_dev->config[PCI_INTERRUPT_PIN] = 0x01;
 
-    ret = msi_init(pci_dev, VMXNET3_MSI_OFFSET(s), VMXNET3_MAX_NMSIX_INTRS,
+    ret = msi_init(pci_dev, VMXNET3_MSI_OFFSET, VMXNET3_MAX_NMSIX_INTRS,
                    VMXNET3_USE_64BIT, VMXNET3_PER_VECTOR_MASK, NULL);
     /* Any error other than -ENOTSUP(board's MSI support is broken)
      * is a programming error. Fall back to INTx silently on -ENOTSUP */
@@ -2472,8 +2466,6 @@ static const VMStateDescription vmstate_vmxnet3 = {
 
 static const Property vmxnet3_properties[] = {
     DEFINE_NIC_PROPERTIES(VMXNET3State, conf),
-    DEFINE_PROP_BIT("x-old-msi-offsets", VMXNET3State, compat_flags,
-                    VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS_BIT, false),
     DEFINE_PROP_BIT("x-disable-pcie", VMXNET3State, compat_flags,
                     VMXNET3_COMPAT_FLAG_DISABLE_PCIE_BIT, false),
 };
-- 
2.49.0



  parent reply	other threads:[~2025-05-28 10:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28 10:04 [PULL 00/27] Functional tests, Microblaze endianness & pc/q35 cleanups Thomas Huth
2025-05-28 10:04 ` [PULL 01/27] tests/functional/test_sparc64_tuxrun: Explicitly set the 'sun4u' machine Thomas Huth
2025-05-28 10:04 ` [PULL 02/27] tests/functional/test_mips_malta: Re-enable the check for the PCI host bridge Thomas Huth
2025-05-28 10:04 ` [PULL 03/27] tests/functional/test_mem_addr_space: Use set_machine() to select the machine Thomas Huth
2025-05-28 10:04 ` [PULL 04/27] tests/functional: add skipLockedMemoryTest decorator Thomas Huth
2025-05-28 10:04 ` [PULL 05/27] tests/functional: add memlock tests Thomas Huth
2025-05-28 10:04 ` [PULL 06/27] hw/microblaze: Add endianness property to the petalogix_s3adsp1800 machine Thomas Huth
2025-05-28 10:04 ` [PULL 07/27] tests/functional: Test both microblaze s3adsp1800 endianness variants Thomas Huth
2025-05-28 10:04 ` [PULL 08/27] hw/microblaze: Remove the big-endian variants of ml605 and xlnx-zynqmp-pmu Thomas Huth
2025-05-28 10:04 ` [PULL 09/27] docs: Deprecate the qemu-system-microblazeel binary Thomas Huth
2025-05-28 10:04 ` [PULL 10/27] hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines Thomas Huth
2025-05-28 10:04 ` [PULL 11/27] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field Thomas Huth
2025-05-28 10:04 ` [PULL 12/27] hw/i386/pc: Remove pc_compat_2_4[] array Thomas Huth
2025-05-28 10:04 ` [PULL 13/27] hw/core/machine: Remove hw_compat_2_4[] array Thomas Huth
2025-05-28 10:04 ` [PULL 14/27] hw/net/e1000: Remove unused E1000_FLAG_MAC flag Thomas Huth
2025-05-28 10:04 ` [PULL 15/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition Thomas Huth
2025-05-28 10:04 ` [PULL 16/27] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition Thomas Huth
2025-05-28 10:04 ` [PULL 17/27] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines Thomas Huth
2025-05-28 10:04 ` [PULL 18/27] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field Thomas Huth
2025-05-28 10:04 ` [PULL 19/27] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE Thomas Huth
2025-05-28 10:05 ` [PULL 20/27] hw/core/machine: Remove hw_compat_2_5[] array Thomas Huth
2025-05-28 10:05 ` [PULL 21/27] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition Thomas Huth
2025-05-28 10:05 ` [PULL 22/27] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition Thomas Huth
2025-05-28 10:05 ` [PULL 23/27] hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit Thomas Huth
2025-05-28 10:05 ` Thomas Huth [this message]
2025-05-28 10:05 ` [PULL 25/27] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition Thomas Huth
2025-05-28 10:05 ` [PULL 26/27] hw/net/vmxnet3: Merge DeviceRealize in InstanceInit Thomas Huth
2025-05-28 10:05 ` [PULL 27/27] tests/unit/test-util-sockets: fix mem-leak on error object Thomas Huth
2025-05-28 19:23 ` [PULL 00/27] Functional tests, Microblaze endianness & pc/q35 cleanups Stefan Hajnoczi
2025-05-28 20:12   ` Thomas Huth
2025-06-04  7:51     ` Alexandr Moshkov
2025-06-04 13:11       ` Stefan Hajnoczi
2025-06-04 13:19         ` Thomas Huth

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=20250528100507.313906-25-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiaoyao.li@intel.com \
    --cc=zhao1.liu@intel.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).