diff options
Diffstat (limited to 'tools/include/uapi/linux/bpf.h')
| -rw-r--r-- | tools/include/uapi/linux/bpf.h | 37 | 
1 files changed, 23 insertions, 14 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 461811e57140..24b35a1fd4d6 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -143,12 +143,6 @@ enum bpf_attach_type {  #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE -enum bpf_sockmap_flags { -	BPF_SOCKMAP_UNSPEC, -	BPF_SOCKMAP_STRPARSER, -	__MAX_BPF_SOCKMAP_FLAG -}; -  /* If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command   * to the given target_fd cgroup the descendent cgroup will be able to   * override effective bpf program that was inherited from this cgroup @@ -318,7 +312,7 @@ union bpf_attr {   *     jump into another BPF program   *     @ctx: context pointer passed to next program   *     @prog_array_map: pointer to map which type is BPF_MAP_TYPE_PROG_ARRAY - *     @index: index inside array that selects specific program to run + *     @index: 32-bit index inside array that selects specific program to run   *     Return: 0 on success or negative error   *   * int bpf_clone_redirect(skb, ifindex, flags) @@ -368,9 +362,20 @@ union bpf_attr {   * int bpf_redirect(ifindex, flags)   *     redirect to another netdev   *     @ifindex: ifindex of the net device - *     @flags: bit 0 - if set, redirect to ingress instead of egress - *             other bits - reserved - *     Return: TC_ACT_REDIRECT + *     @flags: + *	  cls_bpf: + *          bit 0 - if set, redirect to ingress instead of egress + *          other bits - reserved + *	  xdp_bpf: + *	    all bits - reserved + *     Return: cls_bpf: TC_ACT_REDIRECT on success or TC_ACT_SHOT on error + *	       xdp_bfp: XDP_REDIRECT on success or XDP_ABORT on error + * int bpf_redirect_map(map, key, flags) + *     redirect to endpoint in map + *     @map: pointer to dev map + *     @key: index in map to lookup + *     @flags: -- + *     Return: XDP_REDIRECT on success or XDP_ABORT on error   *   * u32 bpf_get_route_realm(skb)   *     retrieve a dst's tclassid @@ -564,9 +569,10 @@ union bpf_attr {   *     @flags: reserved for future use   *     Return: 0 on success or negative error code   * - * int bpf_sk_redirect_map(map, key, flags) + * int bpf_sk_redirect_map(skb, map, key, flags)   *     Redirect skb to a sock in map using key as a lookup key for the   *     sock in map. + *     @skb: pointer to skb   *     @map: pointer to sockmap   *     @key: key to lookup sock in map   *     @flags: reserved for future use @@ -632,7 +638,7 @@ union bpf_attr {  	FN(skb_adjust_room),		\  	FN(redirect_map),		\  	FN(sk_redirect_map),		\ -	FN(sock_map_update), +	FN(sock_map_update),		\  /* integer value in 'imm' field of BPF_CALL instruction selects which helper   * function eBPF program intends to call @@ -753,20 +759,23 @@ struct bpf_sock {  	__u32 family;  	__u32 type;  	__u32 protocol; +	__u32 mark; +	__u32 priority;  };  #define XDP_PACKET_HEADROOM 256  /* User return codes for XDP prog type.   * A valid XDP program must return one of these defined values. All other - * return codes are reserved for future use. Unknown return codes will result - * in packet drop. + * return codes are reserved for future use. Unknown return codes will + * result in packet drops and a warning via bpf_warn_invalid_xdp_action().   */  enum xdp_action {  	XDP_ABORTED = 0,  	XDP_DROP,  	XDP_PASS,  	XDP_TX, +	XDP_REDIRECT,  };  /* user accessible metadata for XDP packet hook  |