aboutsummaryrefslogtreecommitdiffstats
path: root/net/xdp/xdp_umem.h
diff options
context:
space:
mode:
authorMagnus Karlsson <magnus.karlsson@intel.com>2018-05-02 13:01:26 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-05-03 15:55:23 -0700
commit965a990984432cd01a9eb3514c64d86f56704295 (patch)
treee5fe0883da83cbc9f69f297f3b5090f74222404e /net/xdp/xdp_umem.h
parentxsk: add Rx queue setup and mmap support (diff)
downloadlinux-dev-965a990984432cd01a9eb3514c64d86f56704295.tar.xz
linux-dev-965a990984432cd01a9eb3514c64d86f56704295.zip
xsk: add support for bind for Rx
Here, the bind syscall is added. Binding an AF_XDP socket, means associating the socket to an umem, a netdev and a queue index. This can be done in two ways. The first way, creating a "socket from scratch". Create the umem using the XDP_UMEM_REG setsockopt and an associated fill queue with XDP_UMEM_FILL_QUEUE. Create the Rx queue using the XDP_RX_QUEUE setsockopt. Call bind passing ifindex and queue index ("channel" in ethtool speak). The second way to bind a socket, is simply skipping the umem/netdev/queue index, and passing another already setup AF_XDP socket. The new socket will then have the same umem/netdev/queue index as the parent so it will share the same umem. You must also set the flags field in the socket address to XDP_SHARED_UMEM. v2: Use PTR_ERR instead of passing error variable explicitly. Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/xdp/xdp_umem.h')
-rw-r--r--net/xdp/xdp_umem.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xdp/xdp_umem.h b/net/xdp/xdp_umem.h
index 25634b8a5c6f..b13133e9c501 100644
--- a/net/xdp/xdp_umem.h
+++ b/net/xdp/xdp_umem.h
@@ -39,6 +39,7 @@ struct xdp_umem {
struct work_struct work;
};
+bool xdp_umem_validate_queues(struct xdp_umem *umem);
int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr);
void xdp_get_umem(struct xdp_umem *umem);
void xdp_put_umem(struct xdp_umem *umem);