summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@netronome.com>2019-02-11 15:01:20 +0300
committerAlexei Starovoitov <ast@kernel.org>2019-02-12 07:31:38 +0300
commitbd4aed0ee73ca873bef3cb3ec746dd796f03df28 (patch)
tree1dcd4de735f8ca3dbf672dc5d48d064ea1dea5dc /tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c
parent4836b4637ef080c2764c44ee40ed354cdb991d79 (diff)
downloadlinux-bd4aed0ee73ca873bef3cb3ec746dd796f03df28.tar.xz
selftests: bpf: centre kernel bpf objects under new subdir "progs"
At the moment, all kernel bpf objects are listed under BPF_OBJ_FILES. Listing them manually sometimes causing patch conflict when people are adding new testcases simultaneously. It is better to centre all the related source files under a subdir "progs", then auto-generate the object file list. Suggested-by: Alexei Starovoitov <ast@kernel.org> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c')
-rw-r--r--tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c b/tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c
deleted file mode 100644
index 12a7b5c82ed6..000000000000
--- a/tools/testing/selftests/bpf/sockmap_tcp_msg_prog.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <linux/bpf.h>
-#include "bpf_helpers.h"
-#include "bpf_util.h"
-#include "bpf_endian.h"
-
-int _version SEC("version") = 1;
-
-#define bpf_printk(fmt, ...) \
-({ \
- char ____fmt[] = fmt; \
- bpf_trace_printk(____fmt, sizeof(____fmt), \
- ##__VA_ARGS__); \
-})
-
-SEC("sk_msg1")
-int bpf_prog1(struct sk_msg_md *msg)
-{
- void *data_end = (void *)(long) msg->data_end;
- void *data = (void *)(long) msg->data;
-
- char *d;
-
- if (data + 8 > data_end)
- return SK_DROP;
-
- bpf_printk("data length %i\n", (__u64)msg->data_end - (__u64)msg->data);
- d = (char *)data;
- bpf_printk("hello sendmsg hook %i %i\n", d[0], d[1]);
-
- return SK_PASS;
-}
-
-char _license[] SEC("license") = "GPL";