diff options
author | Zoltan Kiss <zoltan.kiss@citrix.com> | 2014-08-04 16:20:58 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-05 16:04:46 -0700 |
commit | f34a4cf9c9b4fd35ba7f9a596cedb011879a1a4d (patch) | |
tree | 00be3a0233299ae75e9ab75ca4940cdea15fb6d9 /drivers/net/xen-netback/common.h | |
parent | 3d1af1df9762e56e563e8fd088a1b4ce2bcfaf8b (diff) | |
download | op-kernel-dev-f34a4cf9c9b4fd35ba7f9a596cedb011879a1a4d.zip op-kernel-dev-f34a4cf9c9b4fd35ba7f9a596cedb011879a1a4d.tar.gz |
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>
Diffstat (limited to 'drivers/net/xen-netback/common.h')
-rw-r--r-- | drivers/net/xen-netback/common.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 4a92fc1..ef3026f 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -176,9 +176,9 @@ struct xenvif_queue { /* Per-queue data for xenvif */ struct xen_netif_rx_back_ring rx; struct sk_buff_head rx_queue; RING_IDX rx_last_skb_slots; - bool rx_queue_purge; + unsigned long status; - struct timer_list wake_queue; + struct timer_list rx_stalled; struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; @@ -200,7 +200,16 @@ struct xenvif_queue { /* Per-queue data for xenvif */ enum state_bit_shift { /* This bit marks that the vif is connected */ - VIF_STATUS_CONNECTED + VIF_STATUS_CONNECTED, + /* This bit signals the RX thread that queuing was stopped (in + * start_xmit), and either the timer fired or an RX interrupt came + */ + QUEUE_STATUS_RX_PURGE_EVENT, + /* This bit tells the interrupt handler that this queue was the reason + * for the carrier off, so it should kick the thread. Only queues which + * brought it down can turn on the carrier. + */ + QUEUE_STATUS_RX_STALLED }; struct xenvif { |