On 12/2/19 11:47 AM, Jason Wang wrote:
On 2019/12/2 上午12:45, David Ahern wrote:
On 11/26/19 4:07 AM, Prashant Bhole wrote:
From: Jason Wang
This patch introduces an ioctl way to set an offloaded XDP program
to tun driver. This ioctl will be used by qemu to offload XDP program
from
On 11/28/19 5:42 AM, Michael S. Tsirkin wrote:
On Tue, Nov 26, 2019 at 07:07:41PM +0900, Prashant Bhole wrote:
From: Jason Wang
This patch implements bpf_prog_offload_ops callbacks and adds handling
for XDP_SETUP_PROG_HW. Handling of XDP_SETUP_PROG_HW involves setting
up struct
On 11/26/19 7:33 PM, no-re...@patchew.org wrote:
Patchew URL:
https://patchew.org/QEMU/20191126100914.5150-1-prashantbhole.li...@gmail.com/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing
commands and
their output below. If you have Docker installed, y
will get a chance to perform the fd replacement in its own copy of the
program.
Solution:
Let's introduce a setup() callback in bpf_prog_offload_ops. It will be
non mandetory. The verifier will call it just before replacing the map
fds.
Signed-off-by: Jason Wang
Signed-off-by: Prashant
eneric_xdp_core()
net: core: export do_xdp_generic_core()
tun: set offloaded xdp program
virtio-net: store xdp_prog in device
virtio_net: add XDP prog offload infrastructure
virtio_net: implement XDP prog offload functionality
bpf: export function __bpf_map_get
virtio_net: implmen
From: Jason Wang
This patch introduces an ioctl way to set an offloaded XDP program
to tun driver. This ioctl will be used by qemu to offload XDP program
from virtio_net in the guest.
Signed-off-by: Jason Wang
Signed-off-by: Prashant Bhole
---
drivers/net/tun.c | 19
y are passed
to vhost_net.
Signed-off-by: Prashant Bhole
---
drivers/net/tap.c | 22 ++-
drivers/net/tun.c | 24 -
drivers/vhost/net.c| 48 +++---
include/linux/if_tun.h | 18
4 files change
ent, it is considered as
XDP_TX'ed packet from offloaded program.
Signed-off-by: Prashant Bhole
---
drivers/net/tun.c | 35 ---
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 466ea69f00ee..8d6cdd3e51
eaves the action handling to us.
Signed-off-by: Prashant Bhole
---
drivers/net/tun.c | 149 +-
1 file changed, 146 insertions(+), 3 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ecb49101b0b5..466ea69f00ee 100644
--- a/drivers/net/
From: Jason Wang
This is a preparation for adding XDP offload support in virtio_net
driver. By storing XDP program in virtionet_info will make it
consistent with the offloaded program which will introduce in next
patches.
Signed-off-by: Jason Wang
Co-developed-by: Prashant Bhole
Signed-off-by
: Prashant Bhole
Signed-off-by: Prashant Bhole
---
drivers/net/virtio_net.c | 103 +++
1 file changed, 103 insertions(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index cee5c2b15c62..a1088d0114f2 100644
--- a/drivers/net/virtio_net.c
+++ b
.
Signed-off-by: Jason Wang
Co-developed-by: Prashant Bhole
Signed-off-by: Prashant Bhole
---
drivers/net/virtio_net.c| 114 +++-
include/uapi/linux/virtio_net.h | 27
2 files changed, 139 insertions(+), 2 deletions(-)
diff --git a/drivers/net
by renaming it.
Signed-off-by: Jason Wang
Signed-off-by: Prashant Bhole
---
net/core/dev.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index c7fc902ccbdc..5ae647b9914f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4461,9
tory yet. Hence changes to virtio_net.h
are for RFC purpose only.
Jason Wang (2):
virtio-net: add support for offloading XDP program
virtio-net: add support for offloading an ebpf map
Prashant Bhole (1):
configure: add libbpf support
configure |
Remove usage of ptr ring of tuntap in vhost_net and remove the
functions exported from tuntap drivers to get ptr ring.
Signed-off-by: Prashant Bhole
---
drivers/net/tap.c | 13 -
drivers/net/tun.c | 13 -
drivers/vhost/net.c| 31
Next patches will introduce virtio_net XDP offloading. In that case
we need to manage offloaded and non-offload program. In order to make
it consistent this patch introduces use of XDP attachment helpers.
Signed-off-by: Prashant Bhole
---
drivers/net/virtio_net.c | 30
From: Jason Wang
Let's export do_xdp_generic as a general purpose function. It will
just run XDP program on skb but will not handle XDP actions.
Signed-off-by: Jason Wang
Signed-off-by: Prashant Bhole
---
include/linux/netdevice.h | 2 ++
net/core/dev.c| 6 +++---
2 files ch
Since we are offloading this program to the host, some of the helper
calls will not make sense. For example get_numa_node_id. Some helpers
can not be used because we don't handle them yet.
So let's allow a small set of helper calls for now.
Signed-off-by: Prashant Bhole
---
d
From: Jason Wang
__bpf_map_get is necessary to get verify whether an fd corresponds
to a bpf map, without adding a refcount on that map. After exporting
it can be used by a kernel module.
Signed-off-by: Jason Wang
Signed-off-by: Prashant Bhole
---
kernel/bpf/syscall.c | 1 +
1 file changed
When offloaded program returns XDP_TX, we need to inject the packet in
Rx path of tun. This patch injects such packets in Rx path using
tun_xdp_one.
Signed-off-by: Prashant Bhole
---
drivers/net/tun.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b
have map fds from the host side for each offloaded map when
program verification begins. map fds in the copy of the program are
replaced with map fds from host side. This copy of program is used
for offloading.
Signed-off-by: Jason Wang
Co-developed-by: Prashant Bhole
Signed-off-by: Prashant
by an ebpf program instructions. An array of bpf_insn is
prepared and passed to libbpf API bpf_load_program. The program fd is
retuned by the API is then attached to tap fd using TUNSETOFFLOADEDXDP
ioctl command.
Signed-off-by: Jason Wang
Co-developed-by: Prashant Bhole
Signed-off-by: Prashant
It handles the case when qemu performs read on tun using file
operations.
Signed-off-by: Prashant Bhole
---
drivers/net/tun.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 084ca95358fe..639921c10e32 100644
--- a/drivers/net/tun.c
/value or key/key pair.
Map manipulation is done using libbpf APIs.
Signed-off-by: Jason Wang
Co-developed-by: Prashant Bhole
Signed-off-by: Prashant Bhole
---
hw/net/Makefile.objs| 2 +
hw/net/virtio-net.c | 88 +
include
.
Signed-off-by: Prashant Bhole
---
configure | 23 +++
1 file changed, 23 insertions(+)
diff --git a/configure b/configure
index 6099be1d84..a7e8a8450d 100755
--- a/configure
+++ b/configure
@@ -504,6 +504,7 @@ debug_mutex="no"
libpmem=""
default_device
tun_msg_ctl is used by vhost_net to communicate with tuntap. We will
introduce another type in soon. As a preparation this patch adds
conditions to check tun_msg_ctl type at necessary places.
Signed-off-by: Prashant Bhole
---
drivers/net/tap.c | 7 +--
drivers/net/tun.c | 6 +-
2 files
26 matches
Mail list logo