[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/43] e1000: drop check_rxov, always treat RX ring
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 11/43] e1000: drop check_rxov, always treat RX ring with RDH == RDT as empty |
Date: |
Mon, 3 Dec 2012 16:08:35 -0600 |
From: Dmitry Fleytman <address@hidden>
Real HW always treats RX ring with RDH == RDT as empty.
Emulation is supposed to behave the same.
Reported-by: Chris Webb <address@hidden>
Reported-by: Richard Davies <address@hidden>
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit e5b8b0d4ba29fe1268ba049519a1b0cf8552a21a)
Signed-off-by: Michael Roth <address@hidden>
---
hw/e1000.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/e1000.c b/hw/e1000.c
index ec3a7c4..4d4ac32 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -92,7 +92,6 @@ typedef struct E1000State_st {
uint32_t rxbuf_size;
uint32_t rxbuf_min_shift;
- int check_rxov;
struct e1000_tx {
unsigned char header[256];
unsigned char vlan_header[4];
@@ -741,11 +740,11 @@ static bool e1000_has_rxbufs(E1000State *s, size_t
total_size)
int bufs;
/* Fast-path short packets */
if (total_size <= s->rxbuf_size) {
- return s->mac_reg[RDH] != s->mac_reg[RDT] || !s->check_rxov;
+ return s->mac_reg[RDH] != s->mac_reg[RDT];
}
if (s->mac_reg[RDH] < s->mac_reg[RDT]) {
bufs = s->mac_reg[RDT] - s->mac_reg[RDH];
- } else if (s->mac_reg[RDH] > s->mac_reg[RDT] || !s->check_rxov) {
+ } else if (s->mac_reg[RDH] > s->mac_reg[RDT]) {
bufs = s->mac_reg[RDLEN] / sizeof(struct e1000_rx_desc) +
s->mac_reg[RDT] - s->mac_reg[RDH];
} else {
@@ -848,7 +847,6 @@ e1000_receive(NetClientState *nc, const uint8_t *buf,
size_t size)
if (++s->mac_reg[RDH] * sizeof(desc) >= s->mac_reg[RDLEN])
s->mac_reg[RDH] = 0;
- s->check_rxov = 1;
/* see comment in start_xmit; same here */
if (s->mac_reg[RDH] == rdh_start) {
DBGOUT(RXERR, "RDH wraparound @%x, RDT %x, RDLEN %x\n",
@@ -925,7 +923,6 @@ mac_writereg(E1000State *s, int index, uint32_t val)
static void
set_rdt(E1000State *s, int index, uint32_t val)
{
- s->check_rxov = 0;
s->mac_reg[index] = val & 0xffff;
if (e1000_has_rxbufs(s, 1)) {
qemu_flush_queued_packets(&s->nic->nc);
--
1.7.9.5
- [Qemu-devel] [PATCH 01/43] configure: Fix CONFIG_QEMU_HELPERDIR generation, (continued)
- [Qemu-devel] [PATCH 01/43] configure: Fix CONFIG_QEMU_HELPERDIR generation, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 04/43] vnc: fix "info vnc" with "-vnc ..., reverse=on", Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 05/43] uhci: Raise interrupt when requested even for non active tds, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 07/43] qxl: always update displaysurface on resize, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 06/43] hw/qxl: qxl_dirty_surfaces: use uintptr_t, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 08/43] rtc: fix overflow in mktimegm, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 10/43] target-i386: Allow tsc-frequency to be larger then 2.147G, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 09/43] hw: Fix return value check for bdrv_read, bdrv_write, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 12/43] memory: fix rendering of a region obscured by another, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 13/43] s390x: fix -initrd in virtio machine, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 11/43] e1000: drop check_rxov, always treat RX ring with RDH == RDT as empty,
Michael Roth <=
- [Qemu-devel] [PATCH 15/43] target-sparc64: disable VGA cirrus, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 16/43] xhci: fix usb name in caps, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 14/43] PPC: Bamboo: Fix memory size DT property, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 17/43] tools: initialize main loop before block layer, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 19/43] nbd: fixes to read-only handling, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 18/43] m68k: Return semihosting errno values correctly, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 20/43] mips/malta: fix CBUS UART interrupt pin, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 21/43] target-mips: fix wrong microMIPS opcode encoding, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 23/43] tcg/arm: fix cross-endian qemu_st16, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 22/43] tcg/arm: fix TLB access in qemu-ld/st ops, Michael Roth, 2012/12/03