Blame SOURCES/0004-Update-kernel-headers.patch

74a1de
From 2e5b8fd1e0e8fc4135bd6a162f32df5e624262b1 Mon Sep 17 00:00:00 2001
74a1de
Message-Id: <2e5b8fd1e0e8fc4135bd6a162f32df5e624262b1.1628790091.git.aclaudi@redhat.com>
74a1de
In-Reply-To: <650694eb0120722499207078f965442ef7343bb1.1628790091.git.aclaudi@redhat.com>
74a1de
References: <650694eb0120722499207078f965442ef7343bb1.1628790091.git.aclaudi@redhat.com>
74a1de
From: Andrea Claudi <aclaudi@redhat.com>
74a1de
Date: Wed, 11 Aug 2021 12:55:14 +0200
74a1de
Subject: [PATCH] Update kernel headers
74a1de
74a1de
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1981393
74a1de
Upstream Status: iproute2.git commit a5b355c0
74a1de
74a1de
commit a5b355c08c62fb5b3a42d0e27ef05571c7b30e2e
74a1de
Author: David Ahern <dsahern@kernel.org>
74a1de
Date:   Fri Mar 19 14:59:17 2021 +0000
74a1de
74a1de
    Update kernel headers
74a1de
74a1de
    Update kernel headers to commit:
74a1de
        38cb57602369 ("selftests: net: forwarding: Fix a typo")
74a1de
74a1de
    Signed-off-by: David Ahern <dsahern@kernel.org>
74a1de
74a1de
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
74a1de
---
74a1de
 include/uapi/linux/bpf.h       | 764 ++++++++++++++++++++++++++++++++-
74a1de
 include/uapi/linux/btf.h       |   5 +-
74a1de
 include/uapi/linux/nexthop.h   |  47 +-
74a1de
 include/uapi/linux/pkt_cls.h   |   2 +
74a1de
 include/uapi/linux/rtnetlink.h |   7 +
74a1de
 5 files changed, 818 insertions(+), 7 deletions(-)
74a1de
74a1de
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
74a1de
index b1aba6af..502934f7 100644
74a1de
--- a/include/uapi/linux/bpf.h
74a1de
+++ b/include/uapi/linux/bpf.h
74a1de
@@ -93,7 +93,717 @@ union bpf_iter_link_info {
74a1de
 	} map;
74a1de
 };
74a1de
 
74a1de
-/* BPF syscall commands, see bpf(2) man-page for details. */
74a1de
+/* BPF syscall commands, see bpf(2) man-page for more details. */
74a1de
+/**
74a1de
+ * DOC: eBPF Syscall Preamble
74a1de
+ *
74a1de
+ * The operation to be performed by the **bpf**\ () system call is determined
74a1de
+ * by the *cmd* argument. Each operation takes an accompanying argument,
74a1de
+ * provided via *attr*, which is a pointer to a union of type *bpf_attr* (see
74a1de
+ * below). The size argument is the size of the union pointed to by *attr*.
74a1de
+ */
74a1de
+/**
74a1de
+ * DOC: eBPF Syscall Commands
74a1de
+ *
74a1de
+ * BPF_MAP_CREATE
74a1de
+ *	Description
74a1de
+ *		Create a map and return a file descriptor that refers to the
74a1de
+ *		map. The close-on-exec file descriptor flag (see **fcntl**\ (2))
74a1de
+ *		is automatically enabled for the new file descriptor.
74a1de
+ *
74a1de
+ *		Applying **close**\ (2) to the file descriptor returned by
74a1de
+ *		**BPF_MAP_CREATE** will delete the map (but see NOTES).
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_MAP_LOOKUP_ELEM
74a1de
+ *	Description
74a1de
+ *		Look up an element with a given *key* in the map referred to
74a1de
+ *		by the file descriptor *map_fd*.
74a1de
+ *
74a1de
+ *		The *flags* argument may be specified as one of the
74a1de
+ *		following:
74a1de
+ *
74a1de
+ *		**BPF_F_LOCK**
74a1de
+ *			Look up the value of a spin-locked map without
74a1de
+ *			returning the lock. This must be specified if the
74a1de
+ *			elements contain a spinlock.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_UPDATE_ELEM
74a1de
+ *	Description
74a1de
+ *		Create or update an element (key/value pair) in a specified map.
74a1de
+ *
74a1de
+ *		The *flags* argument should be specified as one of the
74a1de
+ *		following:
74a1de
+ *
74a1de
+ *		**BPF_ANY**
74a1de
+ *			Create a new element or update an existing element.
74a1de
+ *		**BPF_NOEXIST**
74a1de
+ *			Create a new element only if it did not exist.
74a1de
+ *		**BPF_EXIST**
74a1de
+ *			Update an existing element.
74a1de
+ *		**BPF_F_LOCK**
74a1de
+ *			Update a spin_lock-ed map element.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ *		May set *errno* to **EINVAL**, **EPERM**, **ENOMEM**,
74a1de
+ *		**E2BIG**, **EEXIST**, or **ENOENT**.
74a1de
+ *
74a1de
+ *		**E2BIG**
74a1de
+ *			The number of elements in the map reached the
74a1de
+ *			*max_entries* limit specified at map creation time.
74a1de
+ *		**EEXIST**
74a1de
+ *			If *flags* specifies **BPF_NOEXIST** and the element
74a1de
+ *			with *key* already exists in the map.
74a1de
+ *		**ENOENT**
74a1de
+ *			If *flags* specifies **BPF_EXIST** and the element with
74a1de
+ *			*key* does not exist in the map.
74a1de
+ *
74a1de
+ * BPF_MAP_DELETE_ELEM
74a1de
+ *	Description
74a1de
+ *		Look up and delete an element by key in a specified map.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_GET_NEXT_KEY
74a1de
+ *	Description
74a1de
+ *		Look up an element by key in a specified map and return the key
74a1de
+ *		of the next element. Can be used to iterate over all elements
74a1de
+ *		in the map.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ *		The following cases can be used to iterate over all elements of
74a1de
+ *		the map:
74a1de
+ *
74a1de
+ *		* If *key* is not found, the operation returns zero and sets
74a1de
+ *		  the *next_key* pointer to the key of the first element.
74a1de
+ *		* If *key* is found, the operation returns zero and sets the
74a1de
+ *		  *next_key* pointer to the key of the next element.
74a1de
+ *		* If *key* is the last element, returns -1 and *errno* is set
74a1de
+ *		  to **ENOENT**.
74a1de
+ *
74a1de
+ *		May set *errno* to **ENOMEM**, **EFAULT**, **EPERM**, or
74a1de
+ *		**EINVAL** on error.
74a1de
+ *
74a1de
+ * BPF_PROG_LOAD
74a1de
+ *	Description
74a1de
+ *		Verify and load an eBPF program, returning a new file
74a1de
+ *		descriptor associated with the program.
74a1de
+ *
74a1de
+ *		Applying **close**\ (2) to the file descriptor returned by
74a1de
+ *		**BPF_PROG_LOAD** will unload the eBPF program (but see NOTES).
74a1de
+ *
74a1de
+ *		The close-on-exec file descriptor flag (see **fcntl**\ (2)) is
74a1de
+ *		automatically enabled for the new file descriptor.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_OBJ_PIN
74a1de
+ *	Description
74a1de
+ *		Pin an eBPF program or map referred by the specified *bpf_fd*
74a1de
+ *		to the provided *pathname* on the filesystem.
74a1de
+ *
74a1de
+ *		The *pathname* argument must not contain a dot (".").
74a1de
+ *
74a1de
+ *		On success, *pathname* retains a reference to the eBPF object,
74a1de
+ *		preventing deallocation of the object when the original
74a1de
+ *		*bpf_fd* is closed. This allow the eBPF object to live beyond
74a1de
+ *		**close**\ (\ *bpf_fd*\ ), and hence the lifetime of the parent
74a1de
+ *		process.
74a1de
+ *
74a1de
+ *		Applying **unlink**\ (2) or similar calls to the *pathname*
74a1de
+ *		unpins the object from the filesystem, removing the reference.
74a1de
+ *		If no other file descriptors or filesystem nodes refer to the
74a1de
+ *		same object, it will be deallocated (see NOTES).
74a1de
+ *
74a1de
+ *		The filesystem type for the parent directory of *pathname* must
74a1de
+ *		be **BPF_FS_MAGIC**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_OBJ_GET
74a1de
+ *	Description
74a1de
+ *		Open a file descriptor for the eBPF object pinned to the
74a1de
+ *		specified *pathname*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_PROG_ATTACH
74a1de
+ *	Description
74a1de
+ *		Attach an eBPF program to a *target_fd* at the specified
74a1de
+ *		*attach_type* hook.
74a1de
+ *
74a1de
+ *		The *attach_type* specifies the eBPF attachment point to
74a1de
+ *		attach the program to, and must be one of *bpf_attach_type*
74a1de
+ *		(see below).
74a1de
+ *
74a1de
+ *		The *attach_bpf_fd* must be a valid file descriptor for a
74a1de
+ *		loaded eBPF program of a cgroup, flow dissector, LIRC, sockmap
74a1de
+ *		or sock_ops type corresponding to the specified *attach_type*.
74a1de
+ *
74a1de
+ *		The *target_fd* must be a valid file descriptor for a kernel
74a1de
+ *		object which depends on the attach type of *attach_bpf_fd*:
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_DEVICE**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SKB**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SOCK**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SOCKOPT**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SYSCTL**,
74a1de
+ *		**BPF_PROG_TYPE_SOCK_OPS**
74a1de
+ *
74a1de
+ *			Control Group v2 hierarchy with the eBPF controller
74a1de
+ *			enabled. Requires the kernel to be compiled with
74a1de
+ *			**CONFIG_CGROUP_BPF**.
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_FLOW_DISSECTOR**
74a1de
+ *
74a1de
+ *			Network namespace (eg /proc/self/ns/net).
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_LIRC_MODE2**
74a1de
+ *
74a1de
+ *			LIRC device path (eg /dev/lircN). Requires the kernel
74a1de
+ *			to be compiled with **CONFIG_BPF_LIRC_MODE2**.
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_SK_SKB**,
74a1de
+ *		**BPF_PROG_TYPE_SK_MSG**
74a1de
+ *
74a1de
+ *			eBPF map of socket type (eg **BPF_MAP_TYPE_SOCKHASH**).
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_PROG_DETACH
74a1de
+ *	Description
74a1de
+ *		Detach the eBPF program associated with the *target_fd* at the
74a1de
+ *		hook specified by *attach_type*. The program must have been
74a1de
+ *		previously attached using **BPF_PROG_ATTACH**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_PROG_TEST_RUN
74a1de
+ *	Description
74a1de
+ *		Run the eBPF program associated with the *prog_fd* a *repeat*
74a1de
+ *		number of times against a provided program context *ctx_in* and
74a1de
+ *		data *data_in*, and return the modified program context
74a1de
+ *		*ctx_out*, *data_out* (for example, packet data), result of the
74a1de
+ *		execution *retval*, and *duration* of the test run.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ *		**ENOSPC**
74a1de
+ *			Either *data_size_out* or *ctx_size_out* is too small.
74a1de
+ *		**ENOTSUPP**
74a1de
+ *			This command is not supported by the program type of
74a1de
+ *			the program referred to by *prog_fd*.
74a1de
+ *
74a1de
+ * BPF_PROG_GET_NEXT_ID
74a1de
+ *	Description
74a1de
+ *		Fetch the next eBPF program currently loaded into the kernel.
74a1de
+ *
74a1de
+ *		Looks for the eBPF program with an id greater than *start_id*
74a1de
+ *		and updates *next_id* on success. If no other eBPF programs
74a1de
+ *		remain with ids higher than *start_id*, returns -1 and sets
74a1de
+ *		*errno* to **ENOENT**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, or when no id remains, -1
74a1de
+ *		is returned and *errno* is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_GET_NEXT_ID
74a1de
+ *	Description
74a1de
+ *		Fetch the next eBPF map currently loaded into the kernel.
74a1de
+ *
74a1de
+ *		Looks for the eBPF map with an id greater than *start_id*
74a1de
+ *		and updates *next_id* on success. If no other eBPF maps
74a1de
+ *		remain with ids higher than *start_id*, returns -1 and sets
74a1de
+ *		*errno* to **ENOENT**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, or when no id remains, -1
74a1de
+ *		is returned and *errno* is set appropriately.
74a1de
+ *
74a1de
+ * BPF_PROG_GET_FD_BY_ID
74a1de
+ *	Description
74a1de
+ *		Open a file descriptor for the eBPF program corresponding to
74a1de
+ *		*prog_id*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_MAP_GET_FD_BY_ID
74a1de
+ *	Description
74a1de
+ *		Open a file descriptor for the eBPF map corresponding to
74a1de
+ *		*map_id*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_OBJ_GET_INFO_BY_FD
74a1de
+ *	Description
74a1de
+ *		Obtain information about the eBPF object corresponding to
74a1de
+ *		*bpf_fd*.
74a1de
+ *
74a1de
+ *		Populates up to *info_len* bytes of *info*, which will be in
74a1de
+ *		one of the following formats depending on the eBPF object type
74a1de
+ *		of *bpf_fd*:
74a1de
+ *
74a1de
+ *		* **struct bpf_prog_info**
74a1de
+ *		* **struct bpf_map_info**
74a1de
+ *		* **struct bpf_btf_info**
74a1de
+ *		* **struct bpf_link_info**
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_PROG_QUERY
74a1de
+ *	Description
74a1de
+ *		Obtain information about eBPF programs associated with the
74a1de
+ *		specified *attach_type* hook.
74a1de
+ *
74a1de
+ *		The *target_fd* must be a valid file descriptor for a kernel
74a1de
+ *		object which depends on the attach type of *attach_bpf_fd*:
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_DEVICE**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SKB**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SOCK**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SOCKOPT**,
74a1de
+ *		**BPF_PROG_TYPE_CGROUP_SYSCTL**,
74a1de
+ *		**BPF_PROG_TYPE_SOCK_OPS**
74a1de
+ *
74a1de
+ *			Control Group v2 hierarchy with the eBPF controller
74a1de
+ *			enabled. Requires the kernel to be compiled with
74a1de
+ *			**CONFIG_CGROUP_BPF**.
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_FLOW_DISSECTOR**
74a1de
+ *
74a1de
+ *			Network namespace (eg /proc/self/ns/net).
74a1de
+ *
74a1de
+ *		**BPF_PROG_TYPE_LIRC_MODE2**
74a1de
+ *
74a1de
+ *			LIRC device path (eg /dev/lircN). Requires the kernel
74a1de
+ *			to be compiled with **CONFIG_BPF_LIRC_MODE2**.
74a1de
+ *
74a1de
+ *		**BPF_PROG_QUERY** always fetches the number of programs
74a1de
+ *		attached and the *attach_flags* which were used to attach those
74a1de
+ *		programs. Additionally, if *prog_ids* is nonzero and the number
74a1de
+ *		of attached programs is less than *prog_cnt*, populates
74a1de
+ *		*prog_ids* with the eBPF program ids of the programs attached
74a1de
+ *		at *target_fd*.
74a1de
+ *
74a1de
+ *		The following flags may alter the result:
74a1de
+ *
74a1de
+ *		**BPF_F_QUERY_EFFECTIVE**
74a1de
+ *			Only return information regarding programs which are
74a1de
+ *			currently effective at the specified *target_fd*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_RAW_TRACEPOINT_OPEN
74a1de
+ *	Description
74a1de
+ *		Attach an eBPF program to a tracepoint *name* to access kernel
74a1de
+ *		internal arguments of the tracepoint in their raw form.
74a1de
+ *
74a1de
+ *		The *prog_fd* must be a valid file descriptor associated with
74a1de
+ *		a loaded eBPF program of type **BPF_PROG_TYPE_RAW_TRACEPOINT**.
74a1de
+ *
74a1de
+ *		No ABI guarantees are made about the content of tracepoint
74a1de
+ *		arguments exposed to the corresponding eBPF program.
74a1de
+ *
74a1de
+ *		Applying **close**\ (2) to the file descriptor returned by
74a1de
+ *		**BPF_RAW_TRACEPOINT_OPEN** will delete the map (but see NOTES).
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_BTF_LOAD
74a1de
+ *	Description
74a1de
+ *		Verify and load BPF Type Format (BTF) metadata into the kernel,
74a1de
+ *		returning a new file descriptor associated with the metadata.
74a1de
+ *		BTF is described in more detail at
74a1de
+ *		https://www.kernel.org/doc/html/latest/bpf/btf.html.
74a1de
+ *
74a1de
+ *		The *btf* parameter must point to valid memory providing
74a1de
+ *		*btf_size* bytes of BTF binary metadata.
74a1de
+ *
74a1de
+ *		The returned file descriptor can be passed to other **bpf**\ ()
74a1de
+ *		subcommands such as **BPF_PROG_LOAD** or **BPF_MAP_CREATE** to
74a1de
+ *		associate the BTF with those objects.
74a1de
+ *
74a1de
+ *		Similar to **BPF_PROG_LOAD**, **BPF_BTF_LOAD** has optional
74a1de
+ *		parameters to specify a *btf_log_buf*, *btf_log_size* and
74a1de
+ *		*btf_log_level* which allow the kernel to return freeform log
74a1de
+ *		output regarding the BTF verification process.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_BTF_GET_FD_BY_ID
74a1de
+ *	Description
74a1de
+ *		Open a file descriptor for the BPF Type Format (BTF)
74a1de
+ *		corresponding to *btf_id*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_TASK_FD_QUERY
74a1de
+ *	Description
74a1de
+ *		Obtain information about eBPF programs associated with the
74a1de
+ *		target process identified by *pid* and *fd*.
74a1de
+ *
74a1de
+ *		If the *pid* and *fd* are associated with a tracepoint, kprobe
74a1de
+ *		or uprobe perf event, then the *prog_id* and *fd_type* will
74a1de
+ *		be populated with the eBPF program id and file descriptor type
74a1de
+ *		of type **bpf_task_fd_type**. If associated with a kprobe or
74a1de
+ *		uprobe, the  *probe_offset* and *probe_addr* will also be
74a1de
+ *		populated. Optionally, if *buf* is provided, then up to
74a1de
+ *		*buf_len* bytes of *buf* will be populated with the name of
74a1de
+ *		the tracepoint, kprobe or uprobe.
74a1de
+ *
74a1de
+ *		The resulting *prog_id* may be introspected in deeper detail
74a1de
+ *		using **BPF_PROG_GET_FD_BY_ID** and **BPF_OBJ_GET_INFO_BY_FD**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_LOOKUP_AND_DELETE_ELEM
74a1de
+ *	Description
74a1de
+ *		Look up an element with the given *key* in the map referred to
74a1de
+ *		by the file descriptor *fd*, and if found, delete the element.
74a1de
+ *
74a1de
+ *		The **BPF_MAP_TYPE_QUEUE** and **BPF_MAP_TYPE_STACK** map types
74a1de
+ *		implement this command as a "pop" operation, deleting the top
74a1de
+ *		element rather than one corresponding to *key*.
74a1de
+ *		The *key* and *key_len* parameters should be zeroed when
74a1de
+ *		issuing this operation for these map types.
74a1de
+ *
74a1de
+ *		This command is only valid for the following map types:
74a1de
+ *		* **BPF_MAP_TYPE_QUEUE**
74a1de
+ *		* **BPF_MAP_TYPE_STACK**
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_FREEZE
74a1de
+ *	Description
74a1de
+ *		Freeze the permissions of the specified map.
74a1de
+ *
74a1de
+ *		Write permissions may be frozen by passing zero *flags*.
74a1de
+ *		Upon success, no future syscall invocations may alter the
74a1de
+ *		map state of *map_fd*. Write operations from eBPF programs
74a1de
+ *		are still possible for a frozen map.
74a1de
+ *
74a1de
+ *		Not supported for maps of type **BPF_MAP_TYPE_STRUCT_OPS**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_BTF_GET_NEXT_ID
74a1de
+ *	Description
74a1de
+ *		Fetch the next BPF Type Format (BTF) object currently loaded
74a1de
+ *		into the kernel.
74a1de
+ *
74a1de
+ *		Looks for the BTF object with an id greater than *start_id*
74a1de
+ *		and updates *next_id* on success. If no other BTF objects
74a1de
+ *		remain with ids higher than *start_id*, returns -1 and sets
74a1de
+ *		*errno* to **ENOENT**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, or when no id remains, -1
74a1de
+ *		is returned and *errno* is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_LOOKUP_BATCH
74a1de
+ *	Description
74a1de
+ *		Iterate and fetch multiple elements in a map.
74a1de
+ *
74a1de
+ *		Two opaque values are used to manage batch operations,
74a1de
+ *		*in_batch* and *out_batch*. Initially, *in_batch* must be set
74a1de
+ *		to NULL to begin the batched operation. After each subsequent
74a1de
+ *		**BPF_MAP_LOOKUP_BATCH**, the caller should pass the resultant
74a1de
+ *		*out_batch* as the *in_batch* for the next operation to
74a1de
+ *		continue iteration from the current point.
74a1de
+ *
74a1de
+ *		The *keys* and *values* are output parameters which must point
74a1de
+ *		to memory large enough to hold *count* items based on the key
74a1de
+ *		and value size of the map *map_fd*. The *keys* buffer must be
74a1de
+ *		of *key_size* * *count*. The *values* buffer must be of
74a1de
+ *		*value_size* * *count*.
74a1de
+ *
74a1de
+ *		The *elem_flags* argument may be specified as one of the
74a1de
+ *		following:
74a1de
+ *
74a1de
+ *		**BPF_F_LOCK**
74a1de
+ *			Look up the value of a spin-locked map without
74a1de
+ *			returning the lock. This must be specified if the
74a1de
+ *			elements contain a spinlock.
74a1de
+ *
74a1de
+ *		On success, *count* elements from the map are copied into the
74a1de
+ *		user buffer, with the keys copied into *keys* and the values
74a1de
+ *		copied into the corresponding indices in *values*.
74a1de
+ *
74a1de
+ *		If an error is returned and *errno* is not **EFAULT**, *count*
74a1de
+ *		is set to the number of successfully processed elements.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ *		May set *errno* to **ENOSPC** to indicate that *keys* or
74a1de
+ *		*values* is too small to dump an entire bucket during
74a1de
+ *		iteration of a hash-based map type.
74a1de
+ *
74a1de
+ * BPF_MAP_LOOKUP_AND_DELETE_BATCH
74a1de
+ *	Description
74a1de
+ *		Iterate and delete all elements in a map.
74a1de
+ *
74a1de
+ *		This operation has the same behavior as
74a1de
+ *		**BPF_MAP_LOOKUP_BATCH** with two exceptions:
74a1de
+ *
74a1de
+ *		* Every element that is successfully returned is also deleted
74a1de
+ *		  from the map. This is at least *count* elements. Note that
74a1de
+ *		  *count* is both an input and an output parameter.
74a1de
+ *		* Upon returning with *errno* set to **EFAULT**, up to
74a1de
+ *		  *count* elements may be deleted without returning the keys
74a1de
+ *		  and values of the deleted elements.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_MAP_UPDATE_BATCH
74a1de
+ *	Description
74a1de
+ *		Update multiple elements in a map by *key*.
74a1de
+ *
74a1de
+ *		The *keys* and *values* are input parameters which must point
74a1de
+ *		to memory large enough to hold *count* items based on the key
74a1de
+ *		and value size of the map *map_fd*. The *keys* buffer must be
74a1de
+ *		of *key_size* * *count*. The *values* buffer must be of
74a1de
+ *		*value_size* * *count*.
74a1de
+ *
74a1de
+ *		Each element specified in *keys* is sequentially updated to the
74a1de
+ *		value in the corresponding index in *values*. The *in_batch*
74a1de
+ *		and *out_batch* parameters are ignored and should be zeroed.
74a1de
+ *
74a1de
+ *		The *elem_flags* argument should be specified as one of the
74a1de
+ *		following:
74a1de
+ *
74a1de
+ *		**BPF_ANY**
74a1de
+ *			Create new elements or update a existing elements.
74a1de
+ *		**BPF_NOEXIST**
74a1de
+ *			Create new elements only if they do not exist.
74a1de
+ *		**BPF_EXIST**
74a1de
+ *			Update existing elements.
74a1de
+ *		**BPF_F_LOCK**
74a1de
+ *			Update spin_lock-ed map elements. This must be
74a1de
+ *			specified if the map value contains a spinlock.
74a1de
+ *
74a1de
+ *		On success, *count* elements from the map are updated.
74a1de
+ *
74a1de
+ *		If an error is returned and *errno* is not **EFAULT**, *count*
74a1de
+ *		is set to the number of successfully processed elements.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ *		May set *errno* to **EINVAL**, **EPERM**, **ENOMEM**, or
74a1de
+ *		**E2BIG**. **E2BIG** indicates that the number of elements in
74a1de
+ *		the map reached the *max_entries* limit specified at map
74a1de
+ *		creation time.
74a1de
+ *
74a1de
+ *		May set *errno* to one of the following error codes under
74a1de
+ *		specific circumstances:
74a1de
+ *
74a1de
+ *		**EEXIST**
74a1de
+ *			If *flags* specifies **BPF_NOEXIST** and the element
74a1de
+ *			with *key* already exists in the map.
74a1de
+ *		**ENOENT**
74a1de
+ *			If *flags* specifies **BPF_EXIST** and the element with
74a1de
+ *			*key* does not exist in the map.
74a1de
+ *
74a1de
+ * BPF_MAP_DELETE_BATCH
74a1de
+ *	Description
74a1de
+ *		Delete multiple elements in a map by *key*.
74a1de
+ *
74a1de
+ *		The *keys* parameter is an input parameter which must point
74a1de
+ *		to memory large enough to hold *count* items based on the key
74a1de
+ *		size of the map *map_fd*, that is, *key_size* * *count*.
74a1de
+ *
74a1de
+ *		Each element specified in *keys* is sequentially deleted. The
74a1de
+ *		*in_batch*, *out_batch*, and *values* parameters are ignored
74a1de
+ *		and should be zeroed.
74a1de
+ *
74a1de
+ *		The *elem_flags* argument may be specified as one of the
74a1de
+ *		following:
74a1de
+ *
74a1de
+ *		**BPF_F_LOCK**
74a1de
+ *			Look up the value of a spin-locked map without
74a1de
+ *			returning the lock. This must be specified if the
74a1de
+ *			elements contain a spinlock.
74a1de
+ *
74a1de
+ *		On success, *count* elements from the map are updated.
74a1de
+ *
74a1de
+ *		If an error is returned and *errno* is not **EFAULT**, *count*
74a1de
+ *		is set to the number of successfully processed elements. If
74a1de
+ *		*errno* is **EFAULT**, up to *count* elements may be been
74a1de
+ *		deleted.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_LINK_CREATE
74a1de
+ *	Description
74a1de
+ *		Attach an eBPF program to a *target_fd* at the specified
74a1de
+ *		*attach_type* hook and return a file descriptor handle for
74a1de
+ *		managing the link.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_LINK_UPDATE
74a1de
+ *	Description
74a1de
+ *		Update the eBPF program in the specified *link_fd* to
74a1de
+ *		*new_prog_fd*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_LINK_GET_FD_BY_ID
74a1de
+ *	Description
74a1de
+ *		Open a file descriptor for the eBPF Link corresponding to
74a1de
+ *		*link_id*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_LINK_GET_NEXT_ID
74a1de
+ *	Description
74a1de
+ *		Fetch the next eBPF link currently loaded into the kernel.
74a1de
+ *
74a1de
+ *		Looks for the eBPF link with an id greater than *start_id*
74a1de
+ *		and updates *next_id* on success. If no other eBPF links
74a1de
+ *		remain with ids higher than *start_id*, returns -1 and sets
74a1de
+ *		*errno* to **ENOENT**.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, or when no id remains, -1
74a1de
+ *		is returned and *errno* is set appropriately.
74a1de
+ *
74a1de
+ * BPF_ENABLE_STATS
74a1de
+ *	Description
74a1de
+ *		Enable eBPF runtime statistics gathering.
74a1de
+ *
74a1de
+ *		Runtime statistics gathering for the eBPF runtime is disabled
74a1de
+ *		by default to minimize the corresponding performance overhead.
74a1de
+ *		This command enables statistics globally.
74a1de
+ *
74a1de
+ *		Multiple programs may independently enable statistics.
74a1de
+ *		After gathering the desired statistics, eBPF runtime statistics
74a1de
+ *		may be disabled again by calling **close**\ (2) for the file
74a1de
+ *		descriptor returned by this function. Statistics will only be
74a1de
+ *		disabled system-wide when all outstanding file descriptors
74a1de
+ *		returned by prior calls for this subcommand are closed.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_ITER_CREATE
74a1de
+ *	Description
74a1de
+ *		Create an iterator on top of the specified *link_fd* (as
74a1de
+ *		previously created using **BPF_LINK_CREATE**) and return a
74a1de
+ *		file descriptor that can be used to trigger the iteration.
74a1de
+ *
74a1de
+ *		If the resulting file descriptor is pinned to the filesystem
74a1de
+ *		using  **BPF_OBJ_PIN**, then subsequent **read**\ (2) syscalls
74a1de
+ *		for that path will trigger the iterator to read kernel state
74a1de
+ *		using the eBPF program attached to *link_fd*.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		A new file descriptor (a nonnegative integer), or -1 if an
74a1de
+ *		error occurred (in which case, *errno* is set appropriately).
74a1de
+ *
74a1de
+ * BPF_LINK_DETACH
74a1de
+ *	Description
74a1de
+ *		Forcefully detach the specified *link_fd* from its
74a1de
+ *		corresponding attachment point.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * BPF_PROG_BIND_MAP
74a1de
+ *	Description
74a1de
+ *		Bind a map to the lifetime of an eBPF program.
74a1de
+ *
74a1de
+ *		The map identified by *map_fd* is bound to the program
74a1de
+ *		identified by *prog_fd* and only released when *prog_fd* is
74a1de
+ *		released. This may be used in cases where metadata should be
74a1de
+ *		associated with a program which otherwise does not contain any
74a1de
+ *		references to the map (for example, embedded in the eBPF
74a1de
+ *		program instructions).
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		Returns zero on success. On error, -1 is returned and *errno*
74a1de
+ *		is set appropriately.
74a1de
+ *
74a1de
+ * NOTES
74a1de
+ *	eBPF objects (maps and programs) can be shared between processes.
74a1de
+ *
74a1de
+ *	* After **fork**\ (2), the child inherits file descriptors
74a1de
+ *	  referring to the same eBPF objects.
74a1de
+ *	* File descriptors referring to eBPF objects can be transferred over
74a1de
+ *	  **unix**\ (7) domain sockets.
74a1de
+ *	* File descriptors referring to eBPF objects can be duplicated in the
74a1de
+ *	  usual way, using **dup**\ (2) and similar calls.
74a1de
+ *	* File descriptors referring to eBPF objects can be pinned to the
74a1de
+ *	  filesystem using the **BPF_OBJ_PIN** command of **bpf**\ (2).
74a1de
+ *
74a1de
+ *	An eBPF object is deallocated only after all file descriptors referring
74a1de
+ *	to the object have been closed and no references remain pinned to the
74a1de
+ *	filesystem or attached (for example, bound to a program or device).
74a1de
+ */
74a1de
 enum bpf_cmd {
74a1de
 	BPF_MAP_CREATE,
74a1de
 	BPF_MAP_LOOKUP_ELEM,
74a1de
@@ -393,6 +1103,15 @@ enum bpf_link_type {
74a1de
  *                   is struct/union.
74a1de
  */
74a1de
 #define BPF_PSEUDO_BTF_ID	3
74a1de
+/* insn[0].src_reg:  BPF_PSEUDO_FUNC
74a1de
+ * insn[0].imm:      insn offset to the func
74a1de
+ * insn[1].imm:      0
74a1de
+ * insn[0].off:      0
74a1de
+ * insn[1].off:      0
74a1de
+ * ldimm64 rewrite:  address of the function
74a1de
+ * verifier type:    PTR_TO_FUNC.
74a1de
+ */
74a1de
+#define BPF_PSEUDO_FUNC		4
74a1de
 
74a1de
 /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
74a1de
  * offset to another bpf function
74a1de
@@ -720,7 +1439,7 @@ union bpf_attr {
74a1de
  * parsed and used to produce a manual page. The workflow is the following,
74a1de
  * and requires the rst2man utility:
74a1de
  *
74a1de
- *     $ ./scripts/bpf_helpers_doc.py \
74a1de
+ *     $ ./scripts/bpf_doc.py \
74a1de
  *             --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst
74a1de
  *     $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7
74a1de
  *     $ man /tmp/bpf-helpers.7
74a1de
@@ -1765,6 +2484,10 @@ union bpf_attr {
74a1de
  *		  Use with ENCAP_L3/L4 flags to further specify the tunnel
74a1de
  *		  type; *len* is the length of the inner MAC header.
74a1de
  *
74a1de
+ *		* **BPF_F_ADJ_ROOM_ENCAP_L2_ETH**:
74a1de
+ *		  Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the
74a1de
+ *		  L2 type as Ethernet.
74a1de
+ *
74a1de
  * 		A call to this helper is susceptible to change the underlying
74a1de
  * 		packet buffer. Therefore, at load time, all checks on pointers
74a1de
  * 		previously done by the verifier are invalidated and must be
74a1de
@@ -3850,7 +4573,7 @@ union bpf_attr {
74a1de
  *
74a1de
  * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags)
74a1de
  *	Description
74a1de
- *		Check packet size against exceeding MTU of net device (based
74a1de
+ *		Check ctx packet size against exceeding MTU of net device (based
74a1de
  *		on *ifindex*).  This helper will likely be used in combination
74a1de
  *		with helpers that adjust/change the packet size.
74a1de
  *
74a1de
@@ -3915,6 +4638,34 @@ union bpf_attr {
74a1de
  *		* **BPF_MTU_CHK_RET_FRAG_NEEDED**
74a1de
  *		* **BPF_MTU_CHK_RET_SEGS_TOOBIG**
74a1de
  *
74a1de
+ * long bpf_for_each_map_elem(struct bpf_map *map, void *callback_fn, void *callback_ctx, u64 flags)
74a1de
+ *	Description
74a1de
+ *		For each element in **map**, call **callback_fn** function with
74a1de
+ *		**map**, **callback_ctx** and other map-specific parameters.
74a1de
+ *		The **callback_fn** should be a static function and
74a1de
+ *		the **callback_ctx** should be a pointer to the stack.
74a1de
+ *		The **flags** is used to control certain aspects of the helper.
74a1de
+ *		Currently, the **flags** must be 0.
74a1de
+ *
74a1de
+ *		The following are a list of supported map types and their
74a1de
+ *		respective expected callback signatures:
74a1de
+ *
74a1de
+ *		BPF_MAP_TYPE_HASH, BPF_MAP_TYPE_PERCPU_HASH,
74a1de
+ *		BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH,
74a1de
+ *		BPF_MAP_TYPE_ARRAY, BPF_MAP_TYPE_PERCPU_ARRAY
74a1de
+ *
74a1de
+ *		long (\*callback_fn)(struct bpf_map \*map, const void \*key, void \*value, void \*ctx);
74a1de
+ *
74a1de
+ *		For per_cpu maps, the map_value is the value on the cpu where the
74a1de
+ *		bpf_prog is running.
74a1de
+ *
74a1de
+ *		If **callback_fn** return 0, the helper will continue to the next
74a1de
+ *		element. If return value is 1, the helper will skip the rest of
74a1de
+ *		elements and return. Other return values are not used now.
74a1de
+ *
74a1de
+ *	Return
74a1de
+ *		The number of traversed map elements for success, **-EINVAL** for
74a1de
+ *		invalid **flags**.
74a1de
  */
74a1de
 #define __BPF_FUNC_MAPPER(FN)		\
74a1de
 	FN(unspec),			\
74a1de
@@ -4081,6 +4832,7 @@ union bpf_attr {
74a1de
 	FN(ima_inode_hash),		\
74a1de
 	FN(sock_from_file),		\
74a1de
 	FN(check_mtu),			\
74a1de
+	FN(for_each_map_elem),		\
74a1de
 	/* */
74a1de
 
74a1de
 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
74a1de
@@ -4174,6 +4926,7 @@ enum {
74a1de
 	BPF_F_ADJ_ROOM_ENCAP_L4_GRE	= (1ULL << 3),
74a1de
 	BPF_F_ADJ_ROOM_ENCAP_L4_UDP	= (1ULL << 4),
74a1de
 	BPF_F_ADJ_ROOM_NO_CSUM_RESET	= (1ULL << 5),
74a1de
+	BPF_F_ADJ_ROOM_ENCAP_L2_ETH	= (1ULL << 6),
74a1de
 };
74a1de
 
74a1de
 enum {
74a1de
@@ -5211,7 +5964,10 @@ struct bpf_pidns_info {
74a1de
 
74a1de
 /* User accessible data for SK_LOOKUP programs. Add new fields at the end. */
74a1de
 struct bpf_sk_lookup {
74a1de
-	__bpf_md_ptr(struct bpf_sock *, sk); /* Selected socket */
74a1de
+	union {
74a1de
+		__bpf_md_ptr(struct bpf_sock *, sk); /* Selected socket */
74a1de
+		__u64 cookie; /* Non-zero if socket was selected in PROG_TEST_RUN */
74a1de
+	};
74a1de
 
74a1de
 	__u32 family;		/* Protocol family (AF_INET, AF_INET6) */
74a1de
 	__u32 protocol;		/* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */
74a1de
diff --git a/include/uapi/linux/btf.h b/include/uapi/linux/btf.h
74a1de
index 4a42eb48..2c42dcac 100644
74a1de
--- a/include/uapi/linux/btf.h
74a1de
+++ b/include/uapi/linux/btf.h
74a1de
@@ -52,7 +52,7 @@ struct btf_type {
74a1de
 	};
74a1de
 };
74a1de
 
74a1de
-#define BTF_INFO_KIND(info)	(((info) >> 24) & 0x0f)
74a1de
+#define BTF_INFO_KIND(info)	(((info) >> 24) & 0x1f)
74a1de
 #define BTF_INFO_VLEN(info)	((info) & 0xffff)
74a1de
 #define BTF_INFO_KFLAG(info)	((info) >> 31)
74a1de
 
74a1de
@@ -72,7 +72,8 @@ struct btf_type {
74a1de
 #define BTF_KIND_FUNC_PROTO	13	/* Function Proto	*/
74a1de
 #define BTF_KIND_VAR		14	/* Variable	*/
74a1de
 #define BTF_KIND_DATASEC	15	/* Section	*/
74a1de
-#define BTF_KIND_MAX		BTF_KIND_DATASEC
74a1de
+#define BTF_KIND_FLOAT		16	/* Floating point	*/
74a1de
+#define BTF_KIND_MAX		BTF_KIND_FLOAT
74a1de
 #define NR_BTF_KINDS		(BTF_KIND_MAX + 1)
74a1de
 
74a1de
 /* For some specific BTF_KIND, "struct btf_type" is immediately
74a1de
diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h
74a1de
index b0a56139..37b14b4e 100644
74a1de
--- a/include/uapi/linux/nexthop.h
74a1de
+++ b/include/uapi/linux/nexthop.h
74a1de
@@ -21,7 +21,10 @@ struct nexthop_grp {
74a1de
 };
74a1de
 
74a1de
 enum {
74a1de
-	NEXTHOP_GRP_TYPE_MPATH,  /* default type if not specified */
74a1de
+	NEXTHOP_GRP_TYPE_MPATH,  /* hash-threshold nexthop group
74a1de
+				  * default type if not specified
74a1de
+				  */
74a1de
+	NEXTHOP_GRP_TYPE_RES,    /* resilient nexthop group */
74a1de
 	__NEXTHOP_GRP_TYPE_MAX,
74a1de
 };
74a1de
 
74a1de
@@ -52,8 +55,50 @@ enum {
74a1de
 	NHA_FDB,	/* flag; nexthop belongs to a bridge fdb */
74a1de
 	/* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */
74a1de
 
74a1de
+	/* nested; resilient nexthop group attributes */
74a1de
+	NHA_RES_GROUP,
74a1de
+	/* nested; nexthop bucket attributes */
74a1de
+	NHA_RES_BUCKET,
74a1de
+
74a1de
 	__NHA_MAX,
74a1de
 };
74a1de
 
74a1de
 #define NHA_MAX	(__NHA_MAX - 1)
74a1de
+
74a1de
+enum {
74a1de
+	NHA_RES_GROUP_UNSPEC,
74a1de
+	/* Pad attribute for 64-bit alignment. */
74a1de
+	NHA_RES_GROUP_PAD = NHA_RES_GROUP_UNSPEC,
74a1de
+
74a1de
+	/* u16; number of nexthop buckets in a resilient nexthop group */
74a1de
+	NHA_RES_GROUP_BUCKETS,
74a1de
+	/* clock_t as u32; nexthop bucket idle timer (per-group) */
74a1de
+	NHA_RES_GROUP_IDLE_TIMER,
74a1de
+	/* clock_t as u32; nexthop unbalanced timer */
74a1de
+	NHA_RES_GROUP_UNBALANCED_TIMER,
74a1de
+	/* clock_t as u64; nexthop unbalanced time */
74a1de
+	NHA_RES_GROUP_UNBALANCED_TIME,
74a1de
+
74a1de
+	__NHA_RES_GROUP_MAX,
74a1de
+};
74a1de
+
74a1de
+#define NHA_RES_GROUP_MAX	(__NHA_RES_GROUP_MAX - 1)
74a1de
+
74a1de
+enum {
74a1de
+	NHA_RES_BUCKET_UNSPEC,
74a1de
+	/* Pad attribute for 64-bit alignment. */
74a1de
+	NHA_RES_BUCKET_PAD = NHA_RES_BUCKET_UNSPEC,
74a1de
+
74a1de
+	/* u16; nexthop bucket index */
74a1de
+	NHA_RES_BUCKET_INDEX,
74a1de
+	/* clock_t as u64; nexthop bucket idle time */
74a1de
+	NHA_RES_BUCKET_IDLE_TIME,
74a1de
+	/* u32; nexthop id assigned to the nexthop bucket */
74a1de
+	NHA_RES_BUCKET_NH_ID,
74a1de
+
74a1de
+	__NHA_RES_BUCKET_MAX,
74a1de
+};
74a1de
+
74a1de
+#define NHA_RES_BUCKET_MAX	(__NHA_RES_BUCKET_MAX - 1)
74a1de
+
74a1de
 #endif
74a1de
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
74a1de
index 7ea59cfe..025c40fe 100644
74a1de
--- a/include/uapi/linux/pkt_cls.h
74a1de
+++ b/include/uapi/linux/pkt_cls.h
74a1de
@@ -190,6 +190,8 @@ enum {
74a1de
 	TCA_POLICE_PAD,
74a1de
 	TCA_POLICE_RATE64,
74a1de
 	TCA_POLICE_PEAKRATE64,
74a1de
+	TCA_POLICE_PKTRATE64,
74a1de
+	TCA_POLICE_PKTBURST64,
74a1de
 	__TCA_POLICE_MAX
74a1de
 #define TCA_POLICE_RESULT TCA_POLICE_RESULT
74a1de
 };
74a1de
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
74a1de
index b34b9add..f62cccc1 100644
74a1de
--- a/include/uapi/linux/rtnetlink.h
74a1de
+++ b/include/uapi/linux/rtnetlink.h
74a1de
@@ -178,6 +178,13 @@ enum {
74a1de
 	RTM_GETVLAN,
74a1de
 #define RTM_GETVLAN	RTM_GETVLAN
74a1de
 
74a1de
+	RTM_NEWNEXTHOPBUCKET = 116,
74a1de
+#define RTM_NEWNEXTHOPBUCKET	RTM_NEWNEXTHOPBUCKET
74a1de
+	RTM_DELNEXTHOPBUCKET,
74a1de
+#define RTM_DELNEXTHOPBUCKET	RTM_DELNEXTHOPBUCKET
74a1de
+	RTM_GETNEXTHOPBUCKET,
74a1de
+#define RTM_GETNEXTHOPBUCKET	RTM_GETNEXTHOPBUCKET
74a1de
+
74a1de
 	__RTM_MAX,
74a1de
 #define RTM_MAX		(((__RTM_MAX + 3) & ~3) - 1)
74a1de
 };
74a1de
-- 
74a1de
2.31.1
74a1de