diff options
Diffstat (limited to 'drivers/net/xen-netback/common.h')
| -rw-r--r-- | drivers/net/xen-netback/common.h | 35 | 
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 2532ce85d718..d4eb8d2e9cb7 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -44,6 +44,7 @@  #include <xen/interface/grant_table.h>  #include <xen/grant_table.h>  #include <xen/xenbus.h> +#include <linux/debugfs.h>  typedef unsigned int pending_ring_idx_t;  #define INVALID_PENDING_RING_IDX (~0U) @@ -164,6 +165,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */  	u16 dealloc_ring[MAX_PENDING_REQS];  	struct task_struct *dealloc_task;  	wait_queue_head_t dealloc_wq; +	atomic_t inflight_packets;  	/* Use kthread for guest RX */  	struct task_struct *task; @@ -175,9 +177,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]; @@ -197,6 +199,20 @@ struct xenvif_queue { /* Per-queue data for xenvif */  	struct xenvif_stats stats;  }; +enum state_bit_shift { +	/* This bit marks that the vif is 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 {  	/* Unique identifier for this interface. */  	domid_t          domid; @@ -219,11 +235,16 @@ struct xenvif {  	 * frontend is rogue.  	 */  	bool disabled; +	unsigned long status;  	/* Queues */  	struct xenvif_queue *queues;  	unsigned int num_queues; /* active queues, resource allocated */ +#ifdef CONFIG_DEBUG_FS +	struct dentry *xenvif_dbg_root; +#endif +  	/* Miscellaneous private stuff. */  	struct net_device *dev;  }; @@ -297,10 +318,20 @@ static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue)  /* Callback from stack when TX packet can be released */  void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success); +irqreturn_t xenvif_interrupt(int irq, void *dev_id); +  extern bool separate_tx_rx_irq;  extern unsigned int rx_drain_timeout_msecs;  extern unsigned int rx_drain_timeout_jiffies;  extern unsigned int xenvif_max_queues; +#ifdef CONFIG_DEBUG_FS +extern struct dentry *xen_netback_dbg_root; +#endif + +void xenvif_skb_zerocopy_prepare(struct xenvif_queue *queue, +				 struct sk_buff *skb); +void xenvif_skb_zerocopy_complete(struct xenvif_queue *queue); +  #endif /* __XEN_NETBACK__COMMON_H__ */  |