Skip to content

virtio-net: avoid XDP and _F_GUEST_CSUM

Heng Qi bpf llvm netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4virtio-net: a helper for probing the pseudo-header checksumdrivers/net/virtio_net.c+95 -00 replies
2/4virtio-net: reprobe csum related fields for skb passed by XDPdrivers/net/virtio_net.c+38 -02 replies
3/4virtio-net: support coexistence of XDP and _F_GUEST_CSUMdrivers/net/virtio_net.c+24 -127 replies
4/4virtio-net: remove F_GUEST_CSUM check for XDP loadingdrivers/net/virtio_net.c+1 -35 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchXuan Zhuo
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/4] virtio-net: avoid XDP and _F_GUEST_CSUM

virtio-net needs to clear the VIRTIO_NET_F_GUEST_CSUM feature when loading XDP. The main reason for doing this is because VIRTIO_NET_F_GUEST_CSUM allows to receive packets marked as VIRTIO_NET_HDR_F_NEEDS_CSUM. Such packets are not compatible with XDP programs, because we cannot guarantee that the csum_{start, offset} fields are correct after XDP modifies the packets.

There is also an existing problem, in the same host vm-vm (eg [vm]<->[ovs vhost-user]<->[vm]) scenario, loading XDP will cause packet loss.

To solve the above problems, we have discussed in the [1] proposal, and now try to solve it through the method of reprobing fields suggested by Jason.

[1] https://lists.oasis-open.org/archives/virtio-dev/202305/msg00318.html

Heng Qi (4):
virtio-net: a helper for probing the pseudo-header checksum
virtio-net: reprobe csum related fields for skb passed by XDP
virtio-net: virtio-net: support coexistence of XDP and _F_GUEST_CSUM
virtio-net: remove F_GUEST_CSUM check for XDP loading

 drivers/net/virtio_net.c | 173 +++++++++++++++++++++++++++++++++++----
 1 file changed, 158 insertions(+), 15 deletions(-)
Signature · 1 line
2.19.1.6.gb485710b