OSDN Git Service

e1000x: Take CRC into consideration for size check
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Tue, 23 May 2023 02:43:07 +0000 (11:43 +0900)
committerJason Wang <jasowang@redhat.com>
Tue, 23 May 2023 07:20:15 +0000 (15:20 +0800)
commit743495144208cd1871ce0971ae6c57925141c855
tree30a000aec3e3723ea9ed7176ef408814792acce7
parente9e5b930691e5995210ca82aa6b9516733c20577
e1000x: Take CRC into consideration for size check

Section 13.7.15 Receive Length Error Count says:
>  Packets over 1522 bytes are oversized if LongPacketEnable is 0b
> (RCTL.LPE). If LongPacketEnable (LPE) is 1b, then an incoming packet
> is considered oversized if it exceeds 16384 bytes.

> These lengths are based on bytes in the received packet from
> <Destination Address> through <CRC>, inclusively.

As QEMU processes packets without CRC, the number of bytes for CRC
need to be subtracted. This change adds some size definitions to be used
to derive the new size thresholds to eth.h.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/e1000x_common.c
include/net/eth.h