History

Merge 4.18-rc5 into staging-next

We need the staging fixes in here as well.

Greg Kroah-Hartman committed 8 years ago

Commit 956f0042 parents bfd727f 9d3cce1415 files · +3904 −2059Browse files

Showing the changes to include/uapi/linux (3 of 415 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/bpf.h +23 −5
  2. include/uapi/linux/rseq.h +58 −44
  3. include/uapi/linux/types_32_64.h +0 −50
include/uapi/linux/bpf.h+23−5
@@ -1857,7 +1857,8 @@ union bpf_attr { · 1856 unmodified lines
18571857 * is resolved), the nexthop address is returned in ipv4_dst
18581858 * or ipv6_dst based on family, smac is set to mac address of
18591859 * egress device, dmac is set to nexthop mac address, rt_metric
1860− * is set to metric from route (IPv4/IPv6 only).
1860+ * is set to metric from route (IPv4/IPv6 only), and ifindex
1861+ * is set to the device index of the nexthop from the FIB lookup.
18611862 *
18621863 * *plen* argument is the size of the passed in struct.
18631864 * *flags* argument can be a combination of one or more of the
@@ -1873,9 +1874,10 @@ union bpf_attr { · 9 unmodified lines
18731874 * *ctx* is either **struct xdp_md** for XDP programs or
18741875 * **struct sk_buff** tc cls_act programs.
18751876 * Return
1876− * Egress device index on success, 0 if packet needs to continue
1877− * up the stack for further processing or a negative error in case
1878− * of failure.
1877+ * * < 0 if any input argument is invalid
1878+ * * 0 on success (packet is forwarded, nexthop neighbor exists)
1879+ * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
1880+ * * packet is not forwarded or needs assist from full stack
18791881 *
18801882 * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags)
18811883 * Description
@@ -2612,6 +2614,18 @@ struct bpf_raw_tracepoint_args { · 730 unmodified lines
26122614 #define BPF_FIB_LOOKUP_DIRECT BIT(0)
26132615 #define BPF_FIB_LOOKUP_OUTPUT BIT(1)
26142616
2617+enum {
2618+ BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */
2619+ BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */
2620+ BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */
2621+ BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */
2622+ BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */
2623+ BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */
2624+ BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */
2625+ BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */
2626+ BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */
2627+};
2628+
26152629 struct bpf_fib_lookup {
26162630 /* input: network family for lookup (AF_INET, AF_INET6)
26172631 * output: network family of egress nexthop
@@ -2625,7 +2639,11 @@ struct bpf_fib_lookup { · 7 unmodified lines
26252639
26262640 /* total length of packet from network header - used for MTU check */
26272641 __u16 tot_len;
2628− __u32 ifindex; /* L3 device index for lookup */
2642+
2643+ /* input: L3 device index for lookup
2644+ * output: device index from FIB lookup
2645+ */
2646+ __u32 ifindex;
26292647
26302648 union {
26312649 /* inputs to lookup */
include/uapi/linux/rseq.h+58−44
@@ -10,13 +10,8 @@ · 9 unmodified lines
1010 * Copyright (c) 2015-2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
1111 */
1212
13−#ifdef __KERNEL__
14−# include <linux/types.h>
15−#else
16−# include <stdint.h>
17−#endif
18−
19−#include <linux/types_32_64.h>
13+#include <linux/types.h>
14+#include <asm/byteorder.h>
2015
2116 enum rseq_cpu_id_state {
2217 RSEQ_CPU_ID_UNINITIALIZED = -1,
@@ -52,10 +47,10 @@ struct rseq_cs { · 29 unmodified lines
5247 __u32 version;
5348 /* enum rseq_cs_flags */
5449 __u32 flags;
55− LINUX_FIELD_u32_u64(start_ip);
50+ __u64 start_ip;
5651 /* Offset from start_ip. */
57− LINUX_FIELD_u32_u64(post_commit_offset);
58− LINUX_FIELD_u32_u64(abort_ip);
52+ __u64 post_commit_offset;
53+ __u64 abort_ip;
5954 } __attribute__((aligned(4 * sizeof(__u64))));
6055
6156 /*
@@ -67,28 +62,30 @@ struct rseq_cs { · 5 unmodified lines
6762 struct rseq {
6863 /*
6964 * Restartable sequences cpu_id_start field. Updated by the
70− * kernel, and read by user-space with single-copy atomicity
71− * semantics. Aligned on 32-bit. Always contains a value in the
72− * range of possible CPUs, although the value may not be the
73− * actual current CPU (e.g. if rseq is not initialized). This
74− * CPU number value should always be compared against the value
75− * of the cpu_id field before performing a rseq commit or
76− * returning a value read from a data structure indexed using
77− * the cpu_id_start value.
65+ * kernel. Read by user-space with single-copy atomicity
66+ * semantics. This field should only be read by the thread which
67+ * registered this data structure. Aligned on 32-bit. Always
68+ * contains a value in the range of possible CPUs, although the
69+ * value may not be the actual current CPU (e.g. if rseq is not
70+ * initialized). This CPU number value should always be compared
71+ * against the value of the cpu_id field before performing a rseq
72+ * commit or returning a value read from a data structure indexed
73+ * using the cpu_id_start value.
7874 */
7975 __u32 cpu_id_start;
8076 /*
81− * Restartable sequences cpu_id field. Updated by the kernel,
82− * and read by user-space with single-copy atomicity semantics.
83− * Aligned on 32-bit. Values RSEQ_CPU_ID_UNINITIALIZED and
84− * RSEQ_CPU_ID_REGISTRATION_FAILED have a special semantic: the
85− * former means "rseq uninitialized", and latter means "rseq
86− * initialization failed". This value is meant to be read within
87− * rseq critical sections and compared with the cpu_id_start
88− * value previously read, before performing the commit instruction,
89− * or read and compared with the cpu_id_start value before returning
90− * a value loaded from a data structure indexed using the
91− * cpu_id_start value.
77+ * Restartable sequences cpu_id field. Updated by the kernel.
78+ * Read by user-space with single-copy atomicity semantics. This
79+ * field should only be read by the thread which registered this
80+ * data structure. Aligned on 32-bit. Values
81+ * RSEQ_CPU_ID_UNINITIALIZED and RSEQ_CPU_ID_REGISTRATION_FAILED
82+ * have a special semantic: the former means "rseq uninitialized",
83+ * and latter means "rseq initialization failed". This value is
84+ * meant to be read within rseq critical sections and compared
85+ * with the cpu_id_start value previously read, before performing
86+ * the commit instruction, or read and compared with the
87+ * cpu_id_start value before returning a value loaded from a data
88+ * structure indexed using the cpu_id_start value.
9289 */
9390 __u32 cpu_id;
9491 /*
@@ -105,27 +102,44 @@ struct rseq { · 10 unmodified lines
105102 * targeted by the rseq_cs. Also needs to be set to NULL by user-space
106103 * before reclaiming memory that contains the targeted struct rseq_cs.
107104 *
108− * Read and set by the kernel with single-copy atomicity semantics.
109− * Set by user-space with single-copy atomicity semantics. Aligned
110− * on 64-bit.
105+ * Read and set by the kernel. Set by user-space with single-copy
106+ * atomicity semantics. This field should only be updated by the
107+ * thread which registered this data structure. Aligned on 64-bit.
111108 */
112− LINUX_FIELD_u32_u64(rseq_cs);
109+ union {
110+ __u64 ptr64;
111+#ifdef __LP64__
112+ __u64 ptr;
113+#else
114+ struct {
115+#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || defined(__BIG_ENDIAN)
116+ __u32 padding; /* Initialized to zero. */
117+ __u32 ptr32;
118+#else /* LITTLE */
119+ __u32 ptr32;
120+ __u32 padding; /* Initialized to zero. */
121+#endif /* ENDIAN */
122+ } ptr;
123+#endif
124+ } rseq_cs;
125+
113126 /*
114− * - RSEQ_DISABLE flag:
127+ * Restartable sequences flags field.
128+ *
129+ * This field should only be updated by the thread which
130+ * registered this data structure. Read by the kernel.
131+ * Mainly used for single-stepping through rseq critical sections
132+ * with debuggers.
115133 *
116− * Fallback fast-track flag for single-stepping.
117− * Set by user-space if lack of progress is detected.
118− * Cleared by user-space after rseq finish.
119− * Read by the kernel.
120134 * - RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT
121− * Inhibit instruction sequence block restart and event
122− * counter increment on preemption for this thread.
135+ * Inhibit instruction sequence block restart on preemption
136+ * for this thread.
123137 * - RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL
124− * Inhibit instruction sequence block restart and event
125− * counter increment on signal delivery for this thread.
138+ * Inhibit instruction sequence block restart on signal
139+ * delivery for this thread.
126140 * - RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
127− * Inhibit instruction sequence block restart and event
128− * counter increment on migration for this thread.
141+ * Inhibit instruction sequence block restart on migration for
142+ * this thread.
129143 */
130144 __u32 flags;
131145 } __attribute__((aligned(4 * sizeof(__u64))));
include/uapi/linux/types_32_64.h+0−50
@@ -1,50 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2−#ifndef _UAPI_LINUX_TYPES_32_64_H
3−#define _UAPI_LINUX_TYPES_32_64_H
4−
5−/*
6− * linux/types_32_64.h
7− *
8− * Integer type declaration for pointers across 32-bit and 64-bit systems.
9− *
10− * Copyright (c) 2015-2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11− */
12−
13−#ifdef __KERNEL__
14−# include <linux/types.h>
15−#else
16−# include <stdint.h>
17−#endif
18−
19−#include <asm/byteorder.h>
20−
21−#ifdef __BYTE_ORDER
22−# if (__BYTE_ORDER == __BIG_ENDIAN)
23−# define LINUX_BYTE_ORDER_BIG_ENDIAN
24−# else
25−# define LINUX_BYTE_ORDER_LITTLE_ENDIAN
26−# endif
27−#else
28−# ifdef __BIG_ENDIAN
29−# define LINUX_BYTE_ORDER_BIG_ENDIAN
30−# else
31−# define LINUX_BYTE_ORDER_LITTLE_ENDIAN
32−# endif
33−#endif
34−
35−#ifdef __LP64__
36−# define LINUX_FIELD_u32_u64(field) __u64 field
37−# define LINUX_FIELD_u32_u64_INIT_ONSTACK(field, v) field = (intptr_t)v
38−#else
39−# ifdef LINUX_BYTE_ORDER_BIG_ENDIAN
40−# define LINUX_FIELD_u32_u64(field) __u32 field ## _padding, field
41−# define LINUX_FIELD_u32_u64_INIT_ONSTACK(field, v) \
42− field ## _padding = 0, field = (intptr_t)v
43−# else
44−# define LINUX_FIELD_u32_u64(field) __u32 field, field ## _padding
45−# define LINUX_FIELD_u32_u64_INIT_ONSTACK(field, v) \
46− field = (intptr_t)v, field ## _padding = 0
47−# endif
48−#endif
49−
50−#endif /* _UAPI_LINUX_TYPES_32_64_H */