[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/40] e1000x: Take CRC into consideration for size check
From: |
Akihiko Odaki |
Subject: |
[PATCH 15/40] e1000x: Take CRC into consideration for size check |
Date: |
Fri, 14 Apr 2023 20:37:12 +0900 |
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.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/net/e1000x_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c
index 6cc23138a8..b4dfc74b66 100644
--- a/hw/net/e1000x_common.c
+++ b/hw/net/e1000x_common.c
@@ -142,10 +142,10 @@ bool e1000x_is_oversized(uint32_t *mac, size_t size)
{
/* this is the size past which hardware will
drop packets when setting LPE=0 */
- static const int maximum_ethernet_vlan_size = 1522;
+ static const int maximum_ethernet_vlan_size = 1522 - 4;
/* this is the size past which hardware will
drop packets when setting LPE=1 */
- static const int maximum_ethernet_lpe_size = 16 * KiB;
+ static const int maximum_ethernet_lpe_size = 16 * KiB - 4;
if ((size > maximum_ethernet_lpe_size ||
(size > maximum_ethernet_vlan_size
--
2.40.0
- [PATCH 08/40] igb: Always copy ethernet header, (continued)
- [PATCH 08/40] igb: Always copy ethernet header, Akihiko Odaki, 2023/04/14
- [PATCH 09/40] Fix references to igb Avocado test, Akihiko Odaki, 2023/04/14
- [PATCH 11/40] tests/avocado: Remove test_igb_nomsi_kvm, Akihiko Odaki, 2023/04/14
- [PATCH 10/40] tests/avocado: Remove unused imports, Akihiko Odaki, 2023/04/14
- [PATCH 12/40] hw/net/net_tx_pkt: Remove net_rx_pkt_get_l4_info, Akihiko Odaki, 2023/04/14
- [PATCH 13/40] net/eth: Rename eth_setup_vlan_headers_ex, Akihiko Odaki, 2023/04/14
- [PATCH 14/40] e1000x: Share more Rx filtering logic, Akihiko Odaki, 2023/04/14
- [PATCH 15/40] e1000x: Take CRC into consideration for size check,
Akihiko Odaki <=
- [PATCH 16/40] e1000e: Always log status after building rx metadata, Akihiko Odaki, 2023/04/14
- [PATCH 17/40] igb: Always log status after building rx metadata, Akihiko Odaki, 2023/04/14
- [PATCH 18/40] igb: Remove goto, Akihiko Odaki, 2023/04/14
- [PATCH 20/40] e1000e: Reset packet state after emptying Tx queue, Akihiko Odaki, 2023/04/14
- [PATCH 19/40] igb: Read DCMD.VLE of the first Tx descriptor, Akihiko Odaki, 2023/04/14