naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0066-uapi-update-headers-to-4.20-rc1.patch

7e752c
From 3caa0fed6aa58a8f7a05486f98572878a8ad5b30 Mon Sep 17 00:00:00 2001
7e752c
From: Andrea Claudi <aclaudi@redhat.com>
7e752c
Date: Thu, 13 Jun 2019 14:37:57 +0200
7e752c
Subject: [PATCH] uapi: update headers to 4.20-rc1
7e752c
7e752c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1716361
7e752c
Upstream Status: iproute2.git commit 39776a8665f2d
7e752c
7e752c
commit 39776a8665f2db1255ebed1f7cc992f69437bc36
7e752c
Author: Stephen Hemminger <stephen@networkplumber.org>
7e752c
Date:   Mon Nov 5 08:37:41 2018 -0800
7e752c
7e752c
    uapi: update headers to 4.20-rc1
7e752c
7e752c
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
7e752c
---
7e752c
 include/uapi/linux/bpf.h     | 142 ++++++++++++++++++++++++++++++++++-
7e752c
 include/uapi/linux/elf-em.h  |   1 +
7e752c
 include/uapi/linux/if_link.h |   1 +
7e752c
 include/uapi/linux/magic.h   |   1 +
7e752c
 include/uapi/linux/netlink.h |   1 +
7e752c
 include/uapi/linux/sctp.h    |   1 +
7e752c
 6 files changed, 145 insertions(+), 2 deletions(-)
7e752c
7e752c
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
7e752c
index abb7f7748c2de..2bbe33db8aefa 100644
7e752c
--- a/include/uapi/linux/bpf.h
7e752c
+++ b/include/uapi/linux/bpf.h
7e752c
@@ -103,6 +103,7 @@ enum bpf_cmd {
7e752c
 	BPF_BTF_LOAD,
7e752c
 	BPF_BTF_GET_FD_BY_ID,
7e752c
 	BPF_TASK_FD_QUERY,
7e752c
+	BPF_MAP_LOOKUP_AND_DELETE_ELEM,
7e752c
 };
7e752c
 
7e752c
 enum bpf_map_type {
7e752c
@@ -127,6 +128,9 @@ enum bpf_map_type {
7e752c
 	BPF_MAP_TYPE_SOCKHASH,
7e752c
 	BPF_MAP_TYPE_CGROUP_STORAGE,
7e752c
 	BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
7e752c
+	BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
7e752c
+	BPF_MAP_TYPE_QUEUE,
7e752c
+	BPF_MAP_TYPE_STACK,
7e752c
 };
7e752c
 
7e752c
 enum bpf_prog_type {
7e752c
@@ -461,6 +465,28 @@ union bpf_attr {
7e752c
  * 	Return
7e752c
  * 		0 on success, or a negative error in case of failure.
7e752c
  *
7e752c
+ * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
7e752c
+ * 	Description
7e752c
+ * 		Push an element *value* in *map*. *flags* is one of:
7e752c
+ *
7e752c
+ * 		**BPF_EXIST**
7e752c
+ * 		If the queue/stack is full, the oldest element is removed to
7e752c
+ * 		make room for this.
7e752c
+ * 	Return
7e752c
+ * 		0 on success, or a negative error in case of failure.
7e752c
+ *
7e752c
+ * int bpf_map_pop_elem(struct bpf_map *map, void *value)
7e752c
+ * 	Description
7e752c
+ * 		Pop an element from *map*.
7e752c
+ * Return
7e752c
+ * 		0 on success, or a negative error in case of failure.
7e752c
+ *
7e752c
+ * int bpf_map_peek_elem(struct bpf_map *map, void *value)
7e752c
+ * 	Description
7e752c
+ * 		Get an element from *map* without removing it.
7e752c
+ * Return
7e752c
+ * 		0 on success, or a negative error in case of failure.
7e752c
+ *
7e752c
  * int bpf_probe_read(void *dst, u32 size, const void *src)
7e752c
  * 	Description
7e752c
  * 		For tracing programs, safely attempt to read *size* bytes from
7e752c
@@ -1432,7 +1458,7 @@ union bpf_attr {
7e752c
  * 	Return
7e752c
  * 		0 on success, or a negative error in case of failure.
7e752c
  *
7e752c
- * int bpf_skb_adjust_room(struct sk_buff *skb, u32 len_diff, u32 mode, u64 flags)
7e752c
+ * int bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags)
7e752c
  * 	Description
7e752c
  * 		Grow or shrink the room for data in the packet associated to
7e752c
  * 		*skb* by *len_diff*, and according to the selected *mode*.
7e752c
@@ -2143,6 +2169,94 @@ union bpf_attr {
7e752c
  *		request in the skb.
7e752c
  *	Return
7e752c
  *		0 on success, or a negative error in case of failure.
7e752c
+ *
7e752c
+ * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
7e752c
+ *	Description
7e752c
+ *		Look for TCP socket matching *tuple*, optionally in a child
7e752c
+ *		network namespace *netns*. The return value must be checked,
7e752c
+ *		and if non-NULL, released via **bpf_sk_release**\ ().
7e752c
+ *
7e752c
+ *		The *ctx* should point to the context of the program, such as
7e752c
+ *		the skb or socket (depending on the hook in use). This is used
7e752c
+ *		to determine the base network namespace for the lookup.
7e752c
+ *
7e752c
+ *		*tuple_size* must be one of:
7e752c
+ *
7e752c
+ *		**sizeof**\ (*tuple*\ **->ipv4**)
7e752c
+ *			Look for an IPv4 socket.
7e752c
+ *		**sizeof**\ (*tuple*\ **->ipv6**)
7e752c
+ *			Look for an IPv6 socket.
7e752c
+ *
7e752c
+ *		If the *netns* is zero, then the socket lookup table in the
7e752c
+ *		netns associated with the *ctx* will be used. For the TC hooks,
7e752c
+ *		this in the netns of the device in the skb. For socket hooks,
7e752c
+ *		this in the netns of the socket. If *netns* is non-zero, then
7e752c
+ *		it specifies the ID of the netns relative to the netns
7e752c
+ *		associated with the *ctx*.
7e752c
+ *
7e752c
+ *		All values for *flags* are reserved for future usage, and must
7e752c
+ *		be left at zero.
7e752c
+ *
7e752c
+ *		This helper is available only if the kernel was compiled with
7e752c
+ *		**CONFIG_NET** configuration option.
7e752c
+ *	Return
7e752c
+ *		Pointer to *struct bpf_sock*, or NULL in case of failure.
7e752c
+ *
7e752c
+ * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
7e752c
+ *	Description
7e752c
+ *		Look for UDP socket matching *tuple*, optionally in a child
7e752c
+ *		network namespace *netns*. The return value must be checked,
7e752c
+ *		and if non-NULL, released via **bpf_sk_release**\ ().
7e752c
+ *
7e752c
+ *		The *ctx* should point to the context of the program, such as
7e752c
+ *		the skb or socket (depending on the hook in use). This is used
7e752c
+ *		to determine the base network namespace for the lookup.
7e752c
+ *
7e752c
+ *		*tuple_size* must be one of:
7e752c
+ *
7e752c
+ *		**sizeof**\ (*tuple*\ **->ipv4**)
7e752c
+ *			Look for an IPv4 socket.
7e752c
+ *		**sizeof**\ (*tuple*\ **->ipv6**)
7e752c
+ *			Look for an IPv6 socket.
7e752c
+ *
7e752c
+ *		If the *netns* is zero, then the socket lookup table in the
7e752c
+ *		netns associated with the *ctx* will be used. For the TC hooks,
7e752c
+ *		this in the netns of the device in the skb. For socket hooks,
7e752c
+ *		this in the netns of the socket. If *netns* is non-zero, then
7e752c
+ *		it specifies the ID of the netns relative to the netns
7e752c
+ *		associated with the *ctx*.
7e752c
+ *
7e752c
+ *		All values for *flags* are reserved for future usage, and must
7e752c
+ *		be left at zero.
7e752c
+ *
7e752c
+ *		This helper is available only if the kernel was compiled with
7e752c
+ *		**CONFIG_NET** configuration option.
7e752c
+ *	Return
7e752c
+ *		Pointer to *struct bpf_sock*, or NULL in case of failure.
7e752c
+ *
7e752c
+ * int bpf_sk_release(struct bpf_sock *sk)
7e752c
+ *	Description
7e752c
+ *		Release the reference held by *sock*. *sock* must be a non-NULL
7e752c
+ *		pointer that was returned from bpf_sk_lookup_xxx\ ().
7e752c
+ *	Return
7e752c
+ *		0 on success, or a negative error in case of failure.
7e752c
+ *
7e752c
+ * int bpf_msg_push_data(struct sk_buff *skb, u32 start, u32 len, u64 flags)
7e752c
+ *	Description
7e752c
+ *		For socket policies, insert *len* bytes into msg at offset
7e752c
+ *		*start*.
7e752c
+ *
7e752c
+ *		If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a
7e752c
+ *		*msg* it may want to insert metadata or options into the msg.
7e752c
+ *		This can later be read and used by any of the lower layer BPF
7e752c
+ *		hooks.
7e752c
+ *
7e752c
+ *		This helper may fail if under memory pressure (a malloc
7e752c
+ *		fails) in these cases BPF programs will get an appropriate
7e752c
+ *		error and BPF programs will need to handle them.
7e752c
+ *
7e752c
+ *	Return
7e752c
+ *		0 on success, or a negative error in case of failure.
7e752c
  */
7e752c
 #define __BPF_FUNC_MAPPER(FN)		\
7e752c
 	FN(unspec),			\
7e752c
@@ -2228,7 +2342,14 @@ union bpf_attr {
7e752c
 	FN(get_current_cgroup_id),	\
7e752c
 	FN(get_local_storage),		\
7e752c
 	FN(sk_select_reuseport),	\
7e752c
-	FN(skb_ancestor_cgroup_id),
7e752c
+	FN(skb_ancestor_cgroup_id),	\
7e752c
+	FN(sk_lookup_tcp),		\
7e752c
+	FN(sk_lookup_udp),		\
7e752c
+	FN(sk_release),			\
7e752c
+	FN(map_push_elem),		\
7e752c
+	FN(map_pop_elem),		\
7e752c
+	FN(map_peek_elem),		\
7e752c
+	FN(msg_push_data),
7e752c
 
7e752c
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
7e752c
  * function eBPF program intends to call
7e752c
@@ -2398,6 +2519,23 @@ struct bpf_sock {
7e752c
 				 */
7e752c
 };
7e752c
 
7e752c
+struct bpf_sock_tuple {
7e752c
+	union {
7e752c
+		struct {
7e752c
+			__be32 saddr;
7e752c
+			__be32 daddr;
7e752c
+			__be16 sport;
7e752c
+			__be16 dport;
7e752c
+		} ipv4;
7e752c
+		struct {
7e752c
+			__be32 saddr[4];
7e752c
+			__be32 daddr[4];
7e752c
+			__be16 sport;
7e752c
+			__be16 dport;
7e752c
+		} ipv6;
7e752c
+	};
7e752c
+};
7e752c
+
7e752c
 #define XDP_PACKET_HEADROOM 256
7e752c
 
7e752c
 /* User return codes for XDP prog type.
7e752c
diff --git a/include/uapi/linux/elf-em.h b/include/uapi/linux/elf-em.h
7e752c
index 31aa101783351..93722e60204c6 100644
7e752c
--- a/include/uapi/linux/elf-em.h
7e752c
+++ b/include/uapi/linux/elf-em.h
7e752c
@@ -41,6 +41,7 @@
7e752c
 #define EM_TILEPRO	188	/* Tilera TILEPro */
7e752c
 #define EM_MICROBLAZE	189	/* Xilinx MicroBlaze */
7e752c
 #define EM_TILEGX	191	/* Tilera TILE-Gx */
7e752c
+#define EM_RISCV	243	/* RISC-V */
7e752c
 #define EM_BPF		247	/* Linux BPF - in-kernel virtual machine */
7e752c
 #define EM_FRV		0x5441	/* Fujitsu FR-V */
7e752c
 
7e752c
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
7e752c
index 9c254603ebdad..52e95197e0790 100644
7e752c
--- a/include/uapi/linux/if_link.h
7e752c
+++ b/include/uapi/linux/if_link.h
7e752c
@@ -285,6 +285,7 @@ enum {
7e752c
 	IFLA_BR_MCAST_STATS_ENABLED,
7e752c
 	IFLA_BR_MCAST_IGMP_VERSION,
7e752c
 	IFLA_BR_MCAST_MLD_VERSION,
7e752c
+	IFLA_BR_VLAN_STATS_PER_PORT,
7e752c
 	__IFLA_BR_MAX,
7e752c
 };
7e752c
 
7e752c
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
7e752c
index 1a6fee974116a..96c24478d8ced 100644
7e752c
--- a/include/uapi/linux/magic.h
7e752c
+++ b/include/uapi/linux/magic.h
7e752c
@@ -29,6 +29,7 @@
7e752c
 #define HPFS_SUPER_MAGIC	0xf995e849
7e752c
 #define ISOFS_SUPER_MAGIC	0x9660
7e752c
 #define JFFS2_SUPER_MAGIC	0x72b6
7e752c
+#define XFS_SUPER_MAGIC		0x58465342	/* "XFSB" */
7e752c
 #define PSTOREFS_MAGIC		0x6165676C
7e752c
 #define EFIVARFS_MAGIC		0xde5e81e4
7e752c
 #define HOSTFS_SUPER_MAGIC	0x00c0ffee
7e752c
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h
7e752c
index 0b2c29bd081fa..2966171b9b95c 100644
7e752c
--- a/include/uapi/linux/netlink.h
7e752c
+++ b/include/uapi/linux/netlink.h
7e752c
@@ -153,6 +153,7 @@ enum nlmsgerr_attrs {
7e752c
 #define NETLINK_LIST_MEMBERSHIPS	9
7e752c
 #define NETLINK_CAP_ACK			10
7e752c
 #define NETLINK_EXT_ACK			11
7e752c
+#define NETLINK_DUMP_STRICT_CHK		12
7e752c
 
7e752c
 struct nl_pktinfo {
7e752c
 	__u32	group;
7e752c
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
7e752c
index dd164d7f4f41a..626480b68fb59 100644
7e752c
--- a/include/uapi/linux/sctp.h
7e752c
+++ b/include/uapi/linux/sctp.h
7e752c
@@ -301,6 +301,7 @@ enum sctp_sinfo_flags {
7e752c
 	SCTP_SACK_IMMEDIATELY	= (1 << 3), /* SACK should be sent without delay. */
7e752c
 	/* 2 bits here have been used by SCTP_PR_SCTP_MASK */
7e752c
 	SCTP_SENDALL		= (1 << 6),
7e752c
+	SCTP_PR_SCTP_ALL	= (1 << 7),
7e752c
 	SCTP_NOTIFICATION	= MSG_NOTIFICATION, /* Next message is not user msg but notification. */
7e752c
 	SCTP_EOF		= MSG_FIN,  /* Initiate graceful shutdown process. */
7e752c
 };
7e752c
-- 
7e752c
2.20.1
7e752c