Skip to content

Commit ac29991

Browse files
borkmanndavem330
authored andcommitted
bpf: update bpf.h uapi header for tools
Looks like a couple of updates missed to get carried into tools/include/uapi/, so copy the bpf.h header as usual to pull in latest updates. Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: John Fastabend <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent de8f3a8 commit ac29991

File tree

1 file changed

+32
-13
lines changed
  • tools/include/uapi/linux

1 file changed

+32
-13
lines changed

tools/include/uapi/linux/bpf.h

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ enum bpf_attach_type {
143143

144144
#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
145145

146-
enum bpf_sockmap_flags {
147-
BPF_SOCKMAP_UNSPEC,
148-
BPF_SOCKMAP_STRPARSER,
149-
__MAX_BPF_SOCKMAP_FLAG
150-
};
151-
152146
/* If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command
153147
* to the given target_fd cgroup the descendent cgroup will be able to
154148
* override effective bpf program that was inherited from this cgroup
@@ -368,9 +362,20 @@ union bpf_attr {
368362
* int bpf_redirect(ifindex, flags)
369363
* redirect to another netdev
370364
* @ifindex: ifindex of the net device
371-
* @flags: bit 0 - if set, redirect to ingress instead of egress
372-
* other bits - reserved
373-
* Return: TC_ACT_REDIRECT
365+
* @flags:
366+
* cls_bpf:
367+
* bit 0 - if set, redirect to ingress instead of egress
368+
* other bits - reserved
369+
* xdp_bpf:
370+
* all bits - reserved
371+
* Return: cls_bpf: TC_ACT_REDIRECT on success or TC_ACT_SHOT on error
372+
* xdp_bfp: XDP_REDIRECT on success or XDP_ABORT on error
373+
* int bpf_redirect_map(map, key, flags)
374+
* redirect to endpoint in map
375+
* @map: pointer to dev map
376+
* @key: index in map to lookup
377+
* @flags: --
378+
* Return: XDP_REDIRECT on success or XDP_ABORT on error
374379
*
375380
* u32 bpf_get_route_realm(skb)
376381
* retrieve a dst's tclassid
@@ -577,6 +582,12 @@ union bpf_attr {
577582
* @map: pointer to sockmap to update
578583
* @key: key to insert/update sock in map
579584
* @flags: same flags as map update elem
585+
*
586+
* int bpf_xdp_adjust_meta(xdp_md, delta)
587+
* Adjust the xdp_md.data_meta by delta
588+
* @xdp_md: pointer to xdp_md
589+
* @delta: An positive/negative integer to be added to xdp_md.data_meta
590+
* Return: 0 on success or negative on error
580591
*/
581592
#define __BPF_FUNC_MAPPER(FN) \
582593
FN(unspec), \
@@ -632,7 +643,8 @@ union bpf_attr {
632643
FN(skb_adjust_room), \
633644
FN(redirect_map), \
634645
FN(sk_redirect_map), \
635-
FN(sock_map_update),
646+
FN(sock_map_update), \
647+
FN(xdp_adjust_meta),
636648

637649
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
638650
* function eBPF program intends to call
@@ -710,14 +722,17 @@ struct __sk_buff {
710722
__u32 data_end;
711723
__u32 napi_id;
712724

713-
/* accessed by BPF_PROG_TYPE_sk_skb types */
725+
/* Accessed by BPF_PROG_TYPE_sk_skb types from here to ... */
714726
__u32 family;
715727
__u32 remote_ip4; /* Stored in network byte order */
716728
__u32 local_ip4; /* Stored in network byte order */
717729
__u32 remote_ip6[4]; /* Stored in network byte order */
718730
__u32 local_ip6[4]; /* Stored in network byte order */
719731
__u32 remote_port; /* Stored in network byte order */
720732
__u32 local_port; /* stored in host byte order */
733+
/* ... here. */
734+
735+
__u32 data_meta;
721736
};
722737

723738
struct bpf_tunnel_key {
@@ -753,20 +768,23 @@ struct bpf_sock {
753768
__u32 family;
754769
__u32 type;
755770
__u32 protocol;
771+
__u32 mark;
772+
__u32 priority;
756773
};
757774

758775
#define XDP_PACKET_HEADROOM 256
759776

760777
/* User return codes for XDP prog type.
761778
* A valid XDP program must return one of these defined values. All other
762-
* return codes are reserved for future use. Unknown return codes will result
763-
* in packet drop.
779+
* return codes are reserved for future use. Unknown return codes will
780+
* result in packet drops and a warning via bpf_warn_invalid_xdp_action().
764781
*/
765782
enum xdp_action {
766783
XDP_ABORTED = 0,
767784
XDP_DROP,
768785
XDP_PASS,
769786
XDP_TX,
787+
XDP_REDIRECT,
770788
};
771789

772790
/* user accessible metadata for XDP packet hook
@@ -775,6 +793,7 @@ enum xdp_action {
775793
struct xdp_md {
776794
__u32 data;
777795
__u32 data_end;
796+
__u32 data_meta;
778797
};
779798

780799
enum sk_action {

0 commit comments

Comments
 (0)