diff options
author | John Fastabend <john.fastabend@gmail.com> | 2017-07-17 09:27:28 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-17 09:48:06 -0700 |
commit | 832622e6bd1884c95475094941914969ff82b329 (patch) | |
tree | 26e3b2c3d653cbea952800e7323d7c7f8c77b8e3 /samples/bpf/Makefile | |
parent | 814abfabef3ceed390c10d06a0cc69a86454b6cf (diff) | |
download | lwn-832622e6bd1884c95475094941914969ff82b329.tar.gz lwn-832622e6bd1884c95475094941914969ff82b329.zip |
xdp: sample program for new bpf_redirect helper
This implements a sample program for testing bpf_redirect. It reports
the number of packets redirected per second and as input takes the
ifindex of the device to run the xdp program on and the ifindex of the
interface to redirect packets to.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Tested-by: Andy Gospodarek <andy@greyhouse.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/Makefile')
-rw-r--r-- | samples/bpf/Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 87246be6feb8..97734ced947e 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -37,6 +37,7 @@ hostprogs-y += xdp_tx_iptunnel hostprogs-y += test_map_in_map hostprogs-y += per_socket_stats_example hostprogs-y += load_sock_ops +hostprogs-y += xdp_redirect # Libbpf dependencies LIBBPF := ../../tools/lib/bpf/bpf.o @@ -78,6 +79,7 @@ lwt_len_hist-objs := bpf_load.o $(LIBBPF) lwt_len_hist_user.o xdp_tx_iptunnel-objs := bpf_load.o $(LIBBPF) xdp_tx_iptunnel_user.o test_map_in_map-objs := bpf_load.o $(LIBBPF) test_map_in_map_user.o per_socket_stats_example-objs := $(LIBBPF) cookie_uid_helper_example.o +xdp_redirect-objs := bpf_load.o $(LIBBPF) xdp_redirect_user.o # Tell kbuild to always build the programs always := $(hostprogs-y) @@ -119,6 +121,7 @@ always += tcp_bufs_kern.o always += tcp_cong_kern.o always += tcp_iw_kern.o always += tcp_clamp_kern.o +always += xdp_redirect_kern.o HOSTCFLAGS += -I$(objtree)/usr/include HOSTCFLAGS += -I$(srctree)/tools/lib/ @@ -155,6 +158,7 @@ HOSTLOADLIBES_tc_l2_redirect += -l elf HOSTLOADLIBES_lwt_len_hist += -l elf HOSTLOADLIBES_xdp_tx_iptunnel += -lelf HOSTLOADLIBES_test_map_in_map += -lelf +HOSTLOADLIBES_xdp_redirect += -lelf # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang |