Projects
openEuler:Mainline
libbpf
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 11
View file
_service:tar_scm:libbpf.spec
Changed
@@ -4,7 +4,7 @@ Name: %{githubname} Version: %{githubver} -Release: 8 +Release: 9 Summary: Libbpf library License: LGPLv2 or BSD @@ -30,6 +30,7 @@ Patch0015: backport-libbpf-disassociate-section-handler-on-explicit-bpf_.patch Patch0016: backport-libbpf-Use-correct-return-pointer-in-attach_raw_tp.patch Patch0017: backport-libbpf-Use-elf_getshdrnum-instead-of-e_shnum.patch +Patch0018: 0001-sync-bpf-helper-funcs-from-kernel.patch # This package supersedes libbpf from kernel-tools, # which has default Epoch: 0. By having Epoch: 1 @@ -82,6 +83,9 @@ %{_libdir}/libbpf.a %changelog +* Fri Aug 4 2023 JofDiamonds <kwb0523@163.com> -2:0.8.1-9 +- sync bpf helper funcs from kernel + * Sat May 13 2023 zhangmingyi <zhangmingyi5@huawei.com> -2:0.8.1-8 - backport patches from upstream: backport-libbpf-disassociate-section-handler-on-explicit-bpf_.patch
View file
_service:tar_scm:0001-sync-bpf-helper-funcs-from-kernel.patch
Added
@@ -0,0 +1,360 @@ +From 78ac59d3afde9e11df3223cb669c54b1b77400e3 Mon Sep 17 00:00:00 2001 +From: kwb0523 <kwb0523@163.com> +Date: Fri, 4 Aug 2023 16:30:46 +0800 +Subject: PATCH sync bpf helper funcs from kernel + +--- + src/bpf_helper_defs.h | 339 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 339 insertions(+) + +diff --git a/src/bpf_helper_defs.h b/src/bpf_helper_defs.h +index abe612e..95f05f1 100644 +--- a/src/bpf_helper_defs.h ++++ b/src/bpf_helper_defs.h +@@ -4370,4 +4370,343 @@ static void *(*bpf_kptr_xchg)(void *map_value, void *ptr) = (void *) 194; + */ + static void *(*bpf_map_lookup_percpu_elem)(void *map, const void *key, __u32 cpu) = (void *) 195; + ++/* ++ * bpf_skc_to_mptcp_sock ++ * ++ * Dynamically cast a *sk* pointer to a *mptcp_sock* pointer. ++ * ++ * Returns ++ * *sk* if casting is valid, or **NULL** otherwise. ++ */ ++static struct mptcp_sock *(*bpf_skc_to_mptcp_sock)(void *sk) = (void *) 196; ++ ++/* ++ * bpf_dynptr_from_mem ++ * ++ * Get a dynptr to local memory *data*. ++ * ++ * *data* must be a ptr to a map value. ++ * The maximum *size* supported is DYNPTR_MAX_SIZE. ++ * *flags* is currently unused. ++ * ++ * Returns ++ * 0 on success, -E2BIG if the size exceeds DYNPTR_MAX_SIZE, ++ * -EINVAL if flags is not 0. ++ */ ++static long (*bpf_dynptr_from_mem)(void *data, __u32 size, __u64 flags, struct bpf_dynptr *ptr) = (void *) 197; ++ ++/* ++ * bpf_ringbuf_reserve_dynptr ++ * ++ * Reserve *size* bytes of payload in a ring buffer *ringbuf* ++ * through the dynptr interface. *flags* must be 0. ++ * ++ * Please note that a corresponding bpf_ringbuf_submit_dynptr or ++ * bpf_ringbuf_discard_dynptr must be called on *ptr*, even if the ++ * reservation fails. This is enforced by the verifier. ++ * ++ * Returns ++ * 0 on success, or a negative error in case of failure. ++ */ ++static long (*bpf_ringbuf_reserve_dynptr)(void *ringbuf, __u32 size, __u64 flags, struct bpf_dynptr *ptr) = (void *) 198; ++ ++/* ++ * bpf_ringbuf_submit_dynptr ++ * ++ * Submit reserved ring buffer sample, pointed to by *data*, ++ * through the dynptr interface. This is a no-op if the dynptr is ++ * invalid/null. ++ * ++ * For more information on *flags*, please see ++ * 'bpf_ringbuf_submit'. ++ * ++ * Returns ++ * Nothing. Always succeeds. ++ */ ++static void (*bpf_ringbuf_submit_dynptr)(struct bpf_dynptr *ptr, __u64 flags) = (void *) 199; ++ ++/* ++ * bpf_ringbuf_discard_dynptr ++ * ++ * Discard reserved ring buffer sample through the dynptr ++ * interface. This is a no-op if the dynptr is invalid/null. ++ * ++ * For more information on *flags*, please see ++ * 'bpf_ringbuf_discard'. ++ * ++ * Returns ++ * Nothing. Always succeeds. ++ */ ++static void (*bpf_ringbuf_discard_dynptr)(struct bpf_dynptr *ptr, __u64 flags) = (void *) 200; ++ ++/* ++ * bpf_dynptr_read ++ * ++ * Read *len* bytes from *src* into *dst*, starting from *offset* ++ * into *src*. ++ * *flags* is currently unused. ++ * ++ * Returns ++ * 0 on success, -E2BIG if *offset* + *len* exceeds the length ++ * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if ++ * *flags* is not 0. ++ */ ++static long (*bpf_dynptr_read)(void *dst, __u32 len, const struct bpf_dynptr *src, __u32 offset, __u64 flags) = (void *) 201; ++ ++/* ++ * bpf_dynptr_write ++ * ++ * Write *len* bytes from *src* into *dst*, starting from *offset* ++ * into *dst*. ++ * ++ * *flags* must be 0 except for skb-type dynptrs. ++ * ++ * For skb-type dynptrs: ++ * * All data slices of the dynptr are automatically ++ * invalidated after **bpf_dynptr_write**\ (). This is ++ * because writing may pull the skb and change the ++ * underlying packet buffer. ++ * ++ * * For *flags*, please see the flags accepted by ++ * **bpf_skb_store_bytes**\ (). ++ * ++ * Returns ++ * 0 on success, -E2BIG if *offset* + *len* exceeds the length ++ * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst* ++ * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs, ++ * other errors correspond to errors returned by **bpf_skb_store_bytes**\ (). ++ */ ++static long (*bpf_dynptr_write)(const struct bpf_dynptr *dst, __u32 offset, void *src, __u32 len, __u64 flags) = (void *) 202; ++ ++/* ++ * bpf_dynptr_data ++ * ++ * Get a pointer to the underlying dynptr data. ++ * ++ * *len* must be a statically known value. The returned data slice ++ * is invalidated whenever the dynptr is invalidated. ++ * ++ * skb and xdp type dynptrs may not use bpf_dynptr_data. They should ++ * instead use bpf_dynptr_slice and bpf_dynptr_slice_rdwr. ++ * ++ * Returns ++ * Pointer to the underlying dynptr data, NULL if the dynptr is ++ * read-only, if the dynptr is invalid, or if the offset and length ++ * is out of bounds. ++ */ ++static void *(*bpf_dynptr_data)(const struct bpf_dynptr *ptr, __u32 offset, __u32 len) = (void *) 203; ++ ++/* ++ * bpf_tcp_raw_gen_syncookie_ipv4 ++ * ++ * Try to issue a SYN cookie for the packet with corresponding ++ * IPv4/TCP headers, *iph* and *th*, without depending on a ++ * listening socket. ++ * ++ * *iph* points to the IPv4 header. ++ * ++ * *th* points to the start of the TCP header, while *th_len* ++ * contains the length of the TCP header (at least ++ * **sizeof**\ (**struct tcphdr**)). ++ * ++ * Returns ++ * On success, lower 32 bits hold the generated SYN cookie in ++ * followed by 16 bits which hold the MSS value for that cookie, ++ * and the top 16 bits are unused. ++ * ++ * On failure, the returned value is one of the following: ++ * ++ * **-EINVAL** if *th_len* is invalid. ++ */ ++static __s64 (*bpf_tcp_raw_gen_syncookie_ipv4)(struct iphdr *iph, struct tcphdr *th, __u32 th_len) = (void *) 204; ++ ++/* ++ * bpf_tcp_raw_gen_syncookie_ipv6 ++ * ++ * Try to issue a SYN cookie for the packet with corresponding ++ * IPv6/TCP headers, *iph* and *th*, without depending on a ++ * listening socket. ++ * ++ * *iph* points to the IPv6 header. ++ * ++ * *th* points to the start of the TCP header, while *th_len* ++ * contains the length of the TCP header (at least ++ * **sizeof**\ (**struct tcphdr**)). ++ * ++ * Returns ++ * On success, lower 32 bits hold the generated SYN cookie in ++ * followed by 16 bits which hold the MSS value for that cookie, ++ * and the top 16 bits are unused. ++ * ++ * On failure, the returned value is one of the following: ++ * ++ * **-EINVAL** if *th_len* is invalid. ++ * ++ * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin. ++ */ ++static __s64 (*bpf_tcp_raw_gen_syncookie_ipv6)(struct ipv6hdr *iph, struct tcphdr *th, __u32 th_len) = (void *) 205; ++ ++/* ++ * bpf_tcp_raw_check_syncookie_ipv4 ++ * ++ * Check whether *iph* and *th* contain a valid SYN cookie ACK ++ * without depending on a listening socket. ++ *
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2