[Spice-commits] 3 commits - VERSION hw/e1000.c

Gerd Hoffmann kraxel at kemper.freedesktop.org
Tue Dec 4 04:53:25 PST 2012


 VERSION    |    2 +-
 hw/e1000.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 16c6c80ac3a772b42a87b77dfdf0fdac7c607b0e
Author: Anthony Liguori <aliguori at us.ibm.com>
Date:   Mon Dec 3 14:08:40 2012 -0600

    Open up 1.4 development branch
    
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

diff --git a/VERSION b/VERSION
index f0bb29e..52356d3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.0
+1.3.50
commit 6d6c9f59ca1b1a76ade7ad868bef191818f58819
Author: Anthony Liguori <aliguori at us.ibm.com>
Date:   Mon Dec 3 08:02:50 2012 -0600

    Update version for 1.3.0 release
    
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

diff --git a/VERSION b/VERSION
index 19838b2..f0bb29e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.92
+1.3.0
commit b0d9ffcd0251161c7c92f94804dcf599dfa3edeb
Author: Michael Contreras <michael at inetric.com>
Date:   Sun Dec 2 20:11:22 2012 -0800

    e1000: Discard packets that are too long if !SBP and !LPE
    
    The e1000_receive function for the e1000 needs to discard packets longer than
    1522 bytes if the SBP and LPE flags are disabled. The linux driver assumes
    this behavior and allocates memory based on this assumption.
    
    Signed-off-by: Michael Contreras <michael at inetric.com>
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

diff --git a/hw/e1000.c b/hw/e1000.c
index cb7e7e8..5537ad2 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -59,6 +59,9 @@ static int debugflags = DBGBIT(TXERR) | DBGBIT(GENERAL);
 #define PNPMMIO_SIZE      0x20000
 #define MIN_BUF_SIZE      60 /* Min. octets in an ethernet frame sans FCS */
 
+/* this is the size past which hardware will drop packets when setting LPE=0 */
+#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+
 /*
  * HW models:
  *  E1000_DEV_ID_82540EM works with Windows and Linux
@@ -805,6 +808,13 @@ e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size)
         size = sizeof(min_buf);
     }
 
+    /* Discard oversized packets if !LPE and !SBP. */
+    if (size > MAXIMUM_ETHERNET_VLAN_SIZE
+        && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)
+        && !(s->mac_reg[RCTL] & E1000_RCTL_SBP)) {
+        return size;
+    }
+
     if (!receive_filter(s, buf, size))
         return size;
 


More information about the Spice-commits mailing list