aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/xdp_dummy.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2018-11-07 12:38:35 +0100
committerDavid S. Miller <davem@davemloft.net>2018-11-07 16:23:05 -0800
commitbd8e1afe6436558de3a7b25eaef34b69d98e5719 (patch)
treeb8e21fef74ebc46d3c0ad9d004cf3fab17f5cb18 /tools/testing/selftests/bpf/xdp_dummy.c
parentselftests: add GRO support to udp bench rx program (diff)
downloadlinux-dev-bd8e1afe6436558de3a7b25eaef34b69d98e5719.tar.xz
linux-dev-bd8e1afe6436558de3a7b25eaef34b69d98e5719.zip
selftests: add dummy xdp test helper
This trivial XDP program does nothing, but will be used by the next patch to test the GRO path in a net namespace, leveraging the veth XDP implementation. It's added here, despite its 'net' usage, to avoid the duplication of the llc-related makefile boilerplate. rfc v3 -> v1: - move the helper implementation into the bpf directory, don't touch udpgso_bench_rx rfc v2 -> rfc v3: - move 'x' option handling here Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/bpf/xdp_dummy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/xdp_dummy.c b/tools/testing/selftests/bpf/xdp_dummy.c
new file mode 100644
index 000000000000..43b0ef1001ed
--- /dev/null
+++ b/tools/testing/selftests/bpf/xdp_dummy.c
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#define KBUILD_MODNAME "xdp_dummy"
+#include <linux/bpf.h>
+#include "bpf_helpers.h"
+
+SEC("xdp_dummy")
+int xdp_dummy_prog(struct xdp_md *ctx)
+{
+ return XDP_PASS;
+}
+
+char _license[] SEC("license") = "GPL";