[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 14/21] e1000: Discard oversized packets based on SB
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 14/21] e1000: Discard oversized packets based on SBP|LPE |
Date: |
Wed, 16 Jan 2013 10:49:16 -0600 |
From: Michael Contreras <address@hidden>
Discard packets longer than 16384 when !SBP to match the hardware behavior.
Signed-off-by: Michael Contreras <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit 2c0331f4f7d241995452b99afaf0aab00493334a)
Signed-off-by: Michael Roth <address@hidden>
---
hw/e1000.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/e1000.c b/hw/e1000.c
index 5537ad2..e772c8e 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -61,6 +61,8 @@ static int debugflags = DBGBIT(TXERR) | DBGBIT(GENERAL);
/* this is the size past which hardware will drop packets when setting LPE=0 */
#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+/* this is the size past which hardware will drop packets when setting LPE=1 */
+#define MAXIMUM_ETHERNET_LPE_SIZE 16384
/*
* HW models:
@@ -809,8 +811,9 @@ e1000_receive(NetClientState *nc, const uint8_t *buf,
size_t size)
}
/* Discard oversized packets if !LPE and !SBP. */
- if (size > MAXIMUM_ETHERNET_VLAN_SIZE
- && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)
+ if ((size > MAXIMUM_ETHERNET_LPE_SIZE ||
+ (size > MAXIMUM_ETHERNET_VLAN_SIZE
+ && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)))
&& !(s->mac_reg[RCTL] & E1000_RCTL_SBP)) {
return size;
}
--
1.7.9.5
- [Qemu-stable] [PATCH 03/21] Fix off-by-1 error in RAM migration code, (continued)
- [Qemu-stable] [PATCH 03/21] Fix off-by-1 error in RAM migration code, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 05/21] target-mips: Fix incorrect code and test for INSV, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 06/21] target-mips: Fix incorrect shift for SHILO and SHILOV, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 04/21] migration: Fix madvise breakage if host and guest have different page sizes, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 07/21] vfio-pci: Don't use kvm_irqchip_in_kernel, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 11/21] target-xtensa: fix ITLB/DTLB page protection flags, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 12/21] qxl: save qemu_create_displaysurface_from result, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 10/21] pixman: fix vnc tight png/jpeg support, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 16/21] buffered_file: do not send more than s->bytes_xfer bytes per tick, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 20/21] vfio-pci: Loosen sanity checks to allow future features, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 14/21] e1000: Discard oversized packets based on SBP|LPE,
Michael Roth <=
- [Qemu-stable] [PATCH 18/21] vfio-pci: Make host MSI-X enable track guest, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 13/21] qxl+vnc: register a vm state change handler for dummy spice_server, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 17/21] target-xtensa: fix search_pc for the last TB opcode, Michael Roth, 2013/01/16
- Re: [Qemu-stable] Patch Round-up for stable 1.3.1, freeze Monday, Michael Tokarev, 2013/01/16
- [Qemu-stable] [PATCH 19/21] pci-assign: Enable MSIX on device to match guest, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 15/21] migration: fix migration_bitmap leak, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 21/21] raw-posix: fix bdrv_aio_ioctl, Michael Roth, 2013/01/16
- [Qemu-stable] [PATCH 08/21] seabios: update to e8a76b0f225bba5ba9d63ab227e0a37b3beb1059, Michael Roth, 2013/01/17