aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index d6abf191122a..96ccd4e943db 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -364,6 +364,7 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
364 RING_IDX cons, prod; 364 RING_IDX cons, prod;
365 unsigned short id; 365 unsigned short id;
366 struct sk_buff *skb; 366 struct sk_buff *skb;
367 bool more_to_do;
367 368
368 BUG_ON(!netif_carrier_ok(queue->info->netdev)); 369 BUG_ON(!netif_carrier_ok(queue->info->netdev));
369 370
@@ -398,18 +399,8 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
398 399
399 queue->tx.rsp_cons = prod; 400 queue->tx.rsp_cons = prod;
400 401
401 /* 402 RING_FINAL_CHECK_FOR_RESPONSES(&queue->tx, more_to_do);
402 * Set a new event, then check for race with update of tx_cons. 403 } while (more_to_do);
403 * Note that it is essential to schedule a callback, no matter
404 * how few buffers are pending. Even if there is space in the
405 * transmit ring, higher layers may be blocked because too much
406 * data is outstanding: in such cases notification from Xen is
407 * likely to be the only kick that we'll get.
408 */
409 queue->tx.sring->rsp_event =
410 prod + ((queue->tx.sring->req_prod - prod) >> 1) + 1;
411 mb(); /* update shared area */
412 } while ((cons == prod) && (prod != queue->tx.sring->rsp_prod));
413 404
414 xennet_maybe_wake_tx(queue); 405 xennet_maybe_wake_tx(queue);
415} 406}