]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
update kernel headers from net-next
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:54:33 +0000 (14:54 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:54:33 +0000 (14:54 -0800)
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/linux/bpf.h
include/linux/lwtunnel.h
include/linux/tc_act/tc_tunnel_key.h

index 52fb729c11ded0e48609a92a1ddfe4f767a1678f..a7f92a417805053d3c4797e3ffa6e323f17a5c0a 100644 (file)
@@ -101,11 +101,16 @@ enum bpf_prog_type {
        BPF_PROG_TYPE_XDP,
        BPF_PROG_TYPE_PERF_EVENT,
        BPF_PROG_TYPE_CGROUP_SKB,
+       BPF_PROG_TYPE_CGROUP_SOCK,
+       BPF_PROG_TYPE_LWT_IN,
+       BPF_PROG_TYPE_LWT_OUT,
+       BPF_PROG_TYPE_LWT_XMIT,
 };
 
 enum bpf_attach_type {
        BPF_CGROUP_INET_INGRESS,
        BPF_CGROUP_INET_EGRESS,
+       BPF_CGROUP_INET_SOCK_CREATE,
        __MAX_BPF_ATTACH_TYPE
 };
 
@@ -409,6 +414,16 @@ union bpf_attr {
  *
  * int bpf_get_numa_node_id()
  *     Return: Id of current NUMA node.
+ *
+ * int bpf_skb_change_head()
+ *     Grows headroom of skb and adjusts MAC header offset accordingly.
+ *     Will extends/reallocae as required automatically.
+ *     May change skb data pointer and will thus invalidate any check
+ *     performed for direct packet access.
+ *     @skb: pointer to skb
+ *     @len: length of header to be pushed in front
+ *     @flags: Flags (unused for now)
+ *     Return: 0 on success or negative error
  */
 #define __BPF_FUNC_MAPPER(FN)          \
        FN(unspec),                     \
@@ -453,7 +468,8 @@ union bpf_attr {
        FN(skb_pull_data),              \
        FN(csum_update),                \
        FN(set_hash_invalid),           \
-       FN(get_numa_node_id),
+       FN(get_numa_node_id),           \
+       FN(skb_change_head),
 
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
@@ -537,6 +553,29 @@ struct bpf_tunnel_key {
        __u32 tunnel_label;
 };
 
+/* Generic BPF return codes which all BPF program types may support.
+ * The values are binary compatible with their TC_ACT_* counter-part to
+ * provide backwards compatibility with existing SCHED_CLS and SCHED_ACT
+ * programs.
+ *
+ * XDP is handled seprately, see XDP_*.
+ */
+enum bpf_ret_code {
+       BPF_OK = 0,
+       /* 1 reserved */
+       BPF_DROP = 2,
+       /* 3-6 reserved */
+       BPF_REDIRECT = 7,
+       /* >127 are reserved for prog type specific return codes */
+};
+
+struct bpf_sock {
+       __u32 bound_dev_if;
+       __u32 family;
+       __u32 type;
+       __u32 protocol;
+};
+
 /* User return codes for XDP prog type.
  * A valid XDP program must return one of these defined values. All other
  * return codes are reserved for future use. Unknown return codes will result
index 7dbdaede79956fd6e3f8ea8e0c03a64674377e65..faa6eabee2040fafcb5a2adae389642688666466 100644 (file)
@@ -10,6 +10,7 @@ enum lwtunnel_encap_types {
        LWTUNNEL_ENCAP_ILA,
        LWTUNNEL_ENCAP_IP6,
        LWTUNNEL_ENCAP_SEG6,
+       LWTUNNEL_ENCAP_BPF,
        __LWTUNNEL_ENCAP_MAX,
 };
 
@@ -43,4 +44,26 @@ enum lwtunnel_ip6_t {
 
 #define LWTUNNEL_IP6_MAX (__LWTUNNEL_IP6_MAX - 1)
 
+enum {
+       LWT_BPF_PROG_UNSPEC,
+       LWT_BPF_PROG_FD,
+       LWT_BPF_PROG_NAME,
+       __LWT_BPF_PROG_MAX,
+};
+
+#define LWT_BPF_PROG_MAX (__LWT_BPF_PROG_MAX - 1)
+
+enum {
+       LWT_BPF_UNSPEC,
+       LWT_BPF_IN,
+       LWT_BPF_OUT,
+       LWT_BPF_XMIT,
+       LWT_BPF_XMIT_HEADROOM,
+       __LWT_BPF_MAX,
+};
+
+#define LWT_BPF_MAX (__LWT_BPF_MAX - 1)
+
+#define LWT_BPF_MAX_HEADROOM 256
+
 #endif /* _LWTUNNEL_H_ */
index f9ddf5369a452b981b6bb3196cff70cde05967c1..84ea55e1076b6b363c8688d1773fc21e9630fdb8 100644 (file)
@@ -33,10 +33,10 @@ enum {
        TCA_TUNNEL_KEY_ENC_IPV6_DST,    /* struct in6_addr */
        TCA_TUNNEL_KEY_ENC_KEY_ID,      /* be64 */
        TCA_TUNNEL_KEY_PAD,
+       TCA_TUNNEL_KEY_ENC_DST_PORT,    /* be16 */
        __TCA_TUNNEL_KEY_MAX,
 };
 
 #define TCA_TUNNEL_KEY_MAX (__TCA_TUNNEL_KEY_MAX - 1)
 
 #endif
-