diff mbox series

[bpf-next,10/13] bpf: Sync bpf.h to tools

Message ID 20190320144944.147862-11-willemdebruijn.kernel@gmail.com
State Changes Requested
Delegated to: BPF Maintainers
Headers show
Series bpf tc tunneling | expand

Commit Message

Willem de Bruijn March 20, 2019, 2:49 p.m. UTC
From: Willem de Bruijn <willemb@google.com>

Sync include/uapi/linux/bpf.h with tools/

Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 tools/include/uapi/linux/bpf.h | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

Comments

Soheil Hassas Yeganeh March 20, 2019, 2:56 p.m. UTC | #1
On Wed, Mar 20, 2019 at 10:50 AM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> From: Willem de Bruijn <willemb@google.com>
>
> Sync include/uapi/linux/bpf.h with tools/
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>

Acked-by: Soheil Hassas Yeganeh <soheil@google.com>

> ---
>  tools/include/uapi/linux/bpf.h | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index 929c8e537a14a..a444534cc88d7 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -1478,7 +1478,10 @@ union bpf_attr {
>   *             Grow or shrink the room for data in the packet associated to
>   *             *skb* by *len_diff*, and according to the selected *mode*.
>   *
> - *             There is a single supported mode at this time:
> + *             There are two supported modes at this time:
> + *
> + *             * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
> + *               (room space is added or removed below the layer 2 header).
>   *
>   *             * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
>   *               (room space is added or removed below the layer 3 header).
> @@ -2590,9 +2593,26 @@ enum bpf_func_id {
>  /* Current network namespace */
>  #define BPF_F_CURRENT_NETNS            (-1L)
>
> +/* BPF_FUNC_skb_adjust_room flags. */
> +#define BPF_F_ADJ_ROOM_FIXED_GSO       (1ULL << 0)
> +
> +#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4   (1ULL << 1)
> +#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6   (1ULL << 2)
> +#define BPF_F_ADJ_ROOM_ENCAP_L3_MASK   (BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 | \
> +                                        BPF_F_ADJ_ROOM_ENCAP_L3_IPV6)
> +
> +#define BPF_F_ADJ_ROOM_ENCAP_L4_GRE    (1ULL << 3)
> +#define BPF_F_ADJ_ROOM_ENCAP_L4_UDP    (1ULL << 4)
> +
> +#define BPF_F_ADJ_ROOM_MASK            (BPF_F_ADJ_ROOM_FIXED_GSO | \
> +                                        BPF_F_ADJ_ROOM_ENCAP_L3_MASK | \
> +                                        BPF_F_ADJ_ROOM_ENCAP_L4_GRE | \
> +                                        BPF_F_ADJ_ROOM_ENCAP_L4_UDP)
> +
>  /* Mode for BPF_FUNC_skb_adjust_room helper. */
>  enum bpf_adj_room_mode {
>         BPF_ADJ_ROOM_NET,
> +       BPF_ADJ_ROOM_MAC,
>  };
>
>  /* Mode for BPF_FUNC_skb_load_bytes_relative helper. */
> --
> 2.21.0.225.g810b269d1ac-goog
>
diff mbox series

Patch

diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 929c8e537a14a..a444534cc88d7 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1478,7 +1478,10 @@  union bpf_attr {
  * 		Grow or shrink the room for data in the packet associated to
  * 		*skb* by *len_diff*, and according to the selected *mode*.
  *
- * 		There is a single supported mode at this time:
+ *		There are two supported modes at this time:
+ *
+ *		* **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
+ *		  (room space is added or removed below the layer 2 header).
  *
  * 		* **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
  * 		  (room space is added or removed below the layer 3 header).
@@ -2590,9 +2593,26 @@  enum bpf_func_id {
 /* Current network namespace */
 #define BPF_F_CURRENT_NETNS		(-1L)
 
+/* BPF_FUNC_skb_adjust_room flags. */
+#define BPF_F_ADJ_ROOM_FIXED_GSO	(1ULL << 0)
+
+#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4	(1ULL << 1)
+#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6	(1ULL << 2)
+#define BPF_F_ADJ_ROOM_ENCAP_L3_MASK	(BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 | \
+					 BPF_F_ADJ_ROOM_ENCAP_L3_IPV6)
+
+#define BPF_F_ADJ_ROOM_ENCAP_L4_GRE	(1ULL << 3)
+#define BPF_F_ADJ_ROOM_ENCAP_L4_UDP	(1ULL << 4)
+
+#define BPF_F_ADJ_ROOM_MASK		(BPF_F_ADJ_ROOM_FIXED_GSO | \
+					 BPF_F_ADJ_ROOM_ENCAP_L3_MASK | \
+					 BPF_F_ADJ_ROOM_ENCAP_L4_GRE | \
+					 BPF_F_ADJ_ROOM_ENCAP_L4_UDP)
+
 /* Mode for BPF_FUNC_skb_adjust_room helper. */
 enum bpf_adj_room_mode {
 	BPF_ADJ_ROOM_NET,
+	BPF_ADJ_ROOM_MAC,
 };
 
 /* Mode for BPF_FUNC_skb_load_bytes_relative helper. */