Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 702498a1 authored by Mickaël Salaün's avatar Mickaël Salaün Committed by David S. Miller
Browse files

bpf: Remove bpf_sys.h from selftests



Add require dependency headers.

Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4874d01
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -50,7 +50,13 @@ static __u64 ptr_to_u64(const void *ptr)
static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
		   unsigned int size)
{
#ifdef __NR_bpf
	return syscall(__NR_bpf, cmd, attr, size);
#else
	fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
	errno = ENOSYS;
	return -1;
#endif
}

int bpf_create_map(enum bpf_map_type map_type, int key_size,
+0 −27
Original line number Diff line number Diff line
#ifndef __BPF_SYS__
#define __BPF_SYS__

#include <stdint.h>
#include <stdlib.h>

#include <sys/syscall.h>

#include <linux/bpf.h>

static inline __u64 bpf_ptr_to_u64(const void *ptr)
{
	return (__u64)(unsigned long) ptr;
}

static inline int bpf(int cmd, union bpf_attr *attr, unsigned int size)
{
#ifdef __NR_bpf
	return syscall(__NR_bpf, cmd, attr, size);
#else
	fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
	errno = ENOSYS;
	return -1;
#endif
}

#endif /* __BPF_SYS__ */
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
#include <sys/resource.h>

#include <bpf/bpf.h>
#include "bpf_sys.h"
#include "bpf_util.h"

struct tlpm_node {
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#include <sys/resource.h>

#include <bpf/bpf.h>
#include "bpf_sys.h"
#include "bpf_util.h"

#define LOCAL_FREE_TARGET	(128)
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include <linux/bpf.h>

#include <bpf/bpf.h>
#include "bpf_sys.h"
#include "bpf_util.h"

static int map_flags;
Loading