diff options
Diffstat (limited to 'drivers/net/xen-netback/common.h')
-rw-r--r-- | drivers/net/xen-netback/common.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index d4eb8d2e9cb7..083ecc93fe5e 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -176,10 +176,11 @@ struct xenvif_queue { /* Per-queue data for xenvif */ | |||
176 | char rx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-rx */ | 176 | char rx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-rx */ |
177 | struct xen_netif_rx_back_ring rx; | 177 | struct xen_netif_rx_back_ring rx; |
178 | struct sk_buff_head rx_queue; | 178 | struct sk_buff_head rx_queue; |
179 | RING_IDX rx_last_skb_slots; | ||
180 | unsigned long status; | ||
181 | 179 | ||
182 | struct timer_list rx_stalled; | 180 | unsigned int rx_queue_max; |
181 | unsigned int rx_queue_len; | ||
182 | unsigned long last_rx_time; | ||
183 | bool stalled; | ||
183 | 184 | ||
184 | struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; | 185 | struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; |
185 | 186 | ||
@@ -199,18 +200,14 @@ struct xenvif_queue { /* Per-queue data for xenvif */ | |||
199 | struct xenvif_stats stats; | 200 | struct xenvif_stats stats; |
200 | }; | 201 | }; |
201 | 202 | ||
203 | /* Maximum number of Rx slots a to-guest packet may use, including the | ||
204 | * slot needed for GSO meta-data. | ||
205 | */ | ||
206 | #define XEN_NETBK_RX_SLOTS_MAX (MAX_SKB_FRAGS + 1) | ||
207 | |||
202 | enum state_bit_shift { | 208 | enum state_bit_shift { |
203 | /* This bit marks that the vif is connected */ | 209 | /* This bit marks that the vif is connected */ |
204 | VIF_STATUS_CONNECTED, | 210 | 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 | }; | 211 | }; |
215 | 212 | ||
216 | struct xenvif { | 213 | struct xenvif { |
@@ -228,9 +225,6 @@ struct xenvif { | |||
228 | u8 ip_csum:1; | 225 | u8 ip_csum:1; |
229 | u8 ipv6_csum:1; | 226 | u8 ipv6_csum:1; |
230 | 227 | ||
231 | /* Internal feature information. */ | ||
232 | u8 can_queue:1; /* can queue packets for receiver? */ | ||
233 | |||
234 | /* Is this interface disabled? True when backend discovers | 228 | /* Is this interface disabled? True when backend discovers |
235 | * frontend is rogue. | 229 | * frontend is rogue. |
236 | */ | 230 | */ |
@@ -240,6 +234,9 @@ struct xenvif { | |||
240 | /* Queues */ | 234 | /* Queues */ |
241 | struct xenvif_queue *queues; | 235 | struct xenvif_queue *queues; |
242 | unsigned int num_queues; /* active queues, resource allocated */ | 236 | unsigned int num_queues; /* active queues, resource allocated */ |
237 | unsigned int stalled_queues; | ||
238 | |||
239 | spinlock_t lock; | ||
243 | 240 | ||
244 | #ifdef CONFIG_DEBUG_FS | 241 | #ifdef CONFIG_DEBUG_FS |
245 | struct dentry *xenvif_dbg_root; | 242 | struct dentry *xenvif_dbg_root; |
@@ -249,6 +246,14 @@ struct xenvif { | |||
249 | struct net_device *dev; | 246 | struct net_device *dev; |
250 | }; | 247 | }; |
251 | 248 | ||
249 | struct xenvif_rx_cb { | ||
250 | unsigned long expires; | ||
251 | int meta_slots_used; | ||
252 | bool full_coalesce; | ||
253 | }; | ||
254 | |||
255 | #define XENVIF_RX_CB(skb) ((struct xenvif_rx_cb *)(skb)->cb) | ||
256 | |||
252 | static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif) | 257 | static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif) |
253 | { | 258 | { |
254 | return to_xenbus_device(vif->dev->dev.parent); | 259 | return to_xenbus_device(vif->dev->dev.parent); |
@@ -272,8 +277,6 @@ void xenvif_xenbus_fini(void); | |||
272 | 277 | ||
273 | int xenvif_schedulable(struct xenvif *vif); | 278 | int xenvif_schedulable(struct xenvif *vif); |
274 | 279 | ||
275 | int xenvif_must_stop_queue(struct xenvif_queue *queue); | ||
276 | |||
277 | int xenvif_queue_stopped(struct xenvif_queue *queue); | 280 | int xenvif_queue_stopped(struct xenvif_queue *queue); |
278 | void xenvif_wake_queue(struct xenvif_queue *queue); | 281 | void xenvif_wake_queue(struct xenvif_queue *queue); |
279 | 282 | ||
@@ -296,6 +299,8 @@ void xenvif_kick_thread(struct xenvif_queue *queue); | |||
296 | 299 | ||
297 | int xenvif_dealloc_kthread(void *data); | 300 | int xenvif_dealloc_kthread(void *data); |
298 | 301 | ||
302 | void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb); | ||
303 | |||
299 | /* Determine whether the needed number of slots (req) are available, | 304 | /* Determine whether the needed number of slots (req) are available, |
300 | * and set req_event if not. | 305 | * and set req_event if not. |
301 | */ | 306 | */ |