[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/21] hw/net/e1000: Remove unused E1000_FLAG_MAC flag
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 08/21] hw/net/e1000: Remove unused E1000_FLAG_MAC flag |
Date: |
Thu, 16 Jan 2025 09:57:45 +0000 |
User-agent: |
Mutt/2.2.13 (2024-03-09) |
On Thu, Jan 16, 2025 at 12:22:34AM +0100, Philippe Mathieu-Daudé wrote:
> E1000_FLAG_MAC was only used by the hw_compat_2_4[] array,
> via the 'extra_mac_registers=off' property. We removed all
> machines using that array, lets remove all the code around
> E1000_FLAG_MAC.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/net/e1000.c | 63 +++++++++-----------------------------------------
> 1 file changed, 11 insertions(+), 52 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index 3d0b2277039..14d2133cd80 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -127,10 +127,8 @@ struct E1000State_st {
> QEMUTimer *flush_queue_timer;
>
> /* Compatibility flags for migration to/from qemu 1.3.0 and older */
> -#define E1000_FLAG_MAC_BIT 2
> #define E1000_FLAG_TSO_BIT 3
> #define E1000_FLAG_VET_BIT 4
> -#define E1000_FLAG_MAC (1 << E1000_FLAG_MAC_BIT)
> #define E1000_FLAG_TSO (1 << E1000_FLAG_TSO_BIT)
> #define E1000_FLAG_VET (1 << E1000_FLAG_VET_BIT)
>
> @@ -1218,46 +1216,17 @@ enum { MAC_ACCESS_PARTIAL = 1, MAC_ACCESS_FLAG_NEEDED
> = 2 };
> * n - flag needed
> * p - partially implenented */
> static const uint8_t mac_reg_access[0x8000] = {
> - [IPAV] = markflag(MAC), [WUC] = markflag(MAC),
> - [IP6AT] = markflag(MAC), [IP4AT] = markflag(MAC),
> - [FFVT] = markflag(MAC), [WUPM] = markflag(MAC),
> - [ECOL] = markflag(MAC), [MCC] = markflag(MAC),
> - [DC] = markflag(MAC), [TNCRS] = markflag(MAC),
> - [RLEC] = markflag(MAC), [XONRXC] = markflag(MAC),
> - [XOFFTXC] = markflag(MAC), [RFC] = markflag(MAC),
> - [TSCTFC] = markflag(MAC), [MGTPRC] = markflag(MAC),
> - [WUS] = markflag(MAC), [AIT] = markflag(MAC),
> - [FFLT] = markflag(MAC), [FFMT] = markflag(MAC),
> - [SCC] = markflag(MAC), [FCRUC] = markflag(MAC),
> - [LATECOL] = markflag(MAC), [COLC] = markflag(MAC),
> - [SEQEC] = markflag(MAC), [CEXTERR] = markflag(MAC),
> - [XONTXC] = markflag(MAC), [XOFFRXC] = markflag(MAC),
> - [RJC] = markflag(MAC), [RNBC] = markflag(MAC),
> - [MGTPDC] = markflag(MAC), [MGTPTC] = markflag(MAC),
> - [RUC] = markflag(MAC), [ROC] = markflag(MAC),
> - [GORCL] = markflag(MAC), [GORCH] = markflag(MAC),
> - [GOTCL] = markflag(MAC), [GOTCH] = markflag(MAC),
> - [BPRC] = markflag(MAC), [MPRC] = markflag(MAC),
> - [TSCTC] = markflag(MAC), [PRC64] = markflag(MAC),
> - [PRC127] = markflag(MAC), [PRC255] = markflag(MAC),
> - [PRC511] = markflag(MAC), [PRC1023] = markflag(MAC),
> - [PRC1522] = markflag(MAC), [PTC64] = markflag(MAC),
> - [PTC127] = markflag(MAC), [PTC255] = markflag(MAC),
> - [PTC511] = markflag(MAC), [PTC1023] = markflag(MAC),
> - [PTC1522] = markflag(MAC), [MPTC] = markflag(MAC),
> - [BPTC] = markflag(MAC),
> -
> - [TDFH] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [TDFT] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [TDFHS] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [TDFTS] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [TDFPC] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [RDFH] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [RDFT] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [RDFHS] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [RDFTS] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [RDFPC] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> - [PBM] = markflag(MAC) | MAC_ACCESS_PARTIAL,
> + [TDFH] = MAC_ACCESS_PARTIAL,
> + [TDFT] = MAC_ACCESS_PARTIAL,
> + [TDFHS] = MAC_ACCESS_PARTIAL,
> + [TDFTS] = MAC_ACCESS_PARTIAL,
> + [TDFPC] = MAC_ACCESS_PARTIAL,
> + [RDFH] = MAC_ACCESS_PARTIAL,
> + [RDFT] = MAC_ACCESS_PARTIAL,
> + [RDFHS] = MAC_ACCESS_PARTIAL,
> + [RDFTS] = MAC_ACCESS_PARTIAL,
> + [RDFPC] = MAC_ACCESS_PARTIAL,
> + [PBM] = MAC_ACCESS_PARTIAL,
It seems like this is removing all use of the 'markflag' macro ?
If I'm correct, then that macro can be removed. That in turnm means
the 'MAC_ACCESS_FLAG_NEEDED' enum entry can also be removed, as well
as places in code that check this flag.
> };
>
> static void
> @@ -1419,13 +1388,6 @@ static int e1000_tx_tso_post_load(void *opaque, int
> version_id)
> return 0;
> }
>
> -static bool e1000_full_mac_needed(void *opaque)
> -{
> - E1000State *s = opaque;
> -
> - return chkflag(MAC);
> -}
> -
> static bool e1000_tso_state_needed(void *opaque)
> {
> E1000State *s = opaque;
> @@ -1451,7 +1413,6 @@ static const VMStateDescription
> vmstate_e1000_full_mac_state = {
> .name = "e1000/full_mac_state",
> .version_id = 1,
> .minimum_version_id = 1,
> - .needed = e1000_full_mac_needed,
> .fields = (const VMStateField[]) {
> VMSTATE_UINT32_ARRAY(mac_reg, E1000State, 0x8000),
> VMSTATE_END_OF_LIST()
> @@ -1679,8 +1640,6 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error
> **errp)
>
> static const Property e1000_properties[] = {
> DEFINE_NIC_PROPERTIES(E1000State, conf),
> - DEFINE_PROP_BIT("extra_mac_registers", E1000State,
> - compat_flags, E1000_FLAG_MAC_BIT, true),
> DEFINE_PROP_BIT("migrate_tso_props", E1000State,
> compat_flags, E1000_FLAG_TSO_BIT, true),
> DEFINE_PROP_BIT("init-vet", E1000State,
> --
> 2.47.1
>
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- Re: [PATCH 03/21] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field, (continued)
- [PATCH 04/21] hw/i386/pc: Remove pc_compat_2_4[] array, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 05/21] target/i386/cpu: Remove X86CPU::check_cpuid field, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 06/21] target/i386/cpu: Pass Error** to x86_cpu_filter_features(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 07/21] hw/core/machine: Remove hw_compat_2_4[] array, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 08/21] hw/net/e1000: Remove unused E1000_FLAG_MAC flag, Philippe Mathieu-Daudé, 2025/01/15
- Re: [PATCH 08/21] hw/net/e1000: Remove unused E1000_FLAG_MAC flag,
Daniel P . Berrangé <=
- [PATCH 09/21] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 10/21] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 11/21] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 12/21] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 13/21] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE, Philippe Mathieu-Daudé, 2025/01/15