From: Bui Quang Minh <minhquangbui99@gmail.com>
To: netdev@vger.kernel.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"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>,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, "Bui Quang Minh" <minhquangbui99@gmail.com>
Subject: [RFC PATCH net-next v2 0/2] virtio-net: support zerocopy multi buffer XDP in mergeable
Date: Tue, 27 May 2025 23:19:02 +0700 [thread overview]
Message-ID: <20250527161904.75259-1-minhquangbui99@gmail.com> (raw)
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a single buffer only. This commit adds
support for multi mergeable receive buffer in the zerocopy XDP path by
utilizing XDP buffer with frags. This happens when the MTU of tap device
is set to 9000 so that a packet can exceed a single XDP buffer. As a
result, that packet will be split into multi buffer XDP.
This series also adds the test for virtio-net rx when an XDP socket is
bound to the interface. The test exercises both copy and zerocopy mode. We
can adjust the tap device's MTU to test both single buffer and multi
buffer XDP.
Changes in RFC v2:
- Return XDP_DROP when receiving multi-buffer XDP but BPF program does not
support it
- Add selftest
- Link to RFC v1: https://lore.kernel.org/netdev/20250426082752.43222-1-minhquangbui99@gmail.com/
Thanks,
Quang Minh.
Bui Quang Minh (2):
virtio-net: support zerocopy multi buffer XDP in mergeable
selftests: net: add XDP socket tests for virtio-net
drivers/net/virtio_net.c | 123 +++---
.../selftests/drivers/net/hw/.gitignore | 3 +
.../testing/selftests/drivers/net/hw/Makefile | 12 +-
.../drivers/net/hw/xsk_receive.bpf.c | 43 ++
.../selftests/drivers/net/hw/xsk_receive.c | 398 ++++++++++++++++++
.../selftests/drivers/net/hw/xsk_receive.py | 75 ++++
6 files changed, 596 insertions(+), 58 deletions(-)
create mode 100644 tools/testing/selftests/drivers/net/hw/xsk_receive.bpf.c
create mode 100644 tools/testing/selftests/drivers/net/hw/xsk_receive.c
create mode 100755 tools/testing/selftests/drivers/net/hw/xsk_receive.py
--
2.43.0
next reply other threads:[~2025-05-27 16:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 16:19 Bui Quang Minh [this message]
2025-05-27 16:19 ` [RFC PATCH net-next v2 1/2] " Bui Quang Minh
2025-05-28 16:44 ` ALOK TIWARI
2025-05-29 3:42 ` Bui Quang Minh
2025-05-29 5:59 ` Jason Wang
2025-05-29 12:28 ` Bui Quang Minh
2025-06-03 2:56 ` Jason Wang
2025-06-03 6:04 ` Lei Yang
2025-06-03 14:22 ` Bui Quang Minh
2025-05-27 16:19 ` [RFC PATCH net-next v2 2/2] selftests: net: add XDP socket tests for virtio-net Bui Quang Minh
2025-05-28 17:04 ` ALOK TIWARI
2025-05-29 3:44 ` Bui Quang Minh
2025-05-29 11:18 ` Maciej Fijalkowski
2025-05-29 14:29 ` Bui Quang Minh
2025-05-30 11:45 ` Maciej Fijalkowski
2025-05-31 8:51 ` Bui Quang Minh
2025-06-02 15:55 ` Maciej Fijalkowski
2025-06-03 14:18 ` Bui Quang Minh
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=20250527161904.75259-1-minhquangbui99@gmail.com \
--to=minhquangbui99@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=hawk@kernel.org \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=virtualization@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®