]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bpf: update header file
authorStephen Hemminger <sthemmin@microsoft.com>
Fri, 27 Oct 2017 06:28:36 +0000 (08:28 +0200)
committerStephen Hemminger <sthemmin@microsoft.com>
Fri, 27 Oct 2017 06:28:36 +0000 (08:28 +0200)
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/uapi/linux/bpf.h

index e7500dd45b0cdda787bb0ddb44c0d52a4314b643..b5af49d342c0ce08669e74012f56ff9ccf6b1526 100644 (file)
@@ -112,6 +112,7 @@ enum bpf_map_type {
        BPF_MAP_TYPE_HASH_OF_MAPS,
        BPF_MAP_TYPE_DEVMAP,
        BPF_MAP_TYPE_SOCKMAP,
+       BPF_MAP_TYPE_CPUMAP,
 };
 
 enum bpf_prog_type {
@@ -217,6 +218,10 @@ enum bpf_attach_type {
 
 #define BPF_OBJ_NAME_LEN 16U
 
+/* Flags for accessing BPF object */
+#define BPF_F_RDONLY           (1U << 3)
+#define BPF_F_WRONLY           (1U << 4)
+
 union bpf_attr {
        struct { /* anonymous struct used by BPF_MAP_CREATE command */
                __u32   map_type;       /* one of enum bpf_map_type */
@@ -259,6 +264,7 @@ union bpf_attr {
        struct { /* anonymous struct used by BPF_OBJ_* commands */
                __aligned_u64   pathname;
                __u32           bpf_fd;
+               __u32           file_flags;
        };
 
        struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
@@ -286,6 +292,7 @@ union bpf_attr {
                        __u32           map_id;
                };
                __u32           next_id;
+               __u32           open_flags;
        };
 
        struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
@@ -606,12 +613,22 @@ union bpf_attr {
  * int bpf_setsockopt(bpf_socket, level, optname, optval, optlen)
  *     Calls setsockopt. Not all opts are available, only those with
  *     integer optvals plus TCP_CONGESTION.
- *     Supported levels: SOL_SOCKET and IPROTO_TCP
+ *     Supported levels: SOL_SOCKET and IPPROTO_TCP
  *     @bpf_socket: pointer to bpf_socket
- *     @level: SOL_SOCKET or IPROTO_TCP
+ *     @level: SOL_SOCKET or IPPROTO_TCP
  *     @optname: option name
  *     @optval: pointer to option value
- *     @optlen: length of optval in byes
+ *     @optlen: length of optval in bytes
+ *     Return: 0 or negative error
+ *
+ * int bpf_getsockopt(bpf_socket, level, optname, optval, optlen)
+ *     Calls getsockopt. Not all opts are available.
+ *     Supported levels: IPPROTO_TCP
+ *     @bpf_socket: pointer to bpf_socket
+ *     @level: IPPROTO_TCP
+ *     @optname: option name
+ *     @optval: pointer to option value
+ *     @optlen: length of optval in bytes
  *     Return: 0 or negative error
  *
  * int bpf_skb_adjust_room(skb, len_diff, mode, flags)
@@ -714,7 +731,8 @@ union bpf_attr {
        FN(sock_map_update),            \
        FN(xdp_adjust_meta),            \
        FN(perf_event_read_value),      \
-       FN(perf_prog_read_value),
+       FN(perf_prog_read_value),       \
+       FN(getsockopt),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
@@ -948,6 +966,13 @@ enum {
        BPF_SOCK_OPS_NEEDS_ECN,         /* If connection's congestion control
                                         * needs ECN
                                         */
+       BPF_SOCK_OPS_BASE_RTT,          /* Get base RTT. The correct value is
+                                        * based on the path and may be
+                                        * dependent on the congestion control
+                                        * algorithm. In general it indicates
+                                        * a congestion threshold. RTTs above
+                                        * this indicate congestion
+                                        */
 };
 
 #define TCP_BPF_IW             1001    /* Set TCP initial congestion window */