History

bpf: Sync bpf.h to tools

Sync include/uapi/linux/bpf.h with tools/ Changes v1->v2: - BPF_F_ADJ_ROOM_MASK moved, no longer in this commit v2->v3: - BPF_F_ADJ_ROOM_ENCAP_L3_MASK moved, no longer in this commit

Willem de Bruijn committed 7 years ago

Commit 6c408de1 parent 868d5231 file · +26 −3Browse files

Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+26−3
@@ -1478,13 +1478,27 @@ union bpf_attr { · 1477 unmodified lines
14781478 * Grow or shrink the room for data in the packet associated to
14791479 * *skb* by *len_diff*, and according to the selected *mode*.
14801480 *
1481− * There is a single supported mode at this time:
1481+ * There are two supported modes at this time:
1482+ *
1483+ * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
1484+ * (room space is added or removed below the layer 2 header).
14821485 *
14831486 * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
14841487 * (room space is added or removed below the layer 3 header).
14851488 *
1486− * All values for *flags* are reserved for future usage, and must
1487− * be left at zero.
1489+ * The following flags are supported at this time:
1490+ *
1491+ * * **BPF_F_ADJ_ROOM_FIXED_GSO**: Do not adjust gso_size.
1492+ * Adjusting mss in this way is not allowed for datagrams.
1493+ *
1494+ * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 **:
1495+ * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 **:
1496+ * Any new space is reserved to hold a tunnel header.
1497+ * Configure skb offsets and other fields accordingly.
1498+ *
1499+ * * **BPF_F_ADJ_ROOM_ENCAP_L4_GRE **:
1500+ * * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP **:
1501+ * Use with ENCAP_L3 flags to further specify the tunnel type.
14881502 *
14891503 * A call to this helper is susceptible to change the underlaying
14901504 * packet buffer. Therefore, at load time, all checks on pointers
@@ -2624,9 +2638,18 @@ enum bpf_func_id { · 1133 unmodified lines
26242638 /* Current network namespace */
26252639 #define BPF_F_CURRENT_NETNS (-1L)
26262640
2641+/* BPF_FUNC_skb_adjust_room flags. */
2642+#define BPF_F_ADJ_ROOM_FIXED_GSO (1ULL << 0)
2643+
2644+#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 (1ULL << 1)
2645+#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 (1ULL << 2)
2646+#define BPF_F_ADJ_ROOM_ENCAP_L4_GRE (1ULL << 3)
2647+#define BPF_F_ADJ_ROOM_ENCAP_L4_UDP (1ULL << 4)
2648+
26272649 /* Mode for BPF_FUNC_skb_adjust_room helper. */
26282650 enum bpf_adj_room_mode {
26292651 BPF_ADJ_ROOM_NET,
2652+ BPF_ADJ_ROOM_MAC,
26302653 };
26312654
26322655 /* Mode for BPF_FUNC_skb_load_bytes_relative helper. */