All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heng Qi <hengqi@linux.alibaba.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: [PATCH net-next v4 0/2] virtio-net: avoid conflicts between XDP and GUEST_CSUM
Date: Wed, 28 Jun 2023 11:05:04 +0800	[thread overview]
Message-ID: <20230628030506.2213-1-hengqi@linux.alibaba.com> (raw)

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

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

---
v3->v4:
  - Rewrite some comments for patch [1/2].

v2->v3:
  - Use skb_checksum_setup() instead of virtnet_flow_dissect_udp_tcp(). @Jason Wang

v1->v2:
  - Squash v1's patch [1/4] and patch [2/4] into v2's patch [1/3]. @Michael S. Tsirkin
  - Some minor modifications.

Heng Qi (2):
  virtio-net: support coexistence of XDP and GUEST_CSUM
  virtio-net: remove GUEST_CSUM check for XDP

 drivers/net/virtio_net.c | 86 ++++++++++++++++++++++++++++++++--------
 1 file changed, 70 insertions(+), 16 deletions(-)

-- 
2.19.1.6.gb485710b


             reply	other threads:[~2023-06-28  3:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28  3:05 Heng Qi [this message]
2023-06-28  3:05 ` [PATCH net-next v4 1/2] virtio-net: support coexistence of XDP and GUEST_CSUM Heng Qi
2023-06-28  3:22   ` Jason Wang
2023-06-28  3:41     ` Heng Qi
     [not found]       ` <CACGkMEu=Cs5DFP+EFqxUXaiqz7vewhQ5zMMtChGpR_oGjrvMCg@mail.gmail.com>
     [not found]         ` <20230628045626.GA32321@h68b04307.sqa.eu95>
     [not found]           ` <CACGkMEt6Kb60Akn=aJjzJQg6Zg8F_24ezqAtwPOZxiu4-f7E3g@mail.gmail.com>
     [not found]             ` <620af708-42a0-f711-cd7c-43362751c842@linux.alibaba.com>
2023-06-29  4:03               ` Jason Wang
2023-06-29  4:11                 ` Jason Wang
2023-06-29  5:17                   ` Heng Qi
2023-06-29  5:47                 ` Heng Qi
2023-06-30  7:35                   ` Jason Wang
2023-06-30  9:57                     ` Heng Qi
2023-07-02 16:48                       ` Heng Qi
2023-07-03  6:33                         ` Jason Wang
2023-06-28  3:05 ` [PATCH net-next v4 2/2] virtio-net: remove GUEST_CSUM check for XDP Heng Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230628030506.2213-1-hengqi@linux.alibaba.com \
    --to=hengqi@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.