]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
update kernel headers from net-next
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 18 Jul 2017 01:32:03 +0000 (18:32 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 18 Jul 2017 01:32:03 +0000 (18:32 -0700)
Just as net-next merge window opens.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/linux/bpf.h
include/linux/magic.h
include/linux/sctp.h

index 8a966ef03b1d174db0a2bfed256efe56d5a54e28..49e1def7a0b859084acb77a6f21d633d33d9be16 100644 (file)
@@ -104,6 +104,7 @@ enum bpf_map_type {
        BPF_MAP_TYPE_LPM_TRIE,
        BPF_MAP_TYPE_ARRAY_OF_MAPS,
        BPF_MAP_TYPE_HASH_OF_MAPS,
+       BPF_MAP_TYPE_DEVMAP,
 };
 
 enum bpf_prog_type {
@@ -120,12 +121,14 @@ enum bpf_prog_type {
        BPF_PROG_TYPE_LWT_IN,
        BPF_PROG_TYPE_LWT_OUT,
        BPF_PROG_TYPE_LWT_XMIT,
+       BPF_PROG_TYPE_SOCK_OPS,
 };
 
 enum bpf_attach_type {
        BPF_CGROUP_INET_INGRESS,
        BPF_CGROUP_INET_EGRESS,
        BPF_CGROUP_INET_SOCK_CREATE,
+       BPF_CGROUP_SOCK_OPS,
        __MAX_BPF_ATTACH_TYPE
 };
 
@@ -345,6 +348,11 @@ union bpf_attr {
  *     @flags: bit 0 - if set, redirect to ingress instead of egress
  *             other bits - reserved
  *     Return: TC_ACT_REDIRECT
+ * int bpf_redirect_map(key, map, flags)
+ *     redirect to endpoint in map
+ *     @key: index in map to lookup
+ *     @map: fd of map to do lookup in
+ *     @flags: --
  *
  * u32 bpf_get_route_realm(skb)
  *     retrieve a dst's tclassid
@@ -518,6 +526,25 @@ union bpf_attr {
  *     Set full skb->hash.
  *     @skb: pointer to skb
  *     @hash: hash to set
+ *
+ * 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
+ *     @bpf_socket: pointer to bpf_socket
+ *     @level: SOL_SOCKET or IPROTO_TCP
+ *     @optname: option name
+ *     @optval: pointer to option value
+ *     @optlen: length of optval in byes
+ *     Return: 0 or negative error
+ *
+ * int bpf_skb_adjust_room(skb, len_diff, mode, flags)
+ *     Grow or shrink room in sk_buff.
+ *     @skb: pointer to skb
+ *     @len_diff: (signed) amount of room to grow/shrink
+ *     @mode: operation mode (enum bpf_adj_room_mode)
+ *     @flags: reserved for future use
+ *     Return: 0 on success or negative error code
  */
 #define __BPF_FUNC_MAPPER(FN)          \
        FN(unspec),                     \
@@ -568,7 +595,10 @@ union bpf_attr {
        FN(probe_read_str),             \
        FN(get_socket_cookie),          \
        FN(get_socket_uid),             \
-       FN(set_hash),
+       FN(set_hash),                   \
+       FN(setsockopt),                 \
+       FN(skb_adjust_room),            \
+       FN(redirect_map),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
@@ -618,6 +648,11 @@ enum bpf_func_id {
 /* BPF_FUNC_perf_event_output for sk_buff input context. */
 #define BPF_F_CTXLEN_MASK              (0xfffffULL << 32)
 
+/* Mode for BPF_FUNC_skb_adjust_room helper. */
+enum bpf_adj_room_mode {
+       BPF_ADJ_ROOM_NET,
+};
+
 /* user accessible mirror of in-kernel sk_buff.
  * new fields can only be added to the end of this structure
  */
@@ -689,6 +724,7 @@ enum xdp_action {
        XDP_DROP,
        XDP_PASS,
        XDP_TX,
+       XDP_REDIRECT,
 };
 
 /* user accessible metadata for XDP packet hook
@@ -720,4 +756,56 @@ struct bpf_map_info {
        __u32 map_flags;
 } __attribute__((aligned(8)));
 
+/* User bpf_sock_ops struct to access socket values and specify request ops
+ * and their replies.
+ * Some of this fields are in network (bigendian) byte order and may need
+ * to be converted before use (bpf_ntohl() defined in samples/bpf/bpf_endian.h).
+ * New fields can only be added at the end of this structure
+ */
+struct bpf_sock_ops {
+       __u32 op;
+       union {
+               __u32 reply;
+               __u32 replylong[4];
+       };
+       __u32 family;
+       __u32 remote_ip4;       /* Stored in network byte order */
+       __u32 local_ip4;        /* Stored in network byte order */
+       __u32 remote_ip6[4];    /* Stored in network byte order */
+       __u32 local_ip6[4];     /* Stored in network byte order */
+       __u32 remote_port;      /* Stored in network byte order */
+       __u32 local_port;       /* stored in host byte order */
+};
+
+/* List of known BPF sock_ops operators.
+ * New entries can only be added at the end
+ */
+enum {
+       BPF_SOCK_OPS_VOID,
+       BPF_SOCK_OPS_TIMEOUT_INIT,      /* Should return SYN-RTO value to use or
+                                        * -1 if default value should be used
+                                        */
+       BPF_SOCK_OPS_RWND_INIT,         /* Should return initial advertized
+                                        * window (in packets) or -1 if default
+                                        * value should be used
+                                        */
+       BPF_SOCK_OPS_TCP_CONNECT_CB,    /* Calls BPF program right before an
+                                        * active connection is initialized
+                                        */
+       BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB,     /* Calls BPF program when an
+                                                * active connection is
+                                                * established
+                                                */
+       BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB,    /* Calls BPF program when a
+                                                * passive connection is
+                                                * established
+                                                */
+       BPF_SOCK_OPS_NEEDS_ECN,         /* If connection's congestion control
+                                        * needs ECN
+                                        */
+};
+
+#define TCP_BPF_IW             1001    /* Set TCP initial congestion window */
+#define TCP_BPF_SNDCWND_CLAMP  1002    /* Set sndcwnd_clamp */
+
 #endif /* __LINUX_BPF_H__ */
index e230af2e68558fa8ed1778b2c154686f8b1e2481..e439565df838a2a7032888bd614ae28fa2359b90 100644 (file)
@@ -42,6 +42,7 @@
 #define MSDOS_SUPER_MAGIC      0x4d44          /* MD */
 #define NCP_SUPER_MAGIC                0x564c          /* Guess, what 0x564c is :-) */
 #define NFS_SUPER_MAGIC                0x6969
+#define OCFS2_SUPER_MAGIC      0x7461636f
 #define OPENPROM_SUPER_MAGIC   0x9fa1
 #define QNX4_SUPER_MAGIC       0x002f          /* qnx4 fs detection */
 #define QNX6_SUPER_MAGIC       0x68191122      /* qnx6 fs detection */
@@ -80,6 +81,8 @@
 #define BTRFS_TEST_MAGIC       0x73727279
 #define NSFS_MAGIC             0x6e736673
 #define BPF_FS_MAGIC           0xcafe4a11
+#define AAFS_MAGIC             0x5a3c69f0
+
 /* Since UDF 2.01 is ISO 13346 based... */
 #define UDF_SUPER_MAGIC                0x15013346
 #define BALLOON_KVM_MAGIC      0x13661366
index 4a169febc9753ca4549063d2f2eba7eff2f92154..fec24c41405b967c08f79545f7d7c2cc415d74bd 100644 (file)
@@ -121,6 +121,7 @@ typedef __s32 sctp_assoc_t;
 #define SCTP_RESET_STREAMS     119
 #define SCTP_RESET_ASSOC       120
 #define SCTP_ADD_STREAMS       121
+#define SCTP_SOCKOPT_PEELOFF_FLAGS 122
 
 /* PR-SCTP policies */
 #define SCTP_PR_SCTP_NONE      0x0000
@@ -972,6 +973,11 @@ typedef struct {
        int sd;
 } sctp_peeloff_arg_t;
 
+typedef struct {
+       sctp_peeloff_arg_t p_arg;
+       unsigned flags;
+} sctp_peeloff_flags_arg_t;
+
 /*
  *  Peer Address Thresholds socket option
  */