diff options
author | David Vrabel <david.vrabel@citrix.com> | 2016-10-04 11:29:16 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-07 02:37:36 +0200 |
commit | 98f6d57ced73b723551568262019f1d6c8771f20 (patch) | |
tree | cc8cc59b8b34aed750dd8c020fbd31dca62165af /drivers/net/xen-netback | |
parent | xen-netback: immediately wake tx queue when guest rx queue has space (diff) | |
download | linux-98f6d57ced73b723551568262019f1d6c8771f20.tar.xz linux-98f6d57ced73b723551568262019f1d6c8771f20.zip |
xen-netback: process guest rx packets in batches
Instead of only placing one skb on the guest rx ring at a time, process
a batch of up-to 64. This improves performance by ~10% in some tests.
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>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r-- | drivers/net/xen-netback/rx.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 95487091763c..ae822b8fa76d 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -399,7 +399,7 @@ static void xenvif_rx_extra_slot(struct xenvif_queue *queue, BUG(); } -void xenvif_rx_action(struct xenvif_queue *queue) +void xenvif_rx_skb(struct xenvif_queue *queue) { struct xenvif_pkt_state pkt; @@ -425,6 +425,19 @@ void xenvif_rx_action(struct xenvif_queue *queue) xenvif_rx_complete(queue, &pkt); } +#define RX_BATCH_SIZE 64 + +void xenvif_rx_action(struct xenvif_queue *queue) +{ + unsigned int work_done = 0; + + while (xenvif_rx_ring_slots_available(queue) && + work_done < RX_BATCH_SIZE) { + xenvif_rx_skb(queue); + work_done++; + } +} + static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue) { RING_IDX prod, cons; |