qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net/vmxnet3: Flush packets when device gets activated
@ 2015-08-18 11:25 Shmulik Ladkani
  2015-08-19 17:32 ` Dmitry Fleytman
  2015-08-19 18:45 ` Fam Zheng
  0 siblings, 2 replies; 5+ messages in thread
From: Shmulik Ladkani @ 2015-08-18 11:25 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi; +Cc: Dmitry Fleytman, Fam Zheng, Shmulik Ladkani

As of a90a7425cf592a3afeff3eaf32f543b83050ee5c 'tap: Drop tap_can_send'
vmxnet3 (with tap networking) can no longer receive once device is
deactivated.
Alas, as the device is initially "inactive", this brakes vmxnet3
receive functionality.

vmxnet3_can_receive() checks its internal 'device_active' flag (among
other tests).
However, as of a90a7425cf, if 'device_active' is false, packets will be
queued by tap_send (at qemu_net_queue_send).

However, vmxnet3 never flushes the queue, even if the device is later
activated.

Fix by calling 'qemu_flush_queued_packets()' when vmxnet3 device gets
active.

Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
---
 hw/net/vmxnet3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 59b06b8..8387571 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1561,6 +1561,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
     vmxnet3_reset_mac(s);
 
     s->device_active = true;
+    qemu_flush_queued_packets(qemu_get_queue(s->nic));
 }
 
 static void vmxnet3_handle_command(VMXNET3State *s, uint64_t cmd)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-04  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 11:25 [Qemu-devel] [PATCH] net/vmxnet3: Flush packets when device gets activated Shmulik Ladkani
2015-08-19 17:32 ` Dmitry Fleytman
2015-08-19 18:45 ` Fam Zheng
2015-09-02 13:48   ` Stefan Hajnoczi
2015-09-04  7:12     ` Shmulik Ladkani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).