History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Several conflicts, seemingly all over the place. I used Stephen Rothwell's sample resolutions for many of these, if not just to double check my own work, so definitely the credit largely goes to him. The NFP conflict consisted of a bug fix (moving operations past the rhashtable operation) while chaning the initial argument in the function call in the moved code. The net/dsa/master.c conflict had to do with a bug fix intermixing of making dsa_master_set_mtu() static with the fixing of the tagging attribute location. cls_flower had a conflict because the dup reject fix from Or overlapped with the addition of port range classifiction. __set_phy_supported()'s conflict was relatively easy to resolve because Andrew fixed it in both trees, so it was just a matter of taking the net-next copy. Or at least I think it was :-) Joe Stringer's fix to the handling of netns id 0 in bpf_sk_lookup() intermixed with changes on how the sdif and caller_net are calculated in these code paths in net-next. The remaining BPF conflicts were largely about the addition of the __bpf_md_ptr stuff in 'net' overlapping with adjustments and additions to the relevant data structure where the MD pointer macros are used.

David S. Miller committed 7 years ago

Commit 4cc1fee2 parents a60956e 40e020c576 files · +6121 −3146Browse files

Showing the changes to include/uapi/linux (2 of 576 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/bpf.h +37 −23
  2. include/uapi/linux/prctl.h +1 −0
include/uapi/linux/bpf.h+37−23
@@ -2177,7 +2177,7 @@ union bpf_attr { · 2176 unmodified lines
21772177 * Return
21782178 * 0 on success, or a negative error in case of failure.
21792179 *
2180− * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
2180+ * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
21812181 * Description
21822182 * Look for TCP socket matching *tuple*, optionally in a child
21832183 * network namespace *netns*. The return value must be checked,
@@ -2194,12 +2194,14 @@ union bpf_attr { · 10 unmodified lines
21942194 * **sizeof**\ (*tuple*\ **->ipv6**)
21952195 * Look for an IPv6 socket.
21962196 *
2197− * If the *netns* is zero, then the socket lookup table in the
2198− * netns associated with the *ctx* will be used. For the TC hooks,
2199− * this in the netns of the device in the skb. For socket hooks,
2200− * this in the netns of the socket. If *netns* is non-zero, then
2201− * it specifies the ID of the netns relative to the netns
2202− * associated with the *ctx*.
2197+ * If the *netns* is a negative signed 32-bit integer, then the
2198+ * socket lookup table in the netns associated with the *ctx* will
2199+ * will be used. For the TC hooks, this is the netns of the device
2200+ * in the skb. For socket hooks, this is the netns of the socket.
2201+ * If *netns* is any other signed 32-bit value greater than or
2202+ * equal to zero then it specifies the ID of the netns relative to
2203+ * the netns associated with the *ctx*. *netns* values beyond the
2204+ * range of 32-bit integers are reserved for future use.
22032205 *
22042206 * All values for *flags* are reserved for future usage, and must
22052207 * be left at zero.
@@ -2208,10 +2210,10 @@ union bpf_attr { · 2 unmodified lines
22082210 * **CONFIG_NET** configuration option.
22092211 * Return
22102212 * Pointer to *struct bpf_sock*, or NULL in case of failure.
2211− * For sockets with reuseport option, *struct bpf_sock*
2212− * return is from reuse->socks[] using hash of the packet.
2213+ * For sockets with reuseport option, the *struct bpf_sock*
2214+ * result is from reuse->socks[] using the hash of the tuple.
22132215 *
2214− * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
2216+ * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags)
22152217 * Description
22162218 * Look for UDP socket matching *tuple*, optionally in a child
22172219 * network namespace *netns*. The return value must be checked,
@@ -2228,12 +2230,14 @@ union bpf_attr { · 10 unmodified lines
22282230 * **sizeof**\ (*tuple*\ **->ipv6**)
22292231 * Look for an IPv6 socket.
22302232 *
2231− * If the *netns* is zero, then the socket lookup table in the
2232− * netns associated with the *ctx* will be used. For the TC hooks,
2233− * this in the netns of the device in the skb. For socket hooks,
2234− * this in the netns of the socket. If *netns* is non-zero, then
2235− * it specifies the ID of the netns relative to the netns
2236− * associated with the *ctx*.
2233+ * If the *netns* is a negative signed 32-bit integer, then the
2234+ * socket lookup table in the netns associated with the *ctx* will
2235+ * will be used. For the TC hooks, this is the netns of the device
2236+ * in the skb. For socket hooks, this is the netns of the socket.
2237+ * If *netns* is any other signed 32-bit value greater than or
2238+ * equal to zero then it specifies the ID of the netns relative to
2239+ * the netns associated with the *ctx*. *netns* values beyond the
2240+ * range of 32-bit integers are reserved for future use.
22372241 *
22382242 * All values for *flags* are reserved for future usage, and must
22392243 * be left at zero.
@@ -2242,8 +2246,8 @@ union bpf_attr { · 2 unmodified lines
22422246 * **CONFIG_NET** configuration option.
22432247 * Return
22442248 * Pointer to *struct bpf_sock*, or NULL in case of failure.
2245− * For sockets with reuseport option, *struct bpf_sock*
2246− * return is from reuse->socks[] using hash of the packet.
2249+ * For sockets with reuseport option, the *struct bpf_sock*
2250+ * result is from reuse->socks[] using the hash of the tuple.
22472251 *
22482252 * int bpf_sk_release(struct bpf_sock *sk)
22492253 * Description
@@ -2430,6 +2434,9 @@ enum bpf_func_id { · 180 unmodified lines
24302434 /* BPF_FUNC_perf_event_output for sk_buff input context. */
24312435 #define BPF_F_CTXLEN_MASK (0xfffffULL << 32)
24322436
2437+/* Current network namespace */
2438+#define BPF_F_CURRENT_NETNS (-1L)
2439+
24332440 /* Mode for BPF_FUNC_skb_adjust_room helper. */
24342441 enum bpf_adj_room_mode {
24352442 BPF_ADJ_ROOM_NET,
@@ -2447,6 +2454,12 @@ enum bpf_lwt_encap_mode { · 11 unmodified lines
24472454 BPF_LWT_ENCAP_SEG6_INLINE
24482455 };
24492456
2457+#define __bpf_md_ptr(type, name) \
2458+union { \
2459+ type name; \
2460+ __u64 :64; \
2461+} __attribute__((aligned(8)))
2462+
24502463 /* user accessible mirror of in-kernel sk_buff.
24512464 * new fields can only be added to the end of this structure
24522465 */
@@ -2481,7 +2494,7 @@ struct __sk_buff { · 28 unmodified lines
24812494 /* ... here. */
24822495
24832496 __u32 data_meta;
2484− struct bpf_flow_keys *flow_keys;
2497+ __bpf_md_ptr(struct bpf_flow_keys *, flow_keys);
24852498 __u64 tstamp;
24862499 };
24872500
@@ -2598,8 +2611,8 @@ enum sk_action { · 110 unmodified lines
25982611 * be added to the end of this structure
25992612 */
26002613 struct sk_msg_md {
2601− void *data;
2602− void *data_end;
2614+ __bpf_md_ptr(void *, data);
2615+ __bpf_md_ptr(void *, data_end);
26032616
26042617 __u32 family;
26052618 __u32 remote_ip4; /* Stored in network byte order */
@@ -2615,8 +2628,9 @@ struct sk_reuseport_md { · 9 unmodified lines
26152628 * Start of directly accessible data. It begins from
26162629 * the tcp/udp header.
26172630 */
2618− void *data;
2619− void *data_end; /* End of directly accessible data */
2631+ __bpf_md_ptr(void *, data);
2632+ /* End of directly accessible data */
2633+ __bpf_md_ptr(void *, data_end);
26202634 /*
26212635 * Total length of packet (starting from the tcp/udp header).
26222636 * Note that the directly accessible bytes (data_end - data)
include/uapi/linux/prctl.h+1−0
@@ -212,6 +212,7 @@ struct prctl_mm_map { · 211 unmodified lines
212212 #define PR_SET_SPECULATION_CTRL 53
213213 /* Speculation control variants */
214214 # define PR_SPEC_STORE_BYPASS 0
215+# define PR_SPEC_INDIRECT_BRANCH 1
215216 /* Return and control values for PR_SET/GET_SPECULATION_CTRL */
216217 # define PR_SPEC_NOT_AFFECTED 0
217218 # define PR_SPEC_PRCTL (1UL << 0)