]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
update net-next headers
authorStephen Hemminger <sthemmin@microsoft.com>
Tue, 29 Nov 2016 19:43:40 +0000 (11:43 -0800)
committerStephen Hemminger <sthemmin@microsoft.com>
Tue, 29 Nov 2016 19:43:40 +0000 (11:43 -0800)
13 files changed:
include/linux/bpf.h
include/linux/devlink.h
include/linux/fib_rules.h
include/linux/genetlink.h
include/linux/if_link.h
include/linux/in.h
include/linux/in6.h
include/linux/l2tp.h
include/linux/lwtunnel.h
include/linux/netfilter.h
include/linux/pkt_cls.h
include/linux/rtnetlink.h
include/linux/tc_act/tc_skbedit.h

index 5c8191aeb885fd3e703858044766c3c8aff09a3c..52fb729c11ded0e48609a92a1ddfe4f767a1678f 100644 (file)
@@ -73,6 +73,8 @@ enum bpf_cmd {
        BPF_PROG_LOAD,
        BPF_OBJ_PIN,
        BPF_OBJ_GET,
+       BPF_PROG_ATTACH,
+       BPF_PROG_DETACH,
 };
 
 enum bpf_map_type {
@@ -85,6 +87,8 @@ enum bpf_map_type {
        BPF_MAP_TYPE_PERCPU_ARRAY,
        BPF_MAP_TYPE_STACK_TRACE,
        BPF_MAP_TYPE_CGROUP_ARRAY,
+       BPF_MAP_TYPE_LRU_HASH,
+       BPF_MAP_TYPE_LRU_PERCPU_HASH,
 };
 
 enum bpf_prog_type {
@@ -96,8 +100,17 @@ enum bpf_prog_type {
        BPF_PROG_TYPE_TRACEPOINT,
        BPF_PROG_TYPE_XDP,
        BPF_PROG_TYPE_PERF_EVENT,
+       BPF_PROG_TYPE_CGROUP_SKB,
 };
 
+enum bpf_attach_type {
+       BPF_CGROUP_INET_INGRESS,
+       BPF_CGROUP_INET_EGRESS,
+       __MAX_BPF_ATTACH_TYPE
+};
+
+#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
+
 #define BPF_PSEUDO_MAP_FD      1
 
 /* flags for BPF_MAP_UPDATE_ELEM command */
@@ -106,6 +119,13 @@ enum bpf_prog_type {
 #define BPF_EXIST      2 /* update existing element */
 
 #define BPF_F_NO_PREALLOC      (1U << 0)
+/* Instead of having one common LRU list in the
+ * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list
+ * which can scale and perform better.
+ * Note, the LRU nodes (including free nodes) cannot be moved
+ * across different LRU lists.
+ */
+#define BPF_F_NO_COMMON_LRU    (1U << 1)
 
 union bpf_attr {
        struct { /* anonymous struct used by BPF_MAP_CREATE command */
@@ -141,299 +161,309 @@ union bpf_attr {
                __aligned_u64   pathname;
                __u32           bpf_fd;
        };
+
+       struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
+               __u32           target_fd;      /* container object to attach to */
+               __u32           attach_bpf_fd;  /* eBPF program to attach */
+               __u32           attach_type;
+       };
 } __attribute__((aligned(8)));
 
+/* BPF helper function descriptions:
+ *
+ * void *bpf_map_lookup_elem(&map, &key)
+ *     Return: Map value or NULL
+ *
+ * int bpf_map_update_elem(&map, &key, &value, flags)
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_map_delete_elem(&map, &key)
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_probe_read(void *dst, int size, void *src)
+ *     Return: 0 on success or negative error
+ *
+ * u64 bpf_ktime_get_ns(void)
+ *     Return: current ktime
+ *
+ * int bpf_trace_printk(const char *fmt, int fmt_size, ...)
+ *     Return: length of buffer written or negative error
+ *
+ * u32 bpf_prandom_u32(void)
+ *     Return: random value
+ *
+ * u32 bpf_raw_smp_processor_id(void)
+ *     Return: SMP processor ID
+ *
+ * int bpf_skb_store_bytes(skb, offset, from, len, flags)
+ *     store bytes into packet
+ *     @skb: pointer to skb
+ *     @offset: offset within packet from skb->mac_header
+ *     @from: pointer where to copy bytes from
+ *     @len: number of bytes to store into packet
+ *     @flags: bit 0 - if true, recompute skb->csum
+ *             other bits - reserved
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_l3_csum_replace(skb, offset, from, to, flags)
+ *     recompute IP checksum
+ *     @skb: pointer to skb
+ *     @offset: offset within packet where IP checksum is located
+ *     @from: old value of header field
+ *     @to: new value of header field
+ *     @flags: bits 0-3 - size of header field
+ *             other bits - reserved
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_l4_csum_replace(skb, offset, from, to, flags)
+ *     recompute TCP/UDP checksum
+ *     @skb: pointer to skb
+ *     @offset: offset within packet where TCP/UDP checksum is located
+ *     @from: old value of header field
+ *     @to: new value of header field
+ *     @flags: bits 0-3 - size of header field
+ *             bit 4 - is pseudo header
+ *             other bits - reserved
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_tail_call(ctx, prog_array_map, index)
+ *     jump into another BPF program
+ *     @ctx: context pointer passed to next program
+ *     @prog_array_map: pointer to map which type is BPF_MAP_TYPE_PROG_ARRAY
+ *     @index: index inside array that selects specific program to run
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_clone_redirect(skb, ifindex, flags)
+ *     redirect to another netdev
+ *     @skb: pointer to skb
+ *     @ifindex: ifindex of the net device
+ *     @flags: bit 0 - if set, redirect to ingress instead of egress
+ *             other bits - reserved
+ *     Return: 0 on success or negative error
+ *
+ * u64 bpf_get_current_pid_tgid(void)
+ *     Return: current->tgid << 32 | current->pid
+ *
+ * u64 bpf_get_current_uid_gid(void)
+ *     Return: current_gid << 32 | current_uid
+ *
+ * int bpf_get_current_comm(char *buf, int size_of_buf)
+ *     stores current->comm into buf
+ *     Return: 0 on success or negative error
+ *
+ * u32 bpf_get_cgroup_classid(skb)
+ *     retrieve a proc's classid
+ *     @skb: pointer to skb
+ *     Return: classid if != 0
+ *
+ * int bpf_skb_vlan_push(skb, vlan_proto, vlan_tci)
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_skb_vlan_pop(skb)
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_skb_get_tunnel_key(skb, key, size, flags)
+ * int bpf_skb_set_tunnel_key(skb, key, size, flags)
+ *     retrieve or populate tunnel metadata
+ *     @skb: pointer to skb
+ *     @key: pointer to 'struct bpf_tunnel_key'
+ *     @size: size of 'struct bpf_tunnel_key'
+ *     @flags: room for future extensions
+ *     Return: 0 on success or negative error
+ *
+ * u64 bpf_perf_event_read(&map, index)
+ *     Return: Number events read or error code
+ *
+ * int bpf_redirect(ifindex, flags)
+ *     redirect to another netdev
+ *     @ifindex: ifindex of the net device
+ *     @flags: bit 0 - if set, redirect to ingress instead of egress
+ *             other bits - reserved
+ *     Return: TC_ACT_REDIRECT
+ *
+ * u32 bpf_get_route_realm(skb)
+ *     retrieve a dst's tclassid
+ *     @skb: pointer to skb
+ *     Return: realm if != 0
+ *
+ * int bpf_perf_event_output(ctx, map, index, data, size)
+ *     output perf raw sample
+ *     @ctx: struct pt_regs*
+ *     @map: pointer to perf_event_array map
+ *     @index: index of event in the map
+ *     @data: data on stack to be output as raw data
+ *     @size: size of data
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_get_stackid(ctx, map, flags)
+ *     walk user or kernel stack and return id
+ *     @ctx: struct pt_regs*
+ *     @map: pointer to stack_trace map
+ *     @flags: bits 0-7 - numer of stack frames to skip
+ *             bit 8 - collect user stack instead of kernel
+ *             bit 9 - compare stacks by hash only
+ *             bit 10 - if two different stacks hash into the same stackid
+ *                      discard old
+ *             other bits - reserved
+ *     Return: >= 0 stackid on success or negative error
+ *
+ * s64 bpf_csum_diff(from, from_size, to, to_size, seed)
+ *     calculate csum diff
+ *     @from: raw from buffer
+ *     @from_size: length of from buffer
+ *     @to: raw to buffer
+ *     @to_size: length of to buffer
+ *     @seed: optional seed
+ *     Return: csum result or negative error code
+ *
+ * int bpf_skb_get_tunnel_opt(skb, opt, size)
+ *     retrieve tunnel options metadata
+ *     @skb: pointer to skb
+ *     @opt: pointer to raw tunnel option data
+ *     @size: size of @opt
+ *     Return: option size
+ *
+ * int bpf_skb_set_tunnel_opt(skb, opt, size)
+ *     populate tunnel options metadata
+ *     @skb: pointer to skb
+ *     @opt: pointer to raw tunnel option data
+ *     @size: size of @opt
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_skb_change_proto(skb, proto, flags)
+ *     Change protocol of the skb. Currently supported is v4 -> v6,
+ *     v6 -> v4 transitions. The helper will also resize the skb. eBPF
+ *     program is expected to fill the new headers via skb_store_bytes
+ *     and lX_csum_replace.
+ *     @skb: pointer to skb
+ *     @proto: new skb->protocol type
+ *     @flags: reserved
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_skb_change_type(skb, type)
+ *     Change packet type of skb.
+ *     @skb: pointer to skb
+ *     @type: new skb->pkt_type type
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_skb_under_cgroup(skb, map, index)
+ *     Check cgroup2 membership of skb
+ *     @skb: pointer to skb
+ *     @map: pointer to bpf_map in BPF_MAP_TYPE_CGROUP_ARRAY type
+ *     @index: index of the cgroup in the bpf_map
+ *     Return:
+ *       == 0 skb failed the cgroup2 descendant test
+ *       == 1 skb succeeded the cgroup2 descendant test
+ *        < 0 error
+ *
+ * u32 bpf_get_hash_recalc(skb)
+ *     Retrieve and possibly recalculate skb->hash.
+ *     @skb: pointer to skb
+ *     Return: hash
+ *
+ * u64 bpf_get_current_task(void)
+ *     Returns current task_struct
+ *     Return: current
+ *
+ * int bpf_probe_write_user(void *dst, void *src, int len)
+ *     safely attempt to write to a location
+ *     @dst: destination address in userspace
+ *     @src: source address on stack
+ *     @len: number of bytes to copy
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_current_task_under_cgroup(map, index)
+ *     Check cgroup2 membership of current task
+ *     @map: pointer to bpf_map in BPF_MAP_TYPE_CGROUP_ARRAY type
+ *     @index: index of the cgroup in the bpf_map
+ *     Return:
+ *       == 0 current failed the cgroup2 descendant test
+ *       == 1 current succeeded the cgroup2 descendant test
+ *        < 0 error
+ *
+ * int bpf_skb_change_tail(skb, len, flags)
+ *     The helper will resize the skb to the given new size, to be used f.e.
+ *     with control messages.
+ *     @skb: pointer to skb
+ *     @len: new skb length
+ *     @flags: reserved
+ *     Return: 0 on success or negative error
+ *
+ * int bpf_skb_pull_data(skb, len)
+ *     The helper will pull in non-linear data in case the skb is non-linear
+ *     and not all of len are part of the linear section. Only needed for
+ *     read/write with direct packet access.
+ *     @skb: pointer to skb
+ *     @len: len to make read/writeable
+ *     Return: 0 on success or negative error
+ *
+ * s64 bpf_csum_update(skb, csum)
+ *     Adds csum into skb->csum in case of CHECKSUM_COMPLETE.
+ *     @skb: pointer to skb
+ *     @csum: csum to add
+ *     Return: csum on success or negative error
+ *
+ * void bpf_set_hash_invalid(skb)
+ *     Invalidate current skb->hash.
+ *     @skb: pointer to skb
+ *
+ * int bpf_get_numa_node_id()
+ *     Return: Id of current NUMA node.
+ */
+#define __BPF_FUNC_MAPPER(FN)          \
+       FN(unspec),                     \
+       FN(map_lookup_elem),            \
+       FN(map_update_elem),            \
+       FN(map_delete_elem),            \
+       FN(probe_read),                 \
+       FN(ktime_get_ns),               \
+       FN(trace_printk),               \
+       FN(get_prandom_u32),            \
+       FN(get_smp_processor_id),       \
+       FN(skb_store_bytes),            \
+       FN(l3_csum_replace),            \
+       FN(l4_csum_replace),            \
+       FN(tail_call),                  \
+       FN(clone_redirect),             \
+       FN(get_current_pid_tgid),       \
+       FN(get_current_uid_gid),        \
+       FN(get_current_comm),           \
+       FN(get_cgroup_classid),         \
+       FN(skb_vlan_push),              \
+       FN(skb_vlan_pop),               \
+       FN(skb_get_tunnel_key),         \
+       FN(skb_set_tunnel_key),         \
+       FN(perf_event_read),            \
+       FN(redirect),                   \
+       FN(get_route_realm),            \
+       FN(perf_event_output),          \
+       FN(skb_load_bytes),             \
+       FN(get_stackid),                \
+       FN(csum_diff),                  \
+       FN(skb_get_tunnel_opt),         \
+       FN(skb_set_tunnel_opt),         \
+       FN(skb_change_proto),           \
+       FN(skb_change_type),            \
+       FN(skb_under_cgroup),           \
+       FN(get_hash_recalc),            \
+       FN(get_current_task),           \
+       FN(probe_write_user),           \
+       FN(current_task_under_cgroup),  \
+       FN(skb_change_tail),            \
+       FN(skb_pull_data),              \
+       FN(csum_update),                \
+       FN(set_hash_invalid),           \
+       FN(get_numa_node_id),
+
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
  * function eBPF program intends to call
  */
+#define __BPF_ENUM_FN(x) BPF_FUNC_ ## x
 enum bpf_func_id {
-       BPF_FUNC_unspec,
-       BPF_FUNC_map_lookup_elem, /* void *map_lookup_elem(&map, &key) */
-       BPF_FUNC_map_update_elem, /* int map_update_elem(&map, &key, &value, flags) */
-       BPF_FUNC_map_delete_elem, /* int map_delete_elem(&map, &key) */
-       BPF_FUNC_probe_read,      /* int bpf_probe_read(void *dst, int size, void *src) */
-       BPF_FUNC_ktime_get_ns,    /* u64 bpf_ktime_get_ns(void) */
-       BPF_FUNC_trace_printk,    /* int bpf_trace_printk(const char *fmt, int fmt_size, ...) */
-       BPF_FUNC_get_prandom_u32, /* u32 prandom_u32(void) */
-       BPF_FUNC_get_smp_processor_id, /* u32 raw_smp_processor_id(void) */
-
-       /**
-        * skb_store_bytes(skb, offset, from, len, flags) - store bytes into packet
-        * @skb: pointer to skb
-        * @offset: offset within packet from skb->mac_header
-        * @from: pointer where to copy bytes from
-        * @len: number of bytes to store into packet
-        * @flags: bit 0 - if true, recompute skb->csum
-        *         other bits - reserved
-        * Return: 0 on success
-        */
-       BPF_FUNC_skb_store_bytes,
-
-       /**
-        * l3_csum_replace(skb, offset, from, to, flags) - recompute IP checksum
-        * @skb: pointer to skb
-        * @offset: offset within packet where IP checksum is located
-        * @from: old value of header field
-        * @to: new value of header field
-        * @flags: bits 0-3 - size of header field
-        *         other bits - reserved
-        * Return: 0 on success
-        */
-       BPF_FUNC_l3_csum_replace,
-
-       /**
-        * l4_csum_replace(skb, offset, from, to, flags) - recompute TCP/UDP checksum
-        * @skb: pointer to skb
-        * @offset: offset within packet where TCP/UDP checksum is located
-        * @from: old value of header field
-        * @to: new value of header field
-        * @flags: bits 0-3 - size of header field
-        *         bit 4 - is pseudo header
-        *         other bits - reserved
-        * Return: 0 on success
-        */
-       BPF_FUNC_l4_csum_replace,
-
-       /**
-        * bpf_tail_call(ctx, prog_array_map, index) - jump into another BPF program
-        * @ctx: context pointer passed to next program
-        * @prog_array_map: pointer to map which type is BPF_MAP_TYPE_PROG_ARRAY
-        * @index: index inside array that selects specific program to run
-        * Return: 0 on success
-        */
-       BPF_FUNC_tail_call,
-
-       /**
-        * bpf_clone_redirect(skb, ifindex, flags) - redirect to another netdev
-        * @skb: pointer to skb
-        * @ifindex: ifindex of the net device
-        * @flags: bit 0 - if set, redirect to ingress instead of egress
-        *         other bits - reserved
-        * Return: 0 on success
-        */
-       BPF_FUNC_clone_redirect,
-
-       /**
-        * u64 bpf_get_current_pid_tgid(void)
-        * Return: current->tgid << 32 | current->pid
-        */
-       BPF_FUNC_get_current_pid_tgid,
-
-       /**
-        * u64 bpf_get_current_uid_gid(void)
-        * Return: current_gid << 32 | current_uid
-        */
-       BPF_FUNC_get_current_uid_gid,
-
-       /**
-        * bpf_get_current_comm(char *buf, int size_of_buf)
-        * stores current->comm into buf
-        * Return: 0 on success
-        */
-       BPF_FUNC_get_current_comm,
-
-       /**
-        * bpf_get_cgroup_classid(skb) - retrieve a proc's classid
-        * @skb: pointer to skb
-        * Return: classid if != 0
-        */
-       BPF_FUNC_get_cgroup_classid,
-       BPF_FUNC_skb_vlan_push, /* bpf_skb_vlan_push(skb, vlan_proto, vlan_tci) */
-       BPF_FUNC_skb_vlan_pop,  /* bpf_skb_vlan_pop(skb) */
-
-       /**
-        * bpf_skb_[gs]et_tunnel_key(skb, key, size, flags)
-        * retrieve or populate tunnel metadata
-        * @skb: pointer to skb
-        * @key: pointer to 'struct bpf_tunnel_key'
-        * @size: size of 'struct bpf_tunnel_key'
-        * @flags: room for future extensions
-        * Retrun: 0 on success
-        */
-       BPF_FUNC_skb_get_tunnel_key,
-       BPF_FUNC_skb_set_tunnel_key,
-       BPF_FUNC_perf_event_read,       /* u64 bpf_perf_event_read(&map, index) */
-       /**
-        * bpf_redirect(ifindex, flags) - redirect to another netdev
-        * @ifindex: ifindex of the net device
-        * @flags: bit 0 - if set, redirect to ingress instead of egress
-        *         other bits - reserved
-        * Return: TC_ACT_REDIRECT
-        */
-       BPF_FUNC_redirect,
-
-       /**
-        * bpf_get_route_realm(skb) - retrieve a dst's tclassid
-        * @skb: pointer to skb
-        * Return: realm if != 0
-        */
-       BPF_FUNC_get_route_realm,
-
-       /**
-        * bpf_perf_event_output(ctx, map, index, data, size) - output perf raw sample
-        * @ctx: struct pt_regs*
-        * @map: pointer to perf_event_array map
-        * @index: index of event in the map
-        * @data: data on stack to be output as raw data
-        * @size: size of data
-        * Return: 0 on success
-        */
-       BPF_FUNC_perf_event_output,
-       BPF_FUNC_skb_load_bytes,
-
-       /**
-        * bpf_get_stackid(ctx, map, flags) - walk user or kernel stack and return id
-        * @ctx: struct pt_regs*
-        * @map: pointer to stack_trace map
-        * @flags: bits 0-7 - numer of stack frames to skip
-        *         bit 8 - collect user stack instead of kernel
-        *         bit 9 - compare stacks by hash only
-        *         bit 10 - if two different stacks hash into the same stackid
-        *                  discard old
-        *         other bits - reserved
-        * Return: >= 0 stackid on success or negative error
-        */
-       BPF_FUNC_get_stackid,
-
-       /**
-        * bpf_csum_diff(from, from_size, to, to_size, seed) - calculate csum diff
-        * @from: raw from buffer
-        * @from_size: length of from buffer
-        * @to: raw to buffer
-        * @to_size: length of to buffer
-        * @seed: optional seed
-        * Return: csum result
-        */
-       BPF_FUNC_csum_diff,
-
-       /**
-        * bpf_skb_[gs]et_tunnel_opt(skb, opt, size)
-        * retrieve or populate tunnel options metadata
-        * @skb: pointer to skb
-        * @opt: pointer to raw tunnel option data
-        * @size: size of @opt
-        * Return: 0 on success for set, option size for get
-        */
-       BPF_FUNC_skb_get_tunnel_opt,
-       BPF_FUNC_skb_set_tunnel_opt,
-
-       /**
-        * bpf_skb_change_proto(skb, proto, flags)
-        * Change protocol of the skb. Currently supported is
-        * v4 -> v6, v6 -> v4 transitions. The helper will also
-        * resize the skb. eBPF program is expected to fill the
-        * new headers via skb_store_bytes and lX_csum_replace.
-        * @skb: pointer to skb
-        * @proto: new skb->protocol type
-        * @flags: reserved
-        * Return: 0 on success or negative error
-        */
-       BPF_FUNC_skb_change_proto,
-
-       /**
-        * bpf_skb_change_type(skb, type)
-        * Change packet type of skb.
-        * @skb: pointer to skb
-        * @type: new skb->pkt_type type
-        * Return: 0 on success or negative error
-        */
-       BPF_FUNC_skb_change_type,
-
-       /**
-        * bpf_skb_under_cgroup(skb, map, index) - Check cgroup2 membership of skb
-        * @skb: pointer to skb
-        * @map: pointer to bpf_map in BPF_MAP_TYPE_CGROUP_ARRAY type
-        * @index: index of the cgroup in the bpf_map
-        * Return:
-        *   == 0 skb failed the cgroup2 descendant test
-        *   == 1 skb succeeded the cgroup2 descendant test
-        *    < 0 error
-        */
-       BPF_FUNC_skb_under_cgroup,
-
-       /**
-        * bpf_get_hash_recalc(skb)
-        * Retrieve and possibly recalculate skb->hash.
-        * @skb: pointer to skb
-        * Return: hash
-        */
-       BPF_FUNC_get_hash_recalc,
-
-       /**
-        * u64 bpf_get_current_task(void)
-        * Returns current task_struct
-        * Return: current
-        */
-       BPF_FUNC_get_current_task,
-
-       /**
-        * bpf_probe_write_user(void *dst, void *src, int len)
-        * safely attempt to write to a location
-        * @dst: destination address in userspace
-        * @src: source address on stack
-        * @len: number of bytes to copy
-        * Return: 0 on success or negative error
-        */
-       BPF_FUNC_probe_write_user,
-
-       /**
-        * bpf_current_task_under_cgroup(map, index) - Check cgroup2 membership of current task
-        * @map: pointer to bpf_map in BPF_MAP_TYPE_CGROUP_ARRAY type
-        * @index: index of the cgroup in the bpf_map
-        * Return:
-        *   == 0 current failed the cgroup2 descendant test
-        *   == 1 current succeeded the cgroup2 descendant test
-        *    < 0 error
-        */
-       BPF_FUNC_current_task_under_cgroup,
-
-       /**
-        * bpf_skb_change_tail(skb, len, flags)
-        * The helper will resize the skb to the given new size,
-        * to be used f.e. with control messages.
-        * @skb: pointer to skb
-        * @len: new skb length
-        * @flags: reserved
-        * Return: 0 on success or negative error
-        */
-       BPF_FUNC_skb_change_tail,
-
-       /**
-        * bpf_skb_pull_data(skb, len)
-        * The helper will pull in non-linear data in case the
-        * skb is non-linear and not all of len are part of the
-        * linear section. Only needed for read/write with direct
-        * packet access.
-        * @skb: pointer to skb
-        * @len: len to make read/writeable
-        * Return: 0 on success or negative error
-        */
-       BPF_FUNC_skb_pull_data,
-
-       /**
-        * bpf_csum_update(skb, csum)
-        * Adds csum into skb->csum in case of CHECKSUM_COMPLETE.
-        * @skb: pointer to skb
-        * @csum: csum to add
-        * Return: csum on success or negative error
-        */
-       BPF_FUNC_csum_update,
-
-       /**
-        * bpf_set_hash_invalid(skb)
-        * Invalidate current skb>hash.
-        * @skb: pointer to skb
-        */
-       BPF_FUNC_set_hash_invalid,
-
-       /**
-        * bpf_get_numa_node_id()
-        * Returns the id of the current NUMA node.
-        */
-       BPF_FUNC_get_numa_node_id,
-
+       __BPF_FUNC_MAPPER(__BPF_ENUM_FN)
        __BPF_FUNC_MAX_ID,
 };
+#undef __BPF_ENUM_FN
 
 /* All flags used by eBPF helper functions, placed here. */
 
index b7c1a06974600899eac3c7b9ea2c3bdd15a2882c..7c14d77313f254aba6a497a3750fd10fb48e6e03 100644 (file)
@@ -102,6 +102,13 @@ enum devlink_eswitch_mode {
        DEVLINK_ESWITCH_MODE_SWITCHDEV,
 };
 
+enum devlink_eswitch_inline_mode {
+       DEVLINK_ESWITCH_INLINE_MODE_NONE,
+       DEVLINK_ESWITCH_INLINE_MODE_LINK,
+       DEVLINK_ESWITCH_INLINE_MODE_NETWORK,
+       DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT,
+};
+
 enum devlink_attr {
        /* don't change the order or add anything between, this is ABI! */
        DEVLINK_ATTR_UNSPEC,
@@ -133,6 +140,7 @@ enum devlink_attr {
        DEVLINK_ATTR_SB_OCC_CUR,                /* u32 */
        DEVLINK_ATTR_SB_OCC_MAX,                /* u32 */
        DEVLINK_ATTR_ESWITCH_MODE,              /* u16 */
+       DEVLINK_ATTR_ESWITCH_INLINE_MODE,       /* u8 */
 
        /* add new attributes above here, update the policy in devlink.c */
 
index 14404b3ebb89a54e9437ddeb2748907b0ff73d64..bbf02a63a01133351ea49392f1bb06da13b4130d 100644 (file)
@@ -29,6 +29,11 @@ struct fib_rule_hdr {
        __u32           flags;
 };
 
+struct fib_rule_uid_range {
+       __u32           start;
+       __u32           end;
+};
+
 enum {
        FRA_UNSPEC,
        FRA_DST,        /* destination address */
@@ -51,6 +56,7 @@ enum {
        FRA_OIFNAME,
        FRA_PAD,
        FRA_L3MDEV,     /* iif or oif is l3mdev goto its table */
+       FRA_UID_RANGE,  /* UID range */
        __FRA_MAX
 };
 
index e792092609d35d84afca91bbe1f6438b77969019..08239d8ead41d27f018a21e4c24d4ca3f4935a03 100644 (file)
@@ -26,10 +26,11 @@ struct genlmsghdr {
 /*
  * List of reserved static generic netlink identifiers:
  */
-#define GENL_ID_GENERATE       0
 #define GENL_ID_CTRL           NLMSG_MIN_TYPE
 #define GENL_ID_VFS_DQUOT      (NLMSG_MIN_TYPE + 1)
 #define GENL_ID_PMCRAID                (NLMSG_MIN_TYPE + 2)
+/* must be last reserved + 1 */
+#define GENL_START_ALLOC       (NLMSG_MIN_TYPE + 3)
 
 /**************************************************************************
  * Controller
index 20965c9a6dbc11fd0de994b682f3b9bdc9540a47..5a89dcdd8128daa1fb0432661b2845fdb8149933 100644 (file)
@@ -273,6 +273,8 @@ enum {
        IFLA_BR_PAD,
        IFLA_BR_VLAN_STATS_ENABLED,
        IFLA_BR_MCAST_STATS_ENABLED,
+       IFLA_BR_MCAST_IGMP_VERSION,
+       IFLA_BR_MCAST_MLD_VERSION,
        __IFLA_BR_MAX,
 };
 
index 194b43bea64ac141ef17883c2f7ae5e6a62873e1..9439efaaa0c84b5911880a50c2bac373031e8ad3 100644 (file)
@@ -117,6 +117,7 @@ struct in_addr {
 #define IP_NODEFRAG     22
 #define IP_CHECKSUM    23
 #define IP_BIND_ADDRESS_NO_PORT        24
+#define IP_RECVFRAGSIZE        25
 
 /* IP_MTU_DISCOVER values */
 #define IP_PMTUDISC_DONT               0       /* Never send DF frames */
index 45aaaa40ff0e371eaa7e5452dbc8aa8338d1be56..6f3bdee7c0abaf768deb4de1848cbf11ca14f219 100644 (file)
@@ -283,6 +283,7 @@ struct in6_flowlabel_req {
 #define IPV6_RECVORIGDSTADDR    IPV6_ORIGDSTADDR
 #define IPV6_TRANSPARENT        75
 #define IPV6_UNICAST_IF         76
+#define IPV6_RECVFRAGSIZE      77
 
 /*
  * Multicast Routing:
index f00e4248b0e0b82790b4aaad7c59cb0558dbe186..b7285c91ba6661a6e457ba823bca26f5f0bf6245 100644 (file)
@@ -122,8 +122,8 @@ enum {
        L2TP_ATTR_STATS,                /* nested */
        L2TP_ATTR_IP6_SADDR,            /* struct in6_addr */
        L2TP_ATTR_IP6_DADDR,            /* struct in6_addr */
-       L2TP_ATTR_UDP_ZERO_CSUM6_TX,    /* u8 */
-       L2TP_ATTR_UDP_ZERO_CSUM6_RX,    /* u8 */
+       L2TP_ATTR_UDP_ZERO_CSUM6_TX,    /* flag */
+       L2TP_ATTR_UDP_ZERO_CSUM6_RX,    /* flag */
        L2TP_ATTR_PAD,
        __L2TP_ATTR_MAX,
 };
index 7cea3cbfa1289612f92a0f1ded578a848ecb8a52..7dbdaede79956fd6e3f8ea8e0c03a64674377e65 100644 (file)
@@ -9,6 +9,7 @@ enum lwtunnel_encap_types {
        LWTUNNEL_ENCAP_IP,
        LWTUNNEL_ENCAP_ILA,
        LWTUNNEL_ENCAP_IP6,
+       LWTUNNEL_ENCAP_SEG6,
        __LWTUNNEL_ENCAP_MAX,
 };
 
index b71b4c97a6424cd677141eff71ea144bed0ba543..d8bc1e626371d630288182fc57e04245f138b0ba 100644 (file)
@@ -13,7 +13,7 @@
 #define NF_STOLEN 2
 #define NF_QUEUE 3
 #define NF_REPEAT 4
-#define NF_STOP 5
+#define NF_STOP 5      /* Deprecated, for userspace nf_queue compatibility. */
 #define NF_MAX_VERDICT NF_STOP
 
 /* we overload the higher bits for encoding auxiliary data such as the queue
index b47ed3af22b694eab145180b3f957af05696a7e1..a3d8a4f17d8e46b63c32b8804d79474efa852140 100644 (file)
@@ -393,6 +393,16 @@ enum {
        TCA_FLOWER_KEY_TCP_DST_MASK,    /* be16 */
        TCA_FLOWER_KEY_UDP_SRC_MASK,    /* be16 */
        TCA_FLOWER_KEY_UDP_DST_MASK,    /* be16 */
+       TCA_FLOWER_KEY_SCTP_SRC_MASK,   /* be16 */
+       TCA_FLOWER_KEY_SCTP_DST_MASK,   /* be16 */
+
+       TCA_FLOWER_KEY_SCTP_SRC,        /* be16 */
+       TCA_FLOWER_KEY_SCTP_DST,        /* be16 */
+
+       TCA_FLOWER_KEY_ENC_UDP_SRC_PORT,        /* be16 */
+       TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK,   /* be16 */
+       TCA_FLOWER_KEY_ENC_UDP_DST_PORT,        /* be16 */
+       TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK,   /* be16 */
        __TCA_FLOWER_MAX,
 };
 
index 2d2e3e6c5b81373c9f086f6c35dd523742d519fb..78a70c274518ca3fc1eca3ff85c8f6c96e5f43d9 100644 (file)
@@ -318,6 +318,7 @@ enum rtattr_type_t {
        RTA_ENCAP,
        RTA_EXPIRES,
        RTA_PAD,
+       RTA_UID,
        __RTA_MAX
 };
 
@@ -350,7 +351,7 @@ struct rtnexthop {
 #define RTNH_F_OFFLOAD         8       /* offloaded route */
 #define RTNH_F_LINKDOWN                16      /* carrier-down on nexthop */
 
-#define RTNH_COMPARE_MASK      (RTNH_F_DEAD | RTNH_F_LINKDOWN)
+#define RTNH_COMPARE_MASK      (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
 
 /* Macros to handle hexthops */
 
index a4d00c608d8f7e307e0be65e1e8b78371e4dc908..2884425738ce73e3bbbbf8dcfa79c6e345022476 100644 (file)
@@ -28,6 +28,7 @@
 #define SKBEDIT_F_QUEUE_MAPPING                0x2
 #define SKBEDIT_F_MARK                 0x4
 #define SKBEDIT_F_PTYPE                        0x8
+#define SKBEDIT_F_MASK                 0x10
 
 struct tc_skbedit {
        tc_gen;
@@ -42,6 +43,7 @@ enum {
        TCA_SKBEDIT_MARK,
        TCA_SKBEDIT_PAD,
        TCA_SKBEDIT_PTYPE,
+       TCA_SKBEDIT_MASK,
        __TCA_SKBEDIT_MAX
 };
 #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)