]> git.proxmox.com Git - pve-qemu-kvm.git/blob - debian/patches/e1000-discard-oversized-packets.patch
update backup patches
[pve-qemu-kvm.git] / debian / patches / e1000-discard-oversized-packets.patch
1 From 2c0331f4f7d241995452b99afaf0aab00493334a Mon Sep 17 00:00:00 2001
2 From: Michael Contreras <michael@inetric.com>
3 Date: Wed, 5 Dec 2012 13:31:30 -0500
4 Subject: [PATCH] e1000: Discard oversized packets based on SBP|LPE
5
6 Discard packets longer than 16384 when !SBP to match the hardware behavior.
7
8 Signed-off-by: Michael Contreras <michael@inetric.com>
9 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 ---
11 hw/e1000.c | 7 +++++--
12 1 files changed, 5 insertions(+), 2 deletions(-)
13
14 diff --git a/hw/e1000.c b/hw/e1000.c
15 index 92fb00a..8fd1654 100644
16 --- a/hw/e1000.c
17 +++ b/hw/e1000.c
18 @@ -61,6 +61,8 @@ static int debugflags = DBGBIT(TXERR) | DBGBIT(GENERAL);
19
20 /* this is the size past which hardware will drop packets when setting LPE=0 */
21 #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
22 +/* this is the size past which hardware will drop packets when setting LPE=1 */
23 +#define MAXIMUM_ETHERNET_LPE_SIZE 16384
24
25 /*
26 * HW models:
27 @@ -809,8 +811,9 @@ e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size)
28 }
29
30 /* Discard oversized packets if !LPE and !SBP. */
31 - if (size > MAXIMUM_ETHERNET_VLAN_SIZE
32 - && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)
33 + if ((size > MAXIMUM_ETHERNET_LPE_SIZE ||
34 + (size > MAXIMUM_ETHERNET_VLAN_SIZE
35 + && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)))
36 && !(s->mac_reg[RCTL] & E1000_RCTL_SBP)) {
37 return size;
38 }