Skip to contentSkip to conversation

pcnet: Flush queued packets on end of STOP state

PATCH Applied Jan Kiszka 2 participants 2 messages Aug 2, 2013 – Aug 5, 2013

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 pcnet: Flush queued packets on end of STOP state

From: Jan Kiszka <[email protected]>

Analogously to other NICs, we have to inform the network layer when the can_receive handler will no longer report 0. Without this, we may get stuck waiting on queued incoming packets.

---
 hw/net/pcnet.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
hw/net/pcnet.c +4 -0
index b606d2b..63aa73a 100644
@@ -861,6 +861,8 @@ static void pcnet_init(PCNetState *s)
 
     s->csr[0] |= 0x0101;
     s->csr[0] &= ~0x0004;       /* clear STOP bit */
+
+    qemu_flush_queued_packets(qemu_get_queue(s->nic));
 }
 
 static void pcnet_start(PCNetState *s)
@@ -878,6 +880,8 @@ static void pcnet_start(PCNetState *s)
     s->csr[0] &= ~0x0004;       /* clear STOP bit */
     s->csr[0] |= 0x0002;
     pcnet_poll_timer(s);
+
+    qemu_flush_queued_packets(qemu_get_queue(s->nic));
 }
 
 static void pcnet_stop(PCNetState *s)
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 10 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Analogously to other NICs, we have to inform the network layer when the can_receive handler will no longer report 0. Without this, we may get stuck waiting on queued incoming packets.

---
 hw/net/pcnet.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Great, let's get this into the next QEMU 1.6-rc.

Thanks, applied to my net tree:
https://github.com/stefanha/qemu/commits/net

Stefan