diff options
author | 2022-12-16 17:24:48 +0530 | |
---|---|---|
committer | 2022-12-19 21:14:08 +0530 | |
commit | 3409364da8fa46eae8ca22a579e219dc74958079 (patch) | |
tree | 83cb1cc72c3c59465d7d3be0f793a896c0ad7a21 /src/bpfswitch/ksrc/xdp_dummy.c | |
parent | 34147ac299351c44d4f7d135892457fba38a132b (diff) |
ebpf: This patch adds ebpf-baremetal test support
Remove object files and binaries
Suggestions in systems/Readme.
Add license headers.
Signed-off-by: Sridhar K. N. Rao <srao@linuxfoundation.org>
Change-Id: I5fd481e3ed3eb51e6b8091cbf6d1ec8e3b00cbf0
Diffstat (limited to 'src/bpfswitch/ksrc/xdp_dummy.c')
-rw-r--r-- | src/bpfswitch/ksrc/xdp_dummy.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bpfswitch/ksrc/xdp_dummy.c b/src/bpfswitch/ksrc/xdp_dummy.c new file mode 100644 index 00000000..d60c1c07 --- /dev/null +++ b/src/bpfswitch/ksrc/xdp_dummy.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Dummy XDP program + * + * David Ahern <dsahern@gmail.com> + */ +#define KBUILD_MODNAME "xdp_dummy" +#include <uapi/linux/bpf.h> +#include <linux/version.h> +#include <bpf/bpf_helpers.h> + +SEC("xdp_dummy") +int xdp_dummy_prog(struct xdp_md *ctx) +{ + //bpf_debug("ingress: device %u queue %u\n", + // ctx->ingress_ifindex, ctx->rx_queue_index); + + return XDP_PASS; +} + +char _license[] SEC("license") = "GPL"; +int _version SEC("version") = LINUX_VERSION_CODE; |