aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netback/common.h')
-rw-r--r--drivers/net/xen-netback/common.h35
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 @@
44#include <xen/interface/grant_table.h> 44#include <xen/interface/grant_table.h>
45#include <xen/grant_table.h> 45#include <xen/grant_table.h>
46#include <xen/xenbus.h> 46#include <xen/xenbus.h>
47#include <linux/debugfs.h>
47 48
48typedef unsigned int pending_ring_idx_t; 49typedef unsigned int pending_ring_idx_t;
49#define INVALID_PENDING_RING_IDX (~0U) 50#define INVALID_PENDING_RING_IDX (~0U)
@@ -164,6 +165,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */
164 u16 dealloc_ring[MAX_PENDING_REQS]; 165 u16 dealloc_ring[MAX_PENDING_REQS];
165 struct task_struct *dealloc_task; 166 struct task_struct *dealloc_task;
166 wait_queue_head_t dealloc_wq; 167 wait_queue_head_t dealloc_wq;
168 atomic_t inflight_packets;
167 169
168 /* Use kthread for guest RX */ 170 /* Use kthread for guest RX */
169 struct task_struct *task; 171 struct task_struct *task;
@@ -175,9 +177,9 @@ struct xenvif_queue { /* Per-queue data for xenvif */
175 struct xen_netif_rx_back_ring rx; 177 struct xen_netif_rx_back_ring rx;
176 struct sk_buff_head rx_queue; 178 struct sk_buff_head rx_queue;
177 RING_IDX rx_last_skb_slots; 179 RING_IDX rx_last_skb_slots;
178 bool rx_queue_purge; 180 unsigned long status;
179 181
180 struct timer_list wake_queue; 182 struct timer_list rx_stalled;
181 183
182 struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; 184 struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS];
183 185
@@ -197,6 +199,20 @@ struct xenvif_queue { /* Per-queue data for xenvif */
197 struct xenvif_stats stats; 199 struct xenvif_stats stats;
198}; 200};
199 201
202enum state_bit_shift {
203 /* This bit marks that the vif is connected */
204 VIF_STATUS_CONNECTED,
205 /* This bit signals the RX thread that queuing was stopped (in
206 * start_xmit), and either the timer fired or an RX interrupt came
207 */
208 QUEUE_STATUS_RX_PURGE_EVENT,
209 /* This bit tells the interrupt handler that this queue was the reason
210 * for the carrier off, so it should kick the thread. Only queues which
211 * brought it down can turn on the carrier.
212 */
213 QUEUE_STATUS_RX_STALLED
214};
215
200struct xenvif { 216struct xenvif {
201 /* Unique identifier for this interface. */ 217 /* Unique identifier for this interface. */
202 domid_t domid; 218 domid_t domid;
@@ -219,11 +235,16 @@ struct xenvif {
219 * frontend is rogue. 235 * frontend is rogue.
220 */ 236 */
221 bool disabled; 237 bool disabled;
238 unsigned long status;
222 239
223 /* Queues */ 240 /* Queues */
224 struct xenvif_queue *queues; 241 struct xenvif_queue *queues;
225 unsigned int num_queues; /* active queues, resource allocated */ 242 unsigned int num_queues; /* active queues, resource allocated */
226 243
244#ifdef CONFIG_DEBUG_FS
245 struct dentry *xenvif_dbg_root;
246#endif
247
227 /* Miscellaneous private stuff. */ 248 /* Miscellaneous private stuff. */
228 struct net_device *dev; 249 struct net_device *dev;
229}; 250};
@@ -297,10 +318,20 @@ static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue)
297/* Callback from stack when TX packet can be released */ 318/* Callback from stack when TX packet can be released */
298void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success); 319void xenvif_zerocopy_callback(struct ubuf_info *ubuf, bool zerocopy_success);
299 320
321irqreturn_t xenvif_interrupt(int irq, void *dev_id);
322
300extern bool separate_tx_rx_irq; 323extern bool separate_tx_rx_irq;
301 324
302extern unsigned int rx_drain_timeout_msecs; 325extern unsigned int rx_drain_timeout_msecs;
303extern unsigned int rx_drain_timeout_jiffies; 326extern unsigned int rx_drain_timeout_jiffies;
304extern unsigned int xenvif_max_queues; 327extern unsigned int xenvif_max_queues;
305 328
329#ifdef CONFIG_DEBUG_FS
330extern struct dentry *xen_netback_dbg_root;
331#endif
332
333void xenvif_skb_zerocopy_prepare(struct xenvif_queue *queue,
334 struct sk_buff *skb);
335void xenvif_skb_zerocopy_complete(struct xenvif_queue *queue);
336
306#endif /* __XEN_NETBACK__COMMON_H__ */ 337#endif /* __XEN_NETBACK__COMMON_H__ */