diff options
author | Quentin Monnet <quentin.monnet@netronome.com> | 2018-07-12 07:52:23 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-07-12 12:55:53 -0400 |
commit | 9b8ca3795199f333269859b0c8393f810b9616a3 (patch) | |
tree | 85fa15145bd1252e60246faa5f9468e176e29e89 /tools/include | |
parent | 2bae79d2d38f3dc50bfef81d3b4f7328b2883a17 (diff) |
tools: bpf: synchronise BPF UAPI header with tools
Update with latest changes from include/uapi/linux/bpf.h header.
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/uapi/linux/bpf.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 59b19b6a40d7..6bcb287a888d 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h | |||
@@ -1826,7 +1826,7 @@ union bpf_attr { | |||
1826 | * A non-negative value equal to or less than *size* on success, | 1826 | * A non-negative value equal to or less than *size* on success, |
1827 | * or a negative error in case of failure. | 1827 | * or a negative error in case of failure. |
1828 | * | 1828 | * |
1829 | * int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header) | 1829 | * int bpf_skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header) |
1830 | * Description | 1830 | * Description |
1831 | * This helper is similar to **bpf_skb_load_bytes**\ () in that | 1831 | * This helper is similar to **bpf_skb_load_bytes**\ () in that |
1832 | * it provides an easy way to load *len* bytes from *offset* | 1832 | * it provides an easy way to load *len* bytes from *offset* |
@@ -1857,7 +1857,8 @@ union bpf_attr { | |||
1857 | * is resolved), the nexthop address is returned in ipv4_dst | 1857 | * is resolved), the nexthop address is returned in ipv4_dst |
1858 | * or ipv6_dst based on family, smac is set to mac address of | 1858 | * or ipv6_dst based on family, smac is set to mac address of |
1859 | * egress device, dmac is set to nexthop mac address, rt_metric | 1859 | * egress device, dmac is set to nexthop mac address, rt_metric |
1860 | * is set to metric from route (IPv4/IPv6 only). | 1860 | * is set to metric from route (IPv4/IPv6 only), and ifindex |
1861 | * is set to the device index of the nexthop from the FIB lookup. | ||
1861 | * | 1862 | * |
1862 | * *plen* argument is the size of the passed in struct. | 1863 | * *plen* argument is the size of the passed in struct. |
1863 | * *flags* argument can be a combination of one or more of the | 1864 | * *flags* argument can be a combination of one or more of the |
@@ -1873,9 +1874,10 @@ union bpf_attr { | |||
1873 | * *ctx* is either **struct xdp_md** for XDP programs or | 1874 | * *ctx* is either **struct xdp_md** for XDP programs or |
1874 | * **struct sk_buff** tc cls_act programs. | 1875 | * **struct sk_buff** tc cls_act programs. |
1875 | * Return | 1876 | * Return |
1876 | * Egress device index on success, 0 if packet needs to continue | 1877 | * * < 0 if any input argument is invalid |
1877 | * up the stack for further processing or a negative error in case | 1878 | * * 0 on success (packet is forwarded, nexthop neighbor exists) |
1878 | * of failure. | 1879 | * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the |
1880 | * packet is not forwarded or needs assist from full stack | ||
1879 | * | 1881 | * |
1880 | * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) | 1882 | * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) |
1881 | * Description | 1883 | * Description |
@@ -2031,7 +2033,6 @@ union bpf_attr { | |||
2031 | * This helper is only available is the kernel was compiled with | 2033 | * This helper is only available is the kernel was compiled with |
2032 | * the **CONFIG_BPF_LIRC_MODE2** configuration option set to | 2034 | * the **CONFIG_BPF_LIRC_MODE2** configuration option set to |
2033 | * "**y**". | 2035 | * "**y**". |
2034 | * | ||
2035 | * Return | 2036 | * Return |
2036 | * 0 | 2037 | * 0 |
2037 | * | 2038 | * |
@@ -2051,7 +2052,6 @@ union bpf_attr { | |||
2051 | * This helper is only available is the kernel was compiled with | 2052 | * This helper is only available is the kernel was compiled with |
2052 | * the **CONFIG_BPF_LIRC_MODE2** configuration option set to | 2053 | * the **CONFIG_BPF_LIRC_MODE2** configuration option set to |
2053 | * "**y**". | 2054 | * "**y**". |
2054 | * | ||
2055 | * Return | 2055 | * Return |
2056 | * 0 | 2056 | * 0 |
2057 | * | 2057 | * |
@@ -2612,6 +2612,18 @@ struct bpf_raw_tracepoint_args { | |||
2612 | #define BPF_FIB_LOOKUP_DIRECT BIT(0) | 2612 | #define BPF_FIB_LOOKUP_DIRECT BIT(0) |
2613 | #define BPF_FIB_LOOKUP_OUTPUT BIT(1) | 2613 | #define BPF_FIB_LOOKUP_OUTPUT BIT(1) |
2614 | 2614 | ||
2615 | enum { | ||
2616 | BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ | ||
2617 | BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */ | ||
2618 | BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */ | ||
2619 | BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */ | ||
2620 | BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */ | ||
2621 | BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */ | ||
2622 | BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */ | ||
2623 | BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */ | ||
2624 | BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */ | ||
2625 | }; | ||
2626 | |||
2615 | struct bpf_fib_lookup { | 2627 | struct bpf_fib_lookup { |
2616 | /* input: network family for lookup (AF_INET, AF_INET6) | 2628 | /* input: network family for lookup (AF_INET, AF_INET6) |
2617 | * output: network family of egress nexthop | 2629 | * output: network family of egress nexthop |
@@ -2625,7 +2637,11 @@ struct bpf_fib_lookup { | |||
2625 | 2637 | ||
2626 | /* total length of packet from network header - used for MTU check */ | 2638 | /* total length of packet from network header - used for MTU check */ |
2627 | __u16 tot_len; | 2639 | __u16 tot_len; |
2628 | __u32 ifindex; /* L3 device index for lookup */ | 2640 | |
2641 | /* input: L3 device index for lookup | ||
2642 | * output: device index from FIB lookup | ||
2643 | */ | ||
2644 | __u32 ifindex; | ||
2629 | 2645 | ||
2630 | union { | 2646 | union { |
2631 | /* inputs to lookup */ | 2647 | /* inputs to lookup */ |