diff options
author | Zoltan Kiss <zoltan.kiss@citrix.com> | 2014-03-06 16:48:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-07 15:57:15 -0500 |
commit | 093507885ae5dc0288af07fbb922d2f85b3a88a6 (patch) | |
tree | f9fef41eb8e9a433dd8e9f44b7d9d9ff9aa392c8 /drivers/net/xen-netback/common.h | |
parent | e3377f36ca20a034dce56335dc9b89f41094d845 (diff) |
xen-netback: Timeout packets in RX path
A malicious or buggy guest can leave its queue filled indefinitely, in which
case qdisc start to queue packets for that VIF. If those packets came from an
another guest, it can block its slots and prevent shutdown. To avoid that, we
make sure the queue is drained in every 10 seconds.
The QDisc queue in worst case takes 3 round to flush usually.
Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
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 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index f2f8a02afc36..0355f8767e3b 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -148,6 +148,9 @@ struct xenvif { | |||
148 | struct xen_netif_rx_back_ring rx; | 148 | struct xen_netif_rx_back_ring rx; |
149 | struct sk_buff_head rx_queue; | 149 | struct sk_buff_head rx_queue; |
150 | RING_IDX rx_last_skb_slots; | 150 | RING_IDX rx_last_skb_slots; |
151 | bool rx_queue_purge; | ||
152 | |||
153 | struct timer_list wake_queue; | ||
151 | 154 | ||
152 | /* This array is allocated seperately as it is large */ | 155 | /* This array is allocated seperately as it is large */ |
153 | struct gnttab_copy *grant_copy_op; | 156 | struct gnttab_copy *grant_copy_op; |
@@ -259,4 +262,7 @@ void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success); | |||
259 | 262 | ||
260 | extern bool separate_tx_rx_irq; | 263 | extern bool separate_tx_rx_irq; |
261 | 264 | ||
265 | extern unsigned int rx_drain_timeout_msecs; | ||
266 | extern unsigned int rx_drain_timeout_jiffies; | ||
267 | |||
262 | #endif /* __XEN_NETBACK__COMMON_H__ */ | 268 | #endif /* __XEN_NETBACK__COMMON_H__ */ |