summaryrefslogtreecommitdiff
path: root/net/xdp/xsk.h
diff options
context:
space:
mode:
authorBjörn Töpel <bjorn.topel@intel.com>2019-01-24 19:59:39 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2019-01-25 01:50:03 +0100
commita36b38aa2af61146ea80980a01cf6e952ab021c1 (patch)
tree910d7378db7613ea6d36759dce35211dfb9766b8 /net/xdp/xsk.h
parent50e74c0131a5b3a3e387798a5705158c04fb3bd0 (diff)
xsk: add sock_diag interface for AF_XDP
This patch adds the sock_diag interface for querying sockets from user space. Tools like iproute2 ss(8) can use this interface to list open AF_XDP sockets. The user-space ABI is defined in linux/xdp_diag.h and includes netlink request and response structs. The request can query sockets and the response contains socket information about the rings, umems, inode and more. Signed-off-by: Björn Töpel <bjorn.topel@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/xdp/xsk.h')
-rw-r--r--net/xdp/xsk.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/xdp/xsk.h b/net/xdp/xsk.h
new file mode 100644
index 000000000000..ba8120610426
--- /dev/null
+++ b/net/xdp/xsk.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright(c) 2019 Intel Corporation. */
+
+#ifndef XSK_H_
+#define XSK_H_
+
+static inline struct xdp_sock *xdp_sk(struct sock *sk)
+{
+ return (struct xdp_sock *)sk;
+}
+
+#endif /* XSK_H_ */