bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] virtio-net: avoid XDP and _F_GUEST_CSUM
@ 2023-06-19 10:57 Heng Qi
  2023-06-19 10:57 ` [PATCH net-next 1/4] virtio-net: a helper for probing the pseudo-header checksum Heng Qi
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Heng Qi @ 2023-06-19 10:57 UTC (permalink / raw)
  To: netdev, bpf
  Cc: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend

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(-)

-- 
2.19.1.6.gb485710b


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-06-20 14:15 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 10:57 [PATCH net-next 0/4] virtio-net: avoid XDP and _F_GUEST_CSUM Heng Qi
2023-06-19 10:57 ` [PATCH net-next 1/4] virtio-net: a helper for probing the pseudo-header checksum Heng Qi
2023-06-19 12:30   ` kernel test robot
2023-06-19 12:30   ` kernel test robot
2023-06-19 10:57 ` [PATCH net-next 2/4] virtio-net: reprobe csum related fields for skb passed by XDP Heng Qi
2023-06-19 11:27   ` Michael S. Tsirkin
2023-06-19 12:29     ` Heng Qi
2023-06-19 13:32   ` kernel test robot
2023-06-19 10:57 ` [PATCH net-next 3/4] virtio-net: support coexistence of XDP and _F_GUEST_CSUM Heng Qi
2023-06-19 11:26   ` Michael S. Tsirkin
2023-06-19 12:31     ` Heng Qi
2023-06-20  3:24     ` Heng Qi
2023-06-20 10:50       ` Michael S. Tsirkin
2023-06-20 11:01         ` Heng Qi
2023-06-20 12:10           ` Michael S. Tsirkin
2023-06-20 14:15             ` Heng Qi
2023-06-19 10:57 ` [PATCH net-next 4/4] virtio-net: remove F_GUEST_CSUM check for XDP loading Heng Qi
2023-06-19 11:16   ` Michael S. Tsirkin
2023-06-19 12:41     ` Heng Qi
2023-06-19 14:33       ` Michael S. Tsirkin
2023-06-19 15:43         ` Heng Qi
2023-06-19 18:36           ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).