From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Yanan Wang" <wangyanan55@huawei.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
qemu-rust@nongnu.org, "Zhao Liu" <zhao1.liu@intel.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Jason Wang" <jasowang@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-s390x@nongnu.org,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: [PATCH 06/10] hw/net/e1000: Remove unused E1000_FLAG_TSO flag
Date: Fri, 2 May 2025 01:01:24 +0200 [thread overview]
Message-ID: <20250501230129.2596-7-philmd@linaro.org> (raw)
In-Reply-To: <20250501230129.2596-1-philmd@linaro.org>
E1000_FLAG_TSO was only used by the hw_compat_2_11[] array,
via the 'migrate_tso_props=off' property. We removed all
machines using that array, lets remove all the code around
E1000_FLAG_TSO, including the vmstate_e1000_tx_tso_state
subsection.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Is it OK to remove migration subsection like that?
---
hw/net/e1000.c | 58 +++++++-------------------------------------------
1 file changed, 8 insertions(+), 50 deletions(-)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index e0310aef872..c68645684b6 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -127,13 +127,10 @@ struct E1000State_st {
QEMUTimer *flush_queue_timer;
/* Compatibility flags for migration to/from qemu 1.3.0 and older */
-#define E1000_FLAG_TSO_BIT 3
#define E1000_FLAG_VET_BIT 4
-#define E1000_FLAG_TSO (1 << E1000_FLAG_TSO_BIT)
#define E1000_FLAG_VET (1 << E1000_FLAG_VET_BIT)
uint32_t compat_flags;
- bool received_tx_tso;
bool use_tso_for_migration;
e1000x_txd_props mig_props;
};
@@ -1331,7 +1328,7 @@ static int e1000_pre_save(void *opaque)
}
/* Decide which set of props to migrate in the main structure */
- if (chkflag(TSO) || !s->use_tso_for_migration) {
+ if (!s->use_tso_for_migration) {
/* Either we're migrating with the extra subsection, in which
* case the mig_props is always 'props' OR
* we've not got the subsection, but 'props' was the last
@@ -1368,30 +1365,16 @@ static int e1000_post_load(void *opaque, int version_id)
}
s->tx.props = s->mig_props;
- if (!s->received_tx_tso) {
- /* We received only one set of offload data (tx.props)
- * and haven't got tx.tso_props. The best we can do
- * is dupe the data.
- */
- s->tx.tso_props = s->mig_props;
- }
+
+ /* We received only one set of offload data (tx.props)
+ * and haven't got tx.tso_props. The best we can do
+ * is dupe the data.
+ */
+ s->tx.tso_props = s->mig_props;
+
return 0;
}
-static int e1000_tx_tso_post_load(void *opaque, int version_id)
-{
- E1000State *s = opaque;
- s->received_tx_tso = true;
- return 0;
-}
-
-static bool e1000_tso_state_needed(void *opaque)
-{
- E1000State *s = opaque;
-
- return chkflag(TSO);
-}
-
static const VMStateDescription vmstate_e1000_mit_state = {
.name = "e1000/mit_state",
.version_id = 1,
@@ -1416,28 +1399,6 @@ static const VMStateDescription vmstate_e1000_full_mac_state = {
}
};
-static const VMStateDescription vmstate_e1000_tx_tso_state = {
- .name = "e1000/tx_tso_state",
- .version_id = 1,
- .minimum_version_id = 1,
- .needed = e1000_tso_state_needed,
- .post_load = e1000_tx_tso_post_load,
- .fields = (const VMStateField[]) {
- VMSTATE_UINT8(tx.tso_props.ipcss, E1000State),
- VMSTATE_UINT8(tx.tso_props.ipcso, E1000State),
- VMSTATE_UINT16(tx.tso_props.ipcse, E1000State),
- VMSTATE_UINT8(tx.tso_props.tucss, E1000State),
- VMSTATE_UINT8(tx.tso_props.tucso, E1000State),
- VMSTATE_UINT16(tx.tso_props.tucse, E1000State),
- VMSTATE_UINT32(tx.tso_props.paylen, E1000State),
- VMSTATE_UINT8(tx.tso_props.hdr_len, E1000State),
- VMSTATE_UINT16(tx.tso_props.mss, E1000State),
- VMSTATE_INT8(tx.tso_props.ip, E1000State),
- VMSTATE_INT8(tx.tso_props.tcp, E1000State),
- VMSTATE_END_OF_LIST()
- }
-};
-
static const VMStateDescription vmstate_e1000 = {
.name = "e1000",
.version_id = 2,
@@ -1519,7 +1480,6 @@ static const VMStateDescription vmstate_e1000 = {
.subsections = (const VMStateDescription * const []) {
&vmstate_e1000_mit_state,
&vmstate_e1000_full_mac_state,
- &vmstate_e1000_tx_tso_state,
NULL
}
};
@@ -1637,8 +1597,6 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
static const Property e1000_properties[] = {
DEFINE_NIC_PROPERTIES(E1000State, conf),
- DEFINE_PROP_BIT("migrate_tso_props", E1000State,
- compat_flags, E1000_FLAG_TSO_BIT, true),
DEFINE_PROP_BIT("init-vet", E1000State,
compat_flags, E1000_FLAG_VET_BIT, true),
};
--
2.47.1
next prev parent reply other threads:[~2025-05-01 23:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 23:01 [PATCH 00/10] hw/core: Remove hw_compat[] array for 2.10, 2.11 and 2.12 machines Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 01/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.10 and 2.11 machine types Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 02/10] hw/core/machine: Remove hw_compat_2_10[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 03/10] hw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 04/10] hw/core/machine: Remove hw_compat_2_11[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 05/10] hw/timer/hpet: Remove HPETState::hpet_offset_saved field Philippe Mathieu-Daudé
2025-05-01 23:01 ` Philippe Mathieu-Daudé [this message]
2025-05-01 23:01 ` [PATCH 07/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.12 machine type Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 08/10] hw/core/machine: Remove hw_compat_2_12[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 09/10] hw/audio/hda-codec: Remove HDAAudioState::use_timer field Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 10/10] hw/display/vga-pci: Do not expose the 'global-vmstate' property Philippe Mathieu-Daudé
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=20250501230129.2596-7-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=eduardo@habkost.net \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.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).