Skip to content

Commit 755db47

Browse files
posk-ioAlexei Starovoitov
authored andcommitted
bpf: sync <kdir>/include/.../bpf.h with tools/include/.../bpf.h
This patch copies changes in bpf.h done by a previous patch in this patchset from the kernel uapi include dir into tools uapi include dir. Signed-off-by: Peter Oskolkov <posk@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 3bd0b15 commit 755db47

File tree

1 file changed

+24
-2
lines changed
  • tools/include/uapi/linux

1 file changed

+24
-2
lines changed

tools/include/uapi/linux/bpf.h

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,19 @@ union bpf_attr {
20162016
* Only works if *skb* contains an IPv6 packet. Insert a
20172017
* Segment Routing Header (**struct ipv6_sr_hdr**) inside
20182018
* the IPv6 header.
2019+
* **BPF_LWT_ENCAP_IP**
2020+
* IP encapsulation (GRE/GUE/IPIP/etc). The outer header
2021+
* must be IPv4 or IPv6, followed by zero or more
2022+
* additional headers, up to LWT_BPF_MAX_HEADROOM total
2023+
* bytes in all prepended headers. Please note that
2024+
* if skb_is_gso(skb) is true, no more than two headers
2025+
* can be prepended, and the inner header, if present,
2026+
* should be either GRE or UDP/GUE.
2027+
*
2028+
* BPF_LWT_ENCAP_SEG6*** types can be called by bpf programs of
2029+
* type BPF_PROG_TYPE_LWT_IN; BPF_LWT_ENCAP_IP type can be called
2030+
* by bpf programs of types BPF_PROG_TYPE_LWT_IN and
2031+
* BPF_PROG_TYPE_LWT_XMIT.
20192032
*
20202033
* A call to this helper is susceptible to change the underlaying
20212034
* packet buffer. Therefore, at load time, all checks on pointers
@@ -2517,7 +2530,8 @@ enum bpf_hdr_start_off {
25172530
/* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */
25182531
enum bpf_lwt_encap_mode {
25192532
BPF_LWT_ENCAP_SEG6,
2520-
BPF_LWT_ENCAP_SEG6_INLINE
2533+
BPF_LWT_ENCAP_SEG6_INLINE,
2534+
BPF_LWT_ENCAP_IP,
25212535
};
25222536

25232537
#define __bpf_md_ptr(type, name) \
@@ -2606,7 +2620,15 @@ enum bpf_ret_code {
26062620
BPF_DROP = 2,
26072621
/* 3-6 reserved */
26082622
BPF_REDIRECT = 7,
2609-
/* >127 are reserved for prog type specific return codes */
2623+
/* >127 are reserved for prog type specific return codes.
2624+
*
2625+
* BPF_LWT_REROUTE: used by BPF_PROG_TYPE_LWT_IN and
2626+
* BPF_PROG_TYPE_LWT_XMIT to indicate that skb had been
2627+
* changed and should be routed based on its new L3 header.
2628+
* (This is an L3 redirect, as opposed to L2 redirect
2629+
* represented by BPF_REDIRECT above).
2630+
*/
2631+
BPF_LWT_REROUTE = 128,
26102632
};
26112633

26122634
struct bpf_sock {

0 commit comments

Comments
 (0)