]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Update kernel headers
authorDavid Ahern <dsahern@gmail.com>
Wed, 30 May 2018 15:06:19 +0000 (08:06 -0700)
committerDavid Ahern <dsahern@gmail.com>
Wed, 30 May 2018 15:06:19 +0000 (08:06 -0700)
Update kernel headers to commit
ae40832e53c3 ("bpfilter: fix a build err")

Signed-off-by: David Ahern <dsahern@gmail.com>
include/uapi/linux/bpf.h
include/uapi/linux/if_addr.h
include/uapi/linux/if_link.h
include/uapi/linux/rtnetlink.h
include/uapi/linux/seg6_local.h

index c981596c4118a3d378d78495d68635257b67ca7d..3b8841006313e7dc600d0dfd4853c7c8ba1941c7 100644 (file)
@@ -97,6 +97,7 @@ enum bpf_cmd {
        BPF_RAW_TRACEPOINT_OPEN,
        BPF_BTF_LOAD,
        BPF_BTF_GET_FD_BY_ID,
+       BPF_TASK_FD_QUERY,
 };
 
 enum bpf_map_type {
@@ -141,6 +142,7 @@ enum bpf_prog_type {
        BPF_PROG_TYPE_SK_MSG,
        BPF_PROG_TYPE_RAW_TRACEPOINT,
        BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
+       BPF_PROG_TYPE_LWT_SEG6LOCAL,
 };
 
 enum bpf_attach_type {
@@ -284,8 +286,8 @@ union bpf_attr {
                char    map_name[BPF_OBJ_NAME_LEN];
                __u32   map_ifindex;    /* ifindex of netdev to create on */
                __u32   btf_fd;         /* fd pointing to a BTF type data */
-               __u32   btf_key_id;     /* BTF type_id of the key */
-               __u32   btf_value_id;   /* BTF type_id of the value */
+               __u32   btf_key_type_id;        /* BTF type_id of the key */
+               __u32   btf_value_type_id;      /* BTF type_id of the value */
        };
 
        struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
@@ -379,6 +381,22 @@ union bpf_attr {
                __u32           btf_log_size;
                __u32           btf_log_level;
        };
+
+       struct {
+               __u32           pid;            /* input: pid */
+               __u32           fd;             /* input: fd */
+               __u32           flags;          /* input: flags */
+               __u32           buf_len;        /* input/output: buf len */
+               __aligned_u64   buf;            /* input/output:
+                                                *   tp_name for tracepoint
+                                                *   symbol for kprobe
+                                                *   filename for uprobe
+                                                */
+               __u32           prog_id;        /* output: prod_id */
+               __u32           fd_type;        /* output: BPF_FD_TYPE_* */
+               __u64           probe_offset;   /* output: probe_offset */
+               __u64           probe_addr;     /* output: probe_addr */
+       } task_fd_query;
 } __attribute__((aligned(8)));
 
 /* The description below is an attempt at providing documentation to eBPF
@@ -1902,6 +1920,90 @@ union bpf_attr {
  *             egress otherwise). This is the only flag supported for now.
  *     Return
  *             **SK_PASS** on success, or **SK_DROP** on error.
+ *
+ * int bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len)
+ *     Description
+ *             Encapsulate the packet associated to *skb* within a Layer 3
+ *             protocol header. This header is provided in the buffer at
+ *             address *hdr*, with *len* its size in bytes. *type* indicates
+ *             the protocol of the header and can be one of:
+ *
+ *             **BPF_LWT_ENCAP_SEG6**
+ *                     IPv6 encapsulation with Segment Routing Header
+ *                     (**struct ipv6_sr_hdr**). *hdr* only contains the SRH,
+ *                     the IPv6 header is computed by the kernel.
+ *             **BPF_LWT_ENCAP_SEG6_INLINE**
+ *                     Only works if *skb* contains an IPv6 packet. Insert a
+ *                     Segment Routing Header (**struct ipv6_sr_hdr**) inside
+ *                     the IPv6 header.
+ *
+ *             A call to this helper is susceptible to change the underlaying
+ *             packet buffer. Therefore, at load time, all checks on pointers
+ *             previously done by the verifier are invalidated and must be
+ *             performed again, if the helper is used in combination with
+ *             direct packet access.
+ *     Return
+ *             0 on success, or a negative error in case of failure.
+ *
+ * int bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len)
+ *     Description
+ *             Store *len* bytes from address *from* into the packet
+ *             associated to *skb*, at *offset*. Only the flags, tag and TLVs
+ *             inside the outermost IPv6 Segment Routing Header can be
+ *             modified through this helper.
+ *
+ *             A call to this helper is susceptible to change the underlaying
+ *             packet buffer. Therefore, at load time, all checks on pointers
+ *             previously done by the verifier are invalidated and must be
+ *             performed again, if the helper is used in combination with
+ *             direct packet access.
+ *     Return
+ *             0 on success, or a negative error in case of failure.
+ *
+ * int bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta)
+ *     Description
+ *             Adjust the size allocated to TLVs in the outermost IPv6
+ *             Segment Routing Header contained in the packet associated to
+ *             *skb*, at position *offset* by *delta* bytes. Only offsets
+ *             after the segments are accepted. *delta* can be as well
+ *             positive (growing) as negative (shrinking).
+ *
+ *             A call to this helper is susceptible to change the underlaying
+ *             packet buffer. Therefore, at load time, all checks on pointers
+ *             previously done by the verifier are invalidated and must be
+ *             performed again, if the helper is used in combination with
+ *             direct packet access.
+ *     Return
+ *             0 on success, or a negative error in case of failure.
+ *
+ * int bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len)
+ *     Description
+ *             Apply an IPv6 Segment Routing action of type *action* to the
+ *             packet associated to *skb*. Each action takes a parameter
+ *             contained at address *param*, and of length *param_len* bytes.
+ *             *action* can be one of:
+ *
+ *             **SEG6_LOCAL_ACTION_END_X**
+ *                     End.X action: Endpoint with Layer-3 cross-connect.
+ *                     Type of *param*: **struct in6_addr**.
+ *             **SEG6_LOCAL_ACTION_END_T**
+ *                     End.T action: Endpoint with specific IPv6 table lookup.
+ *                     Type of *param*: **int**.
+ *             **SEG6_LOCAL_ACTION_END_B6**
+ *                     End.B6 action: Endpoint bound to an SRv6 policy.
+ *                     Type of param: **struct ipv6_sr_hdr**.
+ *             **SEG6_LOCAL_ACTION_END_B6_ENCAP**
+ *                     End.B6.Encap action: Endpoint bound to an SRv6
+ *                     encapsulation policy.
+ *                     Type of param: **struct ipv6_sr_hdr**.
+ *
+ *             A call to this helper is susceptible to change the underlaying
+ *             packet buffer. Therefore, at load time, all checks on pointers
+ *             previously done by the verifier are invalidated and must be
+ *             performed again, if the helper is used in combination with
+ *             direct packet access.
+ *     Return
+ *             0 on success, or a negative error in case of failure.
  */
 #define __BPF_FUNC_MAPPER(FN)          \
        FN(unspec),                     \
@@ -1976,7 +2078,11 @@ union bpf_attr {
        FN(fib_lookup),                 \
        FN(sock_hash_update),           \
        FN(msg_redirect_hash),          \
-       FN(sk_redirect_hash),
+       FN(sk_redirect_hash),           \
+       FN(lwt_push_encap),             \
+       FN(lwt_seg6_store_bytes),       \
+       FN(lwt_seg6_adjust_srh),        \
+       FN(lwt_seg6_action),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
@@ -2043,6 +2149,12 @@ enum bpf_hdr_start_off {
        BPF_HDR_START_NET,
 };
 
+/* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */
+enum bpf_lwt_encap_mode {
+       BPF_LWT_ENCAP_SEG6,
+       BPF_LWT_ENCAP_SEG6_INLINE
+};
+
 /* user accessible mirror of in-kernel sk_buff.
  * new fields can only be added to the end of this structure
  */
@@ -2176,6 +2288,14 @@ enum sk_action {
 struct sk_msg_md {
        void *data;
        void *data_end;
+
+       __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 */
 };
 
 #define BPF_TAG_SIZE   8
@@ -2197,6 +2317,10 @@ struct bpf_prog_info {
        __u32 gpl_compatible:1;
        __u64 netns_dev;
        __u64 netns_ino;
+       __u32 nr_jited_ksyms;
+       __u32 nr_jited_func_lens;
+       __aligned_u64 jited_ksyms;
+       __aligned_u64 jited_func_lens;
 } __attribute__((aligned(8)));
 
 struct bpf_map_info {
@@ -2211,8 +2335,8 @@ struct bpf_map_info {
        __u64 netns_dev;
        __u64 netns_ino;
        __u32 btf_id;
-       __u32 btf_key_id;
-       __u32 btf_value_id;
+       __u32 btf_key_type_id;
+       __u32 btf_value_type_id;
 } __attribute__((aligned(8)));
 
 struct bpf_btf_info {
@@ -2450,4 +2574,13 @@ struct bpf_fib_lookup {
        __u8    dmac[6];     /* ETH_ALEN */
 };
 
+enum bpf_task_fd_type {
+       BPF_FD_TYPE_RAW_TRACEPOINT,     /* tp name */
+       BPF_FD_TYPE_TRACEPOINT,         /* tp name */
+       BPF_FD_TYPE_KPROBE,             /* (symbol + offset) or addr */
+       BPF_FD_TYPE_KRETPROBE,          /* (symbol + offset) or addr */
+       BPF_FD_TYPE_UPROBE,             /* filename + offset */
+       BPF_FD_TYPE_URETPROBE,          /* filename + offset */
+};
+
 #endif /* __LINUX_BPF_H__ */
index c4899e22cdaaa96ada9e581603cdb8302447cb54..a924606f36e56f76043d782041dbf217fb73cbc5 100644 (file)
@@ -33,6 +33,7 @@ enum {
        IFA_CACHEINFO,
        IFA_MULTICAST,
        IFA_FLAGS,
+       IFA_RT_PRIORITY,  /* u32, priority/metric for prefix route */
        __IFA_MAX,
 };
 
index 9318ecd0c462eca0dd02a412c3b0f6c65790ae54..4eccc7ff9a61516928e53998a5e99d0c81e6ddd6 100644 (file)
@@ -331,6 +331,7 @@ enum {
        IFLA_BRPORT_BCAST_FLOOD,
        IFLA_BRPORT_GROUP_FWD_MASK,
        IFLA_BRPORT_NEIGH_SUPPRESS,
+       IFLA_BRPORT_ISOLATED,
        __IFLA_BRPORT_MAX
 };
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
index aba8b18e4ed684417c740fdb9527dd8a6b9cbc18..a501bc79c2e4f98503a358f22acc2cfc494e87f4 100644 (file)
@@ -327,6 +327,9 @@ enum rtattr_type_t {
        RTA_PAD,
        RTA_UID,
        RTA_TTL_PROPAGATE,
+       RTA_IP_PROTO,
+       RTA_SPORT,
+       RTA_DPORT,
        __RTA_MAX
 };
 
index 76b90d60c7ea72910e87dda9ef40282f50cb515f..5312de80bcfae74c73bd308f58ec2881f5b4f357 100644 (file)
@@ -25,6 +25,7 @@ enum {
        SEG6_LOCAL_NH6,
        SEG6_LOCAL_IIF,
        SEG6_LOCAL_OIF,
+       SEG6_LOCAL_BPF,
        __SEG6_LOCAL_MAX,
 };
 #define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
@@ -59,10 +60,21 @@ enum {
        SEG6_LOCAL_ACTION_END_AS        = 13,
        /* forward to SR-unaware VNF with masquerading */
        SEG6_LOCAL_ACTION_END_AM        = 14,
+       /* custom BPF action */
+       SEG6_LOCAL_ACTION_END_BPF       = 15,
 
        __SEG6_LOCAL_ACTION_MAX,
 };
 
 #define SEG6_LOCAL_ACTION_MAX (__SEG6_LOCAL_ACTION_MAX - 1)
 
+enum {
+       SEG6_LOCAL_BPF_PROG_UNSPEC,
+       SEG6_LOCAL_BPF_PROG,
+       SEG6_LOCAL_BPF_PROG_NAME,
+       __SEG6_LOCAL_BPF_PROG_MAX,
+};
+
+#define SEG6_LOCAL_BPF_PROG_MAX (__SEG6_LOCAL_BPF_PROG_MAX - 1)
+
 #endif