summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2016-10-04 10:29:15 +0100
committerDavid S. Miller <davem@davemloft.net>2016-10-06 20:37:35 -0400
commit7c0b1a23e6f983fe392c8ffa71d05189ae52ebb5 (patch)
tree23e2a43b4eb1c8effe25848939163dd4d36562e3
parenteb1723a29b9a75dd787510a39096a68dba6cc200 (diff)
downloadlinux-7c0b1a23e6f983fe392c8ffa71d05189ae52ebb5.tar.gz
linux-7c0b1a23e6f983fe392c8ffa71d05189ae52ebb5.tar.bz2
linux-7c0b1a23e6f983fe392c8ffa71d05189ae52ebb5.zip
xen-netback: immediately wake tx queue when guest rx queue has space
When an skb is removed from the guest rx queue, immediately wake the tx queue, instead of after processing them. Signed-off-by: David Vrabel <david.vrabel@citrix.com> [re-based] Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/xen-netback/rx.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c
index b0ce4c6e9b21..95487091763c 100644
--- a/drivers/net/xen-netback/rx.c
+++ b/drivers/net/xen-netback/rx.c
@@ -92,25 +92,19 @@ static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue)
spin_lock_irq(&queue->rx_queue.lock);
skb = __skb_dequeue(&queue->rx_queue);
- if (skb)
+ if (skb) {
queue->rx_queue_len -= skb->len;
+ if (queue->rx_queue_len < queue->rx_queue_max) {
+ struct netdev_queue *txq;
- spin_unlock_irq(&queue->rx_queue.lock);
-
- return skb;
-}
-
-static void xenvif_rx_queue_maybe_wake(struct xenvif_queue *queue)
-{
- spin_lock_irq(&queue->rx_queue.lock);
-
- if (queue->rx_queue_len < queue->rx_queue_max) {
- struct net_device *dev = queue->vif->dev;
-
- netif_tx_wake_queue(netdev_get_tx_queue(dev, queue->id));
+ txq = netdev_get_tx_queue(queue->vif->dev, queue->id);
+ netif_tx_wake_queue(txq);
+ }
}
spin_unlock_irq(&queue->rx_queue.lock);
+
+ return skb;
}
static void xenvif_rx_queue_purge(struct xenvif_queue *queue)
@@ -585,8 +579,6 @@ int xenvif_kthread_guest_rx(void *data)
*/
xenvif_rx_queue_drop_expired(queue);
- xenvif_rx_queue_maybe_wake(queue);
-
cond_resched();
}