iproute2/include
Daniel Borkmann c7272ca720 bpf: add initial support for attaching xdp progs
Now that we made the BPF loader generic as a library, reuse it
for loading XDP programs as well. This basically adds a minimal
start of a facility for iproute2 to load XDP programs. There
currently only exists the xdp1_user.c sample code in the kernel
tree that sets up netlink directly and an iovisor/bcc front-end.

Since we have all the necessary infrastructure in place already
from tc side, we can just reuse its loader back-end and thus
facilitate migration and usability among the two for people
familiar with tc/bpf already. Sharing maps, performing tail calls,
etc works the same way as with tc. Naturally, once kernel
configuration API evolves, we will extend new features for XDP
here as well, resp. extend dumping of related netlink attributes.

Minimal example:

  clang -target bpf -O2 -Wall -c prog.c -o prog.o
  ip [-force] link set dev em1 xdp obj prog.o       # attaching
  ip [-d] link                                      # dumping
  ip link set dev em1 xdp off                       # detaching

For the dump, intention is that in the first line for each ip
link entry, we'll see "xdp" to indicate that this device has an
XDP program attached. Once we dump some more useful information
via netlink (digest, etc), idea is that 'ip -d link' will then
display additional relevant program information below the "link/
ether [...]" output line for such devices, for example.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
2016-12-09 12:44:12 -08:00
..
iptables Update to current iptables headers 2016-01-03 15:14:27 -08:00
libiptc Update to current iptables headers 2016-01-03 15:14:27 -08:00
linux update kernel headers from net-next 2016-12-09 12:40:07 -08:00
netinet ss: report ecnseen 2011-11-23 14:51:54 -08:00
SNAPSHOT.h v4.8.0 2016-10-09 19:00:11 -07:00
bpf_api.h bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
bpf_elf.h bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
bpf_scm.h tc, bpf: finalize eBPF support for cls and act front-end 2015-04-10 13:31:19 -07:00
bpf_util.h bpf: make tc's bpf loader generic and move into lib 2016-11-29 12:35:32 -08:00
color.h color: introduce color helpers and COLOR_CLEAR 2016-03-27 10:37:34 -07:00
dlfcn.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
ip6tables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00
iptables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00
iptables_common.h fix build warnings 2007-06-20 10:55:18 -07:00
json_writer.h provide common json output formatter 2015-08-23 10:05:29 -07:00
libgenl.h libgenl: introduce genl_init_handle 2016-08-17 13:59:21 -07:00
libnetlink.h libnetlink: Introduce rta_getattr_be*() 2016-12-02 14:12:09 -08:00
list.h list: add list_add_tail helper 2016-04-19 08:01:05 -07:00
ll_map.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
names.h tc class: Ignore if default class name file does not exist 2015-04-07 08:31:56 -07:00
namespace.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
rt_names.h make the addr argument of ll_addr_n2a const 2015-03-24 15:45:23 -07:00
rtm_map.h ip, realms: also allow to pass in raw realms value 2015-10-22 23:40:51 -07:00
utils.h bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
xt-internal.h Breakage noticed when debian upgraded to xtables (iptables > 1.4.1) 2009-02-19 09:02:13 -08:00
xtables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00