diff options
author | Alan Maguire <alan.maguire@oracle.com> | 2019-04-09 10:06:42 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-04-11 16:50:57 -0400 |
commit | 1db04c300a41e17892bf83ed0d1aa681416ee150 (patch) | |
tree | 75a2a5cb2a7c15225158ba6c8be16a442b3f31bb /tools/include | |
parent | 58dfc900faff6db7eb9bf01555622e0b6c74c262 (diff) |
bpf: sync bpf.h to tools/ for BPF_F_ADJ_ROOM_ENCAP_L2
Sync include/uapi/linux/bpf.h with tools/ equivalent to add
BPF_F_ADJ_ROOM_ENCAP_L2(len) macro.
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/uapi/linux/bpf.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 31a27dd337dc..2e96d0b4bf65 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h | |||
@@ -1523,6 +1523,10 @@ union bpf_attr { | |||
1523 | * * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP **: | 1523 | * * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP **: |
1524 | * Use with ENCAP_L3 flags to further specify the tunnel type. | 1524 | * Use with ENCAP_L3 flags to further specify the tunnel type. |
1525 | * | 1525 | * |
1526 | * * **BPF_F_ADJ_ROOM_ENCAP_L2(len) **: | ||
1527 | * Use with ENCAP_L3/L4 flags to further specify the tunnel | ||
1528 | * type; **len** is the length of the inner MAC header. | ||
1529 | * | ||
1526 | * A call to this helper is susceptible to change the underlaying | 1530 | * A call to this helper is susceptible to change the underlaying |
1527 | * packet buffer. Therefore, at load time, all checks on pointers | 1531 | * packet buffer. Therefore, at load time, all checks on pointers |
1528 | * previously done by the verifier are invalidated and must be | 1532 | * previously done by the verifier are invalidated and must be |
@@ -2664,10 +2668,16 @@ enum bpf_func_id { | |||
2664 | /* BPF_FUNC_skb_adjust_room flags. */ | 2668 | /* BPF_FUNC_skb_adjust_room flags. */ |
2665 | #define BPF_F_ADJ_ROOM_FIXED_GSO (1ULL << 0) | 2669 | #define BPF_F_ADJ_ROOM_FIXED_GSO (1ULL << 0) |
2666 | 2670 | ||
2671 | #define BPF_ADJ_ROOM_ENCAP_L2_MASK 0xff | ||
2672 | #define BPF_ADJ_ROOM_ENCAP_L2_SHIFT 56 | ||
2673 | |||
2667 | #define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 (1ULL << 1) | 2674 | #define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 (1ULL << 1) |
2668 | #define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 (1ULL << 2) | 2675 | #define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 (1ULL << 2) |
2669 | #define BPF_F_ADJ_ROOM_ENCAP_L4_GRE (1ULL << 3) | 2676 | #define BPF_F_ADJ_ROOM_ENCAP_L4_GRE (1ULL << 3) |
2670 | #define BPF_F_ADJ_ROOM_ENCAP_L4_UDP (1ULL << 4) | 2677 | #define BPF_F_ADJ_ROOM_ENCAP_L4_UDP (1ULL << 4) |
2678 | #define BPF_F_ADJ_ROOM_ENCAP_L2(len) (((__u64)len & \ | ||
2679 | BPF_ADJ_ROOM_ENCAP_L2_MASK) \ | ||
2680 | << BPF_ADJ_ROOM_ENCAP_L2_SHIFT) | ||
2671 | 2681 | ||
2672 | /* Mode for BPF_FUNC_skb_adjust_room helper. */ | 2682 | /* Mode for BPF_FUNC_skb_adjust_room helper. */ |
2673 | enum bpf_adj_room_mode { | 2683 | enum bpf_adj_room_mode { |