]> git.proxmox.com Git - qemu.git/commit - net/net.c
net: fix qemu_flush_queued_packets() in presence of a hub
authorLuigi Rizzo <rizzo@iet.unipi.it>
Tue, 5 Feb 2013 16:53:31 +0000 (17:53 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 27 Feb 2013 15:10:23 +0000 (16:10 +0100)
commit199ee608f0d08510b5c6c37f31a7fbff211d63c4
tree62d264bb698419fdc701bd11830d47d905cab9e8
parentee24aaf356f44ca7c8fbef136a438c12091cffd0
net: fix qemu_flush_queued_packets() in presence of a hub

When frontend and backend are connected through a hub as below
(showing only one direction), and the frontend (or in general, all
output ports of the hub) cannot accept more traffic, the backend
queues packets in queue-A.

When the frontend (or in general, one output port) becomes ready again,
quemu tries to flush packets from queue-B, which is unfortunately empty.

  e1000.0 <--[queue B]-- hub0port0(hub)hub0port1 <--[queue A]-- tap.0

To fix this i propose to introduce a new function net_hub_flush()
which is called when trying to flush a queue connected to a hub.

Signed-off-by: Luigi Rizzo <rizzo@iet.unipi.it>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net/hub.c
net/hub.h
net/net.c