Skip to content

XDP adjust head support for virtio

John Fastabend netdev 2 versions – In review

Get series with b4
b4 am 20170203031251.23054.25387.stgit@john-Precision-Tower-5810

Versions newest first · linked by author and title

  1. v2 Latest5 patches 18 repliesIn review
  2. v15 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5virtio_net: wrap rtnl_lock in test for calling with lock already helddrivers/net/virtio_net.c+21 -101 reply
2/5virtio_net: factor out xdp handler for readabilitydrivers/net/virtio_net.c+35 -511 reply
3/5virtio_net: remove duplicate queue pair binding in XDPdrivers/net/virtio_net.c+7 -131 reply
4/5virtio_net: refactor freeze/restore logic into virtnet reset logicdrivers/net/virtio_net.c drivers/virtio/virtio.c include/linux/virtio.h+73 -481 reply
5/5virtio_net: XDP support for adjust_headdrivers/net/virtio_net.c+125 -294 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexei StarovoitovMichael S. TsirkinJason Wang
SeriesA-b A-b
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [net-next PATCH v2 0/5] XDP adjust head support for virtio

This series adds adjust head support for virtio. The following is my test setup. I use qemu + virtio as follows,

./x86_64-softmmu/qemu-system-x86_64 \
-hda /var/lib/libvirt/images/Fedora-test0.img \
-m 4096 -enable-kvm -smp 2 -netdev tap,id=hn0,queues=4,vhost=on \
-device virtio-net-pci,netdev=hn0,mq=on,guest_tso4=off,guest_tso6=off,guest_ecn=off,guest_ufo=off,vectors=9

In order to use XDP with virtio until LRO is supported TSO must be turned off in the host. The important fields in the above command line are the following,

guest_tso4=off,guest_tso6=off,guest_ecn=off,guest_ufo=off

Also note it is possible to conusme more queues than can be supported because when XDP is enabled for retransmit XDP attempts to use a queue per cpu. My standard queue count is 'queues=4'.

After loading the VM I run the relevant XDP test programs in,

./sammples/bpf

For this series I tested xdp1, xdp2, and xdp_tx_iptunnel. I usually test with iperf (-d option to get bidirectional traffic), ping, and pktgen. I also have a modified xdp1 that returns XDP_PASS on any packet to ensure the normal traffic path to the stack continues to work with XDP loaded.

It would be great to automate this soon. At the moment I do it by hand which is starting to get tedious.

v2: original series dropped trace points after merge.

---

John Fastabend (5):
virtio_net: wrap rtnl_lock in test for calling with lock already held
virtio_net: factor out xdp handler for readability
virtio_net: remove duplicate queue pair binding in XDP
virtio_net: refactor freeze/restore logic into virtnet reset logic
virtio_net: XDP support for adjust_head

 drivers/net/virtio_net.c |  338 ++++++++++++++++++++++++++++++----------------
 drivers/virtio/virtio.c  |   42 +++---
 include/linux/virtio.h   |    4 +
 3 files changed, 247 insertions(+), 137 deletions(-)