summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorJohn Fastabend2017-07-17 18:27:07 +0200
committerDavid S. Miller2017-07-17 18:48:05 +0200
commit814abfabef3ceed390c10d06a0cc69a86454b6cf (patch)
treefe6ae9f9007124e1ddd76efd152f5d60db0a5bd9 /include/uapi/linux/bpf.h
parentnet: xdp: support xdp generic on virtual devices (diff)
downloadkernel-qcow2-linux-814abfabef3ceed390c10d06a0cc69a86454b6cf.tar.gz
kernel-qcow2-linux-814abfabef3ceed390c10d06a0cc69a86454b6cf.tar.xz
kernel-qcow2-linux-814abfabef3ceed390c10d06a0cc69a86454b6cf.zip
xdp: add bpf_redirect helper function
This adds support for a bpf_redirect helper function to the XDP infrastructure. For now this only supports redirecting to the egress path of a port. In order to support drivers handling a xdp_buff natively this patches uses a new ndo operation ndo_xdp_xmit() that takes pushes a xdp_buff to the specified device. If the program specifies either (a) an unknown device or (b) a device that does not support the operation a BPF warning is thrown and the XDP_ABORTED error code is returned. Signed-off-by: John Fastabend <john.fastabend@gmail.com> 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 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index e99e3e6f8b37..4dbb7a3f4677 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -717,6 +717,7 @@ enum xdp_action {
XDP_DROP,
XDP_PASS,
XDP_TX,
+ XDP_REDIRECT,
};
/* user accessible metadata for XDP packet hook