hw/net: e1000e: Correct the initial value of VET register
commitd897056960fb379302cc9b656b899829f571eb6e
authorChristina Wang <christina.wang@windriver.com>
Fri, 23 Jul 2021 07:55:11 +0000 (23 15:55 +0800)
committerJason Wang <jasowang@redhat.com>
Mon, 2 Aug 2021 04:19:18 +0000 (2 12:19 +0800)
treef7ab7067739a9741b0484b15fa2bc19e31a66c97
parenta1d7e475beb5c9e7a8e1213f29b0d20a208a9ade
hw/net: e1000e: Correct the initial value of VET register

The initial value of VLAN Ether Type (VET) register is 0x8100, as per
the manual and real hardware.

While Linux e1000e driver always writes VET register to 0x8100, it is
not always the case for everyone. Drivers relying on the reset value
of VET won't be able to transmit and receive VLAN frames in QEMU.

Unlike e1000 in QEMU, e1000e uses a field 'vet' in "struct E1000Core"
to cache the value of VET register, but the cache only gets updated
when VET register is written. To always get a consistent VET value
no matter VET is written or remains its reset value, drop the 'vet'
field and use 'core->mac[VET]' directly.

Reported-by: Markus Carlstedt <markus.carlstedt@windriver.com>
Signed-off-by: Christina Wang <christina.wang@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/core/machine.c
hw/net/e1000e.c
hw/net/e1000e_core.c