[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250527161904.75259-1-minhquangbui99@gmail.com>
Date: Tue, 27 May 2025 23:19:02 +0700
From: Bui Quang Minh <minhquangbui99@...il.com>
To: netdev@...r.kernel.org
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Eugenio Pérez <eperezma@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
virtualization@...ts.linux.dev,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org,
Bui Quang Minh <minhquangbui99@...il.com>
Subject: [RFC PATCH net-next v2 0/2] virtio-net: support zerocopy multi buffer XDP in mergeable
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
Powered by blists - more mailing lists