History

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.

John Fastabend committed 9 years ago

Commit 814abfa1 parent d4455164 files · +63 −0Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -717,6 +717,7 @@ enum xdp_action { · 716 unmodified lines
717 XDP_DROP,717 XDP_DROP,
718 XDP_PASS,718 XDP_PASS,
719 XDP_TX,719 XDP_TX,
720 XDP_REDIRECT,
720};721};
721 722
722/* user accessible metadata for XDP packet hook723/* user accessible metadata for XDP packet hook