Skip to content

Defer skb allocation for both mergeable buffers and big packets in virtio_net

Shirley Ma kvm lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 of 4 patches 26 repliesIn review
  2. v11 patch 19 repliesSuperseded

3 of 4 patches are in this archive. The cover letter announces 4.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Defer skb allocation -- add destroy buffers function for virtiodrivers/net/virtio_net.c drivers/virtio/virtio_ring.c include/linux/virtio.h+35 -010 replies
2/4Defer skb allocation -- new skb_set calls & chain pages in virtio_netdrivers/net/virtio_net.c+90 -155 replies
4/4Defer skb allocation -- change allocation & receiving in recv pathdrivers/net/virtio_net.c+42 -1772 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] Defer skb allocation for both mergeable buffers and big packets in virtio_net

This is a patch-set for deferring skb allocation based on Rusty and Michael's inputs.

Guest virtio_net receives packets from its pre-allocated vring buffers, then it delivers these packets to upper layer protocols as skb buffs. So it's not necessary to pre-allocate skb for each mergable buffer, then frees it when it's useless.

This patch has deferred skb allocation when receiving packets for both big packets and mergeable buffers. It reduces skb pre-allocations and skb_frees.

A destroy function has been created to push virtio free buffs to vring for unused pages, and used page private to maintain page list.

This patch has tested and measured against 2.6.32-rc7 git. It is built again 2.6.32 kernel. Tests have been done for small packets, big packets and mergeable buffers.

The single netperf TCP_STREAM performance improved for host to guest. It also reduces UDP packets drop rate.

Thanks
Shirley