diff options
| author | Magnus Karlsson <magnus.karlsson@intel.com> | 2020-08-28 10:26:27 +0200 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-08-31 21:15:05 +0200 |
| commit | 2f6324a3937f8517967d94daef2ba0bdceceece1 (patch) | |
| tree | cc859d8a680e28657b9627b93099c7f7b7a3395e /tools/lib/bpf/libbpf.map | |
| parent | a1132430c2c55af62d13e9fca752d46f14d548b3 (diff) | |
| download | linux-next-2f6324a3937f8517967d94daef2ba0bdceceece1.tar.gz linux-next-2f6324a3937f8517967d94daef2ba0bdceceece1.zip | |
libbpf: Support shared umems between queues and devices
Add support for shared umems between hardware queues and devices to
the AF_XDP part of libbpf. This so that zero-copy can be achieved in
applications that want to send and receive packets between HW queues
on one device or between different devices/netdevs.
In order to create sockets that share a umem between hardware queues
and devices, a new function has been added called
xsk_socket__create_shared(). It takes the same arguments as
xsk_socket_create() plus references to a fill ring and a completion
ring. So for every socket that share a umem, you need to have one more
set of fill and completion rings. This in order to maintain the
single-producer single-consumer semantics of the rings.
You can create all the sockets via the new xsk_socket__create_shared()
call, or create the first one with xsk_socket__create() and the rest
with xsk_socket__create_shared(). Both methods work.
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Link: https://lore.kernel.org/bpf/1598603189-32145-14-git-send-email-magnus.karlsson@intel.com
Diffstat (limited to 'tools/lib/bpf/libbpf.map')
| -rw-r--r-- | tools/lib/bpf/libbpf.map | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 66a6286d0716..3fedcdc4ae2f 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -306,4 +306,5 @@ LIBBPF_0.2.0 { perf_buffer__buffer_fd; perf_buffer__epoll_fd; perf_buffer__consume_buffer; + xsk_socket__create_shared; } LIBBPF_0.1.0; |
