iproute2/include
Daniel Borkmann 11c39b5e98 tc: add eBPF support to f_bpf
This work adds the tc frontend for kernel commit e2e9b6541dd4 ("cls_bpf:
add initial eBPF support for programmable classifiers").

A C-like classifier program (f.e. see e2e9b6541dd4) is being compiled via
LLVM's eBPF backend into an ELF file, that is then being passed to tc. tc
then loads, if any, eBPF maps and eBPF opcodes (with fixed-up eBPF map file
descriptors) out of its dedicated sections, and via bpf(2) into the kernel
and then the resulting fd via netlink down to cls_bpf. cls_bpf allows for
annotations, currently, I've used the file name for that, so that the user
can easily identify his filter when dumping configurations back.

Example usage:

  clang -O2 -emit-llvm -c cls.c -o - | llc -march=bpf -filetype=obj -o cls.o
  tc filter add dev em1 parent 1: bpf run object-file cls.o classid x:y

  tc filter show dev em1 [...]
  filter parent 1: protocol all pref 49152 bpf handle 0x1 flowid x:y cls.o

I placed the parser bits derived from Alexei's kernel sample, into tc_bpf.c
as my next step is to also add the same support for BPF action, so we can
have a fully fledged eBPF classifier and action in tc.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
2015-03-24 15:45:23 -07:00
..
libiptc iproute2: Support IFF_LOWER_UP and IFF_DORMANT 2007-06-19 16:40:40 -07:00
linux update kernel headers to net-next 4.0-rc5 2015-03-24 15:45:23 -07:00
netinet ss: report ecnseen 2011-11-23 14:51:54 -08:00
SNAPSHOT.h v3.19.0 2015-02-10 15:14:32 -08:00
dlfcn.h Fix build when shared libraries are disabled 2013-03-13 08:29:59 -07:00
hlist.h ll_map: add name and index hash 2013-03-28 14:57:28 -07:00
ip6tables.h Remove trailing whitespace 2006-12-05 10:10:22 -08:00
iptables.h Fix compilation error of m_ipt.c with -Werror enabled 2013-02-26 17:35:26 -08:00
iptables_common.h fix build warnings 2007-06-20 10:55:18 -07:00
libgenl.h iproute2: GENL: merge GENL_REQUEST and GENL_INITIALIZER 2012-09-17 15:46:45 -07:00
libnetlink.h ipnetns: allow to get and set netns ids 2015-02-21 16:54:53 -08:00
ll_map.h cleanup warnings 2014-08-04 10:30:35 -07:00
names.h tc class: Show class names from file 2015-03-15 12:27:40 -07:00
namespace.h lib: Exec func on each netns 2015-02-05 10:28:19 -08:00
rt_names.h ss: Identify more netlink protocol names 2014-11-29 11:13:38 -08:00
rtm_map.h (Logical change 1.3) 2004-04-15 20:56:59 +00:00
utils.h tc: add eBPF support to f_bpf 2015-03-24 15:45:23 -07:00
xt-internal.h Breakage noticed when debian upgraded to xtables (iptables > 1.4.1) 2009-02-19 09:02:13 -08:00