iproute2/ip
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
..
.gitignore Another .gitignore file. 2006-08-08 12:11:23 -07:00
ifcfg Remove trailing whitespace 2006-12-05 10:10:22 -08:00
ip6tunnel.c tunnels: use macros for IPv6 address comparison 2016-09-21 16:35:05 -07:00
ip_common.h iproute2: build nsid-name cache only for commands that need it 2016-10-09 18:56:47 -07:00
ip.c ila: Support for configuring ila to use netfilter hook 2016-08-12 12:50:15 -07:00
ipaddress.c bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
ipaddrlabel.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipfou.c fou: show usage even if the module is not available 2016-08-17 14:00:22 -07:00
ipila.c ila: show usage even if the module is not available 2016-08-17 14:00:28 -07:00
ipl2tp.c l2tp: style cleanup 2016-11-29 13:40:06 -08:00
iplink_bond_slave.c ip: Use specific slave id 2016-09-22 16:39:55 -07:00
iplink_bond.c lib/utils: introduce rt_addr_n2a_rta() 2016-03-27 10:37:35 -07:00
iplink_bridge_slave.c bridge: add support for the multicast flood flag 2016-10-17 05:29:24 -07:00
iplink_bridge.c iplink: bridge: remove unnecessary returns 2016-02-21 12:00:47 -08:00
iplink_can.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
iplink_geneve.c libnetlink: Introduce rta_getattr_be*() 2016-12-02 14:12:09 -08:00
iplink_hsr.c Added support for selection of new HSR version 2016-05-31 12:09:29 -07:00
iplink_ipoib.c ip: code cleanup 2016-03-21 11:52:19 -07:00
iplink_ipvlan.c ip: (ipvlan) introduce L3s mode 2016-09-20 09:50:45 -07:00
iplink_macvlan.c iproute2: macvlan: add "source" mode 2016-11-29 12:41:42 -08:00
iplink_vlan.c ip: code cleanup 2016-03-21 11:52:19 -07:00
iplink_vrf.c ip: Use specific slave id 2016-09-22 16:39:55 -07:00
iplink_vxlan.c libnetlink: Introduce rta_getattr_be*() 2016-12-02 14:12:09 -08:00
iplink_xdp.c bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
iplink.c bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
ipmacsec.c macsec: Nr. of packets and octets for macsec tx stats were swapped 2016-11-29 13:22:12 -08:00
ipmaddr.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipmonitor.c iproute2: build nsid-name cache only for commands that need it 2016-10-09 18:56:47 -07:00
ipmroute.c ipmroute: add support for age dumping 2016-10-09 19:09:31 -07:00
ipneigh.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipnetconf.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipnetns.c iproute2: build nsid-name cache only for commands that need it 2016-10-09 18:56:47 -07:00
ipntable.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
ipprefix.c lib/utils: introduce rt_addr_n2a_rta() 2016-03-27 10:37:35 -07:00
iproute_lwtunnel.c ila: Support for checksum neutral translation 2016-08-12 12:49:30 -07:00
iproute_lwtunnel.h lwtunnel: Add encapsulation support to ip route 2015-10-16 16:13:22 -07:00
iproute.c Merge branch 'master' into net-next 2016-12-01 10:29:12 -08:00
iprule.c ip: support UID range routing. 2016-11-29 12:26:37 -08:00
iptoken.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
iptunnel.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
iptuntap.c tuntap: Add name attribute to usage text 2016-09-08 14:31:33 -07:00
ipxfrm.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
link_gre6.c gre6: Support for fou encapsulation 2016-08-12 12:51:18 -07:00
link_gre.c gre6: Support for fou encapsulation 2016-08-12 12:51:18 -07:00
link_ip6tnl.c iptnl: add support for collect_md flag in IPv4 and IPv6 tunnels 2016-09-21 16:36:24 -07:00
link_iptnl.c iptnl: add support for collect_md flag in IPv4 and IPv6 tunnels 2016-09-21 16:36:24 -07:00
link_veth.c ip: code cleanup 2016-03-21 11:52:19 -07:00
link_vti6.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
link_vti.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
Makefile bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
routef ip/routef lifesaver 2007-07-10 18:29:20 -07:00
routel (Logical change 1.3) 2004-04-15 20:56:59 +00:00
rtm_map.c ip, realms: also allow to pass in raw realms value 2015-10-22 23:40:51 -07:00
rtmon.c ip: code cleanup 2016-03-21 11:52:19 -07:00
rtpr (Logical change 1.3) 2004-04-15 20:56:59 +00:00
static-syms.c Fix build when shared libraries are disabled 2013-03-13 08:29:59 -07:00
tcp_metrics.c libgenl: introduce genl_init_handle 2016-08-17 13:59:21 -07:00
tunnel.c ip: code cleanup 2016-03-21 11:52:19 -07:00
tunnel.h ip{,6}tunnel: have a shared stats parser/printer 2015-12-18 11:46:21 -08:00
xdp.h bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
xfrm_monitor.c utils: make rt_addr_n2a() non-reentrant by default 2016-03-27 10:37:34 -07:00
xfrm_policy.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
xfrm_state.c Use C99 style initializers everywhere 2016-07-20 12:05:24 -07:00
xfrm.h Fix FSF address in file headers 2013-12-06 15:05:07 -08:00