Skip to content

Commit

Permalink
Add bpf() syscall feature check and readme update
Browse files Browse the repository at this point in the history
Fixes: iovisor#283
Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
Brenden Blanco committed Nov 9, 2015
1 parent 795c4e7 commit e3c57ce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Kernel requirements

## Requirements

In general, to use these features, a Linux kernel version 4.1 or newer is
required. In addition, the following flags should be set:

- `CONFIG_BPF=y`
- `CONFIG_BPF_SYSCALL=y`
- `CONFIG_NET_CLS_BPF=m` [optional, for tc filters]
- `CONFIG_NET_ACT_BPF=m` [optional, for tc actions]
- `CONFIG_BPF_JIT=y`
- `CONFIG_HAVE_BPF_JIT=y`
- `CONFIG_BPF_EVENTS=y` [optional, for kprobes]

# Ubuntu - Binary

Install a 4.3+ kernel from http:https://kernel.ubuntu.com/~kernel-ppa/mainline,
Expand Down
4 changes: 4 additions & 0 deletions src/cc/export/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <uapi/linux/if_packet.h>
#include <linux/version.h>

#ifndef CONFIG_BPF_SYSCALL
#error "CONFIG_BPF_SYSCALL is undefined, please check your .config or ask your Linux distro to enable this feature"
#endif

/* helper macro to place programs, maps, license in
* different sections in elf_bpf file. Section names
* are interpreted by elf_bpf loader
Expand Down

0 comments on commit e3c57ce

Please sign in to comment.