xen-netback: Turn off the carrier if the guest is not able to receive
authorZoltan Kiss <zoltan.kiss@citrix.com>
Mon, 4 Aug 2014 15:20:58 +0000 (16:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Aug 2014 23:04:46 +0000 (16:04 -0700)
commitf34a4cf9c9b4fd35ba7f9a596cedb011879a1a4d
tree00be3a0233299ae75e9ab75ca4940cdea15fb6d9
parent3d1af1df9762e56e563e8fd088a1b4ce2bcfaf8b
xen-netback: Turn off the carrier if the guest is not able to receive

Currently when the guest is not able to receive more packets, qdisc layer starts
a timer, and when it goes off, qdisc is started again to deliver a packet again.
This is a very slow way to drain the queues, consumes unnecessary resources and
slows down other guests shutdown.
This patch change the behaviour by turning the carrier off when that timer
fires, so all the packets are freed up which were stucked waiting for that vif.
Instead of the rx_queue_purge bool it uses the VIF_STATUS_RX_PURGE_EVENT bit to
signal the thread that either the timeout happened or an RX interrupt arrived,
so the thread can check what it should do. It also disables NAPI, so the guest
can't transmit, but leaves the interrupts on, so it can resurrect.
Only the queues which brought down the interface can enable it again, the bit
QUEUE_STATUS_RX_STALLED makes sure of that.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netback/common.h
drivers/net/xen-netback/interface.c
drivers/net/xen-netback/netback.c