History

bpf: Switch most helper return values from 32-bit int to 64-bit long

Switch most of BPF helper definitions from returning int to long. These definitions are coming from comments in BPF UAPI header and are used to generate bpf_helper_defs.h (under libbpf) to be later included and used from BPF programs. In actual in-kernel implementation, all the helpers are defined as returning u64, but due to some historical reasons, most of them are actually defined as returning int in UAPI (usually, to return 0 on success, and negative value on error). This actually causes Clang to quite often generate sub-optimal code, because compiler believes that return value is 32-bit, and in a lot of cases has to be up-converted (usually with a pair of 32-bit bit shifts) to 64-bit values, before they can be used further in BPF code. Besides just "polluting" the code, these 32-bit shifts quite often cause problems for cases in which return value matters. This is especially the case for the family of bpf_probe_read_str() functions. There are few other similar helpers (e.g., bpf_read_branch_records()), in which return value is used by BPF program logic to record variable-length data and process it. For such cases, BPF program logic carefully manages offsets within some array or map to read variable-length data. For such uses, it's crucial for BPF verifier to track possible range of register values to prove that all the accesses happen within given memory bounds. Those extraneous zero-extending bit shifts, inserted by Clang (and quite often interleaved with other code, which makes the issues even more challenging and sometimes requires employing extra per-variable compiler barriers), throws off verifier logic and makes it mark registers as having unknown variable offset. We'll study this pattern a bit later below. Another common pattern is to check return of BPF helper for non-zero state to detect error conditions and attempt alternative actions in such case. Even in this simple and straightforward case, this 32-bit vs BPF's native 64-bit mode quite often leads to sub-optimal and unnecessary extra code. We'll look at this pattern as well. Clang's BPF target supports two modes of code generation: ALU32, in which it is capable of using lower 32-bit parts of registers, and no-ALU32, in which only full 64-bit registers are being used. ALU32 mode somewhat mitigates the above described problems, but not in all cases. This patch switches all the cases in which BPF helpers return 0 or negative error from returning int to returning long. It is shown below that such change in definition leads to equivalent or better code. No-ALU32 mode benefits more, but ALU32 mode doesn't degrade or still gets improved code generation. Another class of cases switched from int to long are bpf_probe_read_str()-like helpers, which encode successful case as non-negative values, while still returning negative value for errors. In all of such cases, correctness is preserved due to two's complement encoding of negative values and the fact that all helpers return values with 32-bit absolute value. Two's complement ensures that for negative values higher 32 bits are all ones and when truncated, leave valid negative 32-bit value with the same value. Non-negative values have upper 32 bits set to zero and similarly preserve value when high 32 bits are truncated. This means that just casting to int/u32 is correct and efficient (and in ALU32 mode doesn't require any extra shifts). To minimize the chances of regressions, two code patterns were investigated, as mentioned above. For both patterns, BPF assembly was analyzed in ALU32/NO-ALU32 compiler modes, both with current 32-bit int return type and new 64-bit long return type. Case 1. Variable-length data reading and concatenation. This is quite ubiquitous pattern in tracing/monitoring applications, reading data like process's environment variables, file path, etc. In such case, many pieces of string-like variable-length data are read into a single big buffer, and at the end of the process, only a part of array containing actual data is sent to user-space for further processing. This case is tested in test_varlen.c selftest (in the next patch). Code flow is roughly as follows: void *payload = &sample->payload; u64 len; len = bpf_probe_read_kernel_str(payload, MAX_SZ1, &source_data1); if (len <= MAX_SZ1) { payload += len; sample->len1 = len; } len = bpf_probe_read_kernel_str(payload, MAX_SZ2, &source_data2); if (len <= MAX_SZ2) { payload += len; sample->len2 = len; } /* and so on */ sample->total_len = payload - &sample->payload; /* send over, e.g., perf buffer */ There could be two variations with slightly different code generated: when len is 64-bit integer and when it is 32-bit integer. Both variations were analysed. BPF assembly instructions between two successive invocations of bpf_probe_read_kernel_str() were used to check code regressions. Results are below, followed by short analysis. Left side is using helpers with int return type, the right one is after the switch to long. ALU32 + INT ALU32 + LONG =========== ============ 64-BIT (13 insns): 64-BIT (10 insns): ------------------------------------ ------------------------------------ 17: call 115 17: call 115 18: if w0 > 256 goto +9 <LBB0_4> 18: if r0 > 256 goto +6 <LBB0_4> 19: w1 = w0 19: r1 = 0 ll 20: r1 <<= 32 21: *(u64 *)(r1 + 0) = r0 21: r1 s>>= 32 22: r6 = 0 ll 22: r2 = 0 ll 24: r6 += r0 24: *(u64 *)(r2 + 0) = r1 00000000000000c8 <LBB0_4>: 25: r6 = 0 ll 25: r1 = r6 27: r6 += r1 26: w2 = 256 00000000000000e0 <LBB0_4>: 27: r3 = 0 ll 28: r1 = r6 29: call 115 29: w2 = 256 30: r3 = 0 ll 32: call 115 32-BIT (11 insns): 32-BIT (12 insns): ------------------------------------ ------------------------------------ 17: call 115 17: call 115 18: if w0 > 256 goto +7 <LBB1_4> 18: if w0 > 256 goto +8 <LBB1_4> 19: r1 = 0 ll 19: r1 = 0 ll 21: *(u32 *)(r1 + 0) = r0 21: *(u32 *)(r1 + 0) = r0 22: w1 = w0 22: r0 <<= 32 23: r6 = 0 ll 23: r0 >>= 32 25: r6 += r1 24: r6 = 0 ll 00000000000000d0 <LBB1_4>: 26: r6 += r0 26: r1 = r6 00000000000000d8 <LBB1_4>: 27: w2 = 256 27: r1 = r6 28: r3 = 0 ll 28: w2 = 256 30: call 115 29: r3 = 0 ll 31: call 115 In ALU32 mode, the variant using 64-bit length variable clearly wins and avoids unnecessary zero-extension bit shifts. In practice, this is even more important and good, because BPF code won't need to do extra checks to "prove" that payload/len are within good bounds. 32-bit len is one instruction longer. Clang decided to do 64-to-32 casting with two bit shifts, instead of equivalent `w1 = w0` assignment. The former uses extra register. The latter might potentially lose some range information, but not for 32-bit value. So in this case, verifier infers that r0 is [0, 256] after check at 18:, and shifting 32 bits left/right keeps that range intact. We should probably look into Clang's logic and see why it chooses bitshifts over sub-register assignments for this. NO-ALU32 + INT NO-ALU32 + LONG ============== =============== 64-BIT (14 insns): 64-BIT (10 insns): ------------------------------------ ------------------------------------ 17: call 115 17: call 115 18: r0 <<= 32 18: if r0 > 256 goto +6 <LBB0_4> 19: r1 = r0 19: r1 = 0 ll 20: r1 >>= 32 21: *(u64 *)(r1 + 0) = r0 21: if r1 > 256 goto +7 <LBB0_4> 22: r6 = 0 ll 22: r0 s>>= 32 24: r6 += r0 23: r1 = 0 ll 00000000000000c8 <LBB0_4>: 25: *(u64 *)(r1 + 0) = r0 25: r1 = r6 26: r6 = 0 ll 26: r2 = 256 28: r6 += r0 27: r3 = 0 ll 00000000000000e8 <LBB0_4>: 29: call 115 29: r1 = r6 30: r2 = 256 31: r3 = 0 ll 33: call 115 32-BIT (13 insns): 32-BIT (13 insns): ------------------------------------ ------------------------------------ 17: call 115 17: call 115 18: r1 = r0 18: r1 = r0 19: r1 <<= 32 19: r1 <<= 32 20: r1 >>= 32 20: r1 >>= 32 21: if r1 > 256 goto +6 <LBB1_4> 21: if r1 > 256 goto +6 <LBB1_4> 22: r2 = 0 ll 22: r2 = 0 ll 24: *(u32 *)(r2 + 0) = r0 24: *(u32 *)(r2 + 0) = r0 25: r6 = 0 ll 25: r6 = 0 ll 27: r6 += r1 27: r6 += r1 00000000000000e0 <LBB1_4>: 00000000000000e0 <LBB1_4>: 28: r1 = r6 28: r1 = r6 29: r2 = 256 29: r2 = 256 30: r3 = 0 ll 30: r3 = 0 ll 32: call 115 32: call 115 In NO-ALU32 mode, for the case of 64-bit len variable, Clang generates much superior code, as expected, eliminating unnecessary bit shifts. For 32-bit len, code is identical. So overall, only ALU-32 32-bit len case is more-or-less equivalent and the difference stems from internal Clang decision, rather than compiler lacking enough information about types. Case 2. Let's look at the simpler case of checking return result of BPF helper for errors. The code is very simple: long bla; if (bpf_probe_read_kenerl(&bla, sizeof(bla), 0)) return 1; else return 0; ALU32 + CHECK (9 insns) ALU32 + CHECK (9 insns) ==================================== ==================================== 0: r1 = r10 0: r1 = r10 1: r1 += -8 1: r1 += -8 2: w2 = 8 2: w2 = 8 3: r3 = 0 3: r3 = 0 4: call 113 4: call 113 5: w1 = w0 5: r1 = r0 6: w0 = 1 6: w0 = 1 7: if w1 != 0 goto +1 <LBB2_2> 7: if r1 != 0 goto +1 <LBB2_2> 8: w0 = 0 8: w0 = 0 0000000000000048 <LBB2_2>: 0000000000000048 <LBB2_2>: 9: exit 9: exit Almost identical code, the only difference is the use of full register assignment (r1 = r0) vs half-registers (w1 = w0) in instruction #5. On 32-bit architectures, new BPF assembly might be slightly less optimal, in theory. But one can argue that's not a big issue, given that use of full registers is still prevalent (e.g., for parameter passing). NO-ALU32 + CHECK (11 insns) NO-ALU32 + CHECK (9 insns) ==================================== ==================================== 0: r1 = r10 0: r1 = r10 1: r1 += -8 1: r1 += -8 2: r2 = 8 2: r2 = 8 3: r3 = 0 3: r3 = 0 4: call 113 4: call 113 5: r1 = r0 5: r1 = r0 6: r1 <<= 32 6: r0 = 1 7: r1 >>= 32 7: if r1 != 0 goto +1 <LBB2_2> 8: r0 = 1 8: r0 = 0 9: if r1 != 0 goto +1 <LBB2_2> 0000000000000048 <LBB2_2>: 10: r0 = 0 9: exit 0000000000000058 <LBB2_2>: 11: exit NO-ALU32 is a clear improvement, getting rid of unnecessary zero-extension bit shifts.

Andrii Nakryiko committed 6 years ago

Commit bdb7b791 parent b3eece02 files · +192 −192Browse files

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

Unified · Split

include/uapi/linux/bpf.h+96−96
@@ -653,7 +653,7 @@ union bpf_attr { · 652 unmodified lines
653 * Map value associated to *key*, or **NULL** if no entry was653 * Map value associated to *key*, or **NULL** if no entry was
654 * found.654 * found.
655 *655 *
656 * int bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)656 * long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)
657 * Description657 * Description
658 * Add or update the value of the entry associated to *key* in658 * Add or update the value of the entry associated to *key* in
659 * *map* with *value*. *flags* is one of:659 * *map* with *value*. *flags* is one of:
@@ -671,13 +671,13 @@ union bpf_attr { · 11 unmodified lines
671 * Return671 * Return
672 * 0 on success, or a negative error in case of failure.672 * 0 on success, or a negative error in case of failure.
673 *673 *
674 * int bpf_map_delete_elem(struct bpf_map *map, const void *key)674 * long bpf_map_delete_elem(struct bpf_map *map, const void *key)
675 * Description675 * Description
676 * Delete entry with *key* from *map*.676 * Delete entry with *key* from *map*.
677 * Return677 * Return
678 * 0 on success, or a negative error in case of failure.678 * 0 on success, or a negative error in case of failure.
679 *679 *
680 * int bpf_probe_read(void *dst, u32 size, const void *unsafe_ptr)680 * long bpf_probe_read(void *dst, u32 size, const void *unsafe_ptr)
681 * Description681 * Description
682 * For tracing programs, safely attempt to read *size* bytes from682 * For tracing programs, safely attempt to read *size* bytes from
683 * kernel space address *unsafe_ptr* and store the data in *dst*.683 * kernel space address *unsafe_ptr* and store the data in *dst*.
@@ -695,7 +695,7 @@ union bpf_attr { · 11 unmodified lines
695 * Return695 * Return
696 * Current *ktime*.696 * Current *ktime*.
697 *697 *
698 * int bpf_trace_printk(const char *fmt, u32 fmt_size, ...)698 * long bpf_trace_printk(const char *fmt, u32 fmt_size, ...)
699 * Description699 * Description
700 * This helper is a "printk()-like" facility for debugging. It700 * This helper is a "printk()-like" facility for debugging. It
701 * prints a message defined by format *fmt* (of size *fmt_size*)701 * prints a message defined by format *fmt* (of size *fmt_size*)
@@ -775,7 +775,7 @@ union bpf_attr { · 73 unmodified lines
775 * Return775 * Return
776 * The SMP id of the processor running the program.776 * The SMP id of the processor running the program.
777 *777 *
778 * int bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)778 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
779 * Description779 * Description
780 * Store *len* bytes from address *from* into the packet780 * Store *len* bytes from address *from* into the packet
781 * associated to *skb*, at *offset*. *flags* are a combination of781 * associated to *skb*, at *offset*. *flags* are a combination of
@@ -792,7 +792,7 @@ union bpf_attr { · 10 unmodified lines
792 * Return792 * Return
793 * 0 on success, or a negative error in case of failure.793 * 0 on success, or a negative error in case of failure.
794 *794 *
795 * int bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size)795 * long bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size)
796 * Description796 * Description
797 * Recompute the layer 3 (e.g. IP) checksum for the packet797 * Recompute the layer 3 (e.g. IP) checksum for the packet
798 * associated to *skb*. Computation is incremental, so the helper798 * associated to *skb*. Computation is incremental, so the helper
@@ -817,7 +817,7 @@ union bpf_attr { · 18 unmodified lines
817 * Return817 * Return
818 * 0 on success, or a negative error in case of failure.818 * 0 on success, or a negative error in case of failure.
819 *819 *
820 * int bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags)820 * long bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags)
821 * Description821 * Description
822 * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the822 * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the
823 * packet associated to *skb*. Computation is incremental, so the823 * packet associated to *skb*. Computation is incremental, so the
@@ -849,7 +849,7 @@ union bpf_attr { · 25 unmodified lines
849 * Return849 * Return
850 * 0 on success, or a negative error in case of failure.850 * 0 on success, or a negative error in case of failure.
851 *851 *
852 * int bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index)852 * long bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index)
853 * Description853 * Description
854 * This special helper is used to trigger a "tail call", or in854 * This special helper is used to trigger a "tail call", or in
855 * other words, to jump into another eBPF program. The same stack855 * other words, to jump into another eBPF program. The same stack
@@ -880,7 +880,7 @@ union bpf_attr { · 24 unmodified lines
880 * Return880 * Return
881 * 0 on success, or a negative error in case of failure.881 * 0 on success, or a negative error in case of failure.
882 *882 *
883 * int bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags)883 * long bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags)
884 * Description884 * Description
885 * Clone and redirect the packet associated to *skb* to another885 * Clone and redirect the packet associated to *skb* to another
886 * net device of index *ifindex*. Both ingress and egress886 * net device of index *ifindex*. Both ingress and egress
@@ -916,7 +916,7 @@ union bpf_attr { · 29 unmodified lines
916 * A 64-bit integer containing the current GID and UID, and916 * A 64-bit integer containing the current GID and UID, and
917 * created as such: *current_gid* **<< 32 \|** *current_uid*.917 * created as such: *current_gid* **<< 32 \|** *current_uid*.
918 *918 *
919 * int bpf_get_current_comm(void *buf, u32 size_of_buf)919 * long bpf_get_current_comm(void *buf, u32 size_of_buf)
920 * Description920 * Description
921 * Copy the **comm** attribute of the current task into *buf* of921 * Copy the **comm** attribute of the current task into *buf* of
922 * *size_of_buf*. The **comm** attribute contains the name of922 * *size_of_buf*. The **comm** attribute contains the name of
@@ -953,7 +953,7 @@ union bpf_attr { · 30 unmodified lines
953 * Return953 * Return
954 * The classid, or 0 for the default unconfigured classid.954 * The classid, or 0 for the default unconfigured classid.
955 *955 *
956 * int bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)956 * long bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
957 * Description957 * Description
958 * Push a *vlan_tci* (VLAN tag control information) of protocol958 * Push a *vlan_tci* (VLAN tag control information) of protocol
959 * *vlan_proto* to the packet associated to *skb*, then update959 * *vlan_proto* to the packet associated to *skb*, then update
@@ -969,7 +969,7 @@ union bpf_attr { · 9 unmodified lines
969 * Return969 * Return
970 * 0 on success, or a negative error in case of failure.970 * 0 on success, or a negative error in case of failure.
971 *971 *
972 * int bpf_skb_vlan_pop(struct sk_buff *skb)972 * long bpf_skb_vlan_pop(struct sk_buff *skb)
973 * Description973 * Description
974 * Pop a VLAN header from the packet associated to *skb*.974 * Pop a VLAN header from the packet associated to *skb*.
975 *975 *
@@ -981,7 +981,7 @@ union bpf_attr { · 5 unmodified lines
981 * Return981 * Return
982 * 0 on success, or a negative error in case of failure.982 * 0 on success, or a negative error in case of failure.
983 *983 *
984 * int bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)984 * long bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)
985 * Description985 * Description
986 * Get tunnel metadata. This helper takes a pointer *key* to an986 * Get tunnel metadata. This helper takes a pointer *key* to an
987 * empty **struct bpf_tunnel_key** of **size**, that will be987 * empty **struct bpf_tunnel_key** of **size**, that will be
@@ -1032,7 +1032,7 @@ union bpf_attr { · 44 unmodified lines
1032 * Return1032 * Return
1033 * 0 on success, or a negative error in case of failure.1033 * 0 on success, or a negative error in case of failure.
1034 *1034 *
1035 * int bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)1035 * long bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags)
1036 * Description1036 * Description
1037 * Populate tunnel metadata for packet associated to *skb.* The1037 * Populate tunnel metadata for packet associated to *skb.* The
1038 * tunnel metadata is set to the contents of *key*, of *size*. The1038 * tunnel metadata is set to the contents of *key*, of *size*. The
@@ -1098,7 +1098,7 @@ union bpf_attr { · 59 unmodified lines
1098 * The value of the perf event counter read from the map, or a1098 * The value of the perf event counter read from the map, or a
1099 * negative error code in case of failure.1099 * negative error code in case of failure.
1100 *1100 *
1101 * int bpf_redirect(u32 ifindex, u64 flags)1101 * long bpf_redirect(u32 ifindex, u64 flags)
1102 * Description1102 * Description
1103 * Redirect the packet to another net device of index *ifindex*.1103 * Redirect the packet to another net device of index *ifindex*.
1104 * This helper is somewhat similar to **bpf_clone_redirect**\1104 * This helper is somewhat similar to **bpf_clone_redirect**\
@@ -1145,7 +1145,7 @@ union bpf_attr { · 40 unmodified lines
1145 * The realm of the route for the packet associated to *skb*, or 01145 * The realm of the route for the packet associated to *skb*, or 0
1146 * if none was found.1146 * if none was found.
1147 *1147 *
1148 * int bpf_perf_event_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)1148 * long bpf_perf_event_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
1149 * Description1149 * Description
1150 * Write raw *data* blob into a special BPF perf event held by1150 * Write raw *data* blob into a special BPF perf event held by
1151 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf1151 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
@@ -1190,7 +1190,7 @@ union bpf_attr { · 38 unmodified lines
1190 * Return1190 * Return
1191 * 0 on success, or a negative error in case of failure.1191 * 0 on success, or a negative error in case of failure.
1192 *1192 *
1193 * int bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len)1193 * long bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len)
1194 * Description1194 * Description
1195 * This helper was provided as an easy way to load data from a1195 * This helper was provided as an easy way to load data from a
1196 * packet. It can be used to load *len* bytes from *offset* from1196 * packet. It can be used to load *len* bytes from *offset* from
@@ -1207,7 +1207,7 @@ union bpf_attr { · 10 unmodified lines
1207 * Return1207 * Return
1208 * 0 on success, or a negative error in case of failure.1208 * 0 on success, or a negative error in case of failure.
1209 *1209 *
1210 * int bpf_get_stackid(void *ctx, struct bpf_map *map, u64 flags)1210 * long bpf_get_stackid(void *ctx, struct bpf_map *map, u64 flags)
1211 * Description1211 * Description
1212 * Walk a user or a kernel stack and return its id. To achieve1212 * Walk a user or a kernel stack and return its id. To achieve
1213 * this, the helper needs *ctx*, which is a pointer to the context1213 * this, the helper needs *ctx*, which is a pointer to the context
@@ -1276,7 +1276,7 @@ union bpf_attr { · 62 unmodified lines
1276 * The checksum result, or a negative error code in case of1276 * The checksum result, or a negative error code in case of
1277 * failure.1277 * failure.
1278 *1278 *
1279 * int bpf_skb_get_tunnel_opt(struct sk_buff *skb, void *opt, u32 size)1279 * long bpf_skb_get_tunnel_opt(struct sk_buff *skb, void *opt, u32 size)
1280 * Description1280 * Description
1281 * Retrieve tunnel options metadata for the packet associated to1281 * Retrieve tunnel options metadata for the packet associated to
1282 * *skb*, and store the raw tunnel option data to the buffer *opt*1282 * *skb*, and store the raw tunnel option data to the buffer *opt*
@@ -1294,7 +1294,7 @@ union bpf_attr { · 11 unmodified lines
1294 * Return1294 * Return
1295 * The size of the option data retrieved.1295 * The size of the option data retrieved.
1296 *1296 *
1297 * int bpf_skb_set_tunnel_opt(struct sk_buff *skb, void *opt, u32 size)1297 * long bpf_skb_set_tunnel_opt(struct sk_buff *skb, void *opt, u32 size)
1298 * Description1298 * Description
1299 * Set tunnel options metadata for the packet associated to *skb*1299 * Set tunnel options metadata for the packet associated to *skb*
1300 * to the option data contained in the raw buffer *opt* of *size*.1300 * to the option data contained in the raw buffer *opt* of *size*.
@@ -1304,7 +1304,7 @@ union bpf_attr { · 3 unmodified lines
1304 * Return1304 * Return
1305 * 0 on success, or a negative error in case of failure.1305 * 0 on success, or a negative error in case of failure.
1306 *1306 *
1307 * int bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags)1307 * long bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags)
1308 * Description1308 * Description
1309 * Change the protocol of the *skb* to *proto*. Currently1309 * Change the protocol of the *skb* to *proto*. Currently
1310 * supported are transition from IPv4 to IPv6, and from IPv6 to1310 * supported are transition from IPv4 to IPv6, and from IPv6 to
@@ -1331,7 +1331,7 @@ union bpf_attr { · 20 unmodified lines
1331 * Return1331 * Return
1332 * 0 on success, or a negative error in case of failure.1332 * 0 on success, or a negative error in case of failure.
1333 *1333 *
1334 * int bpf_skb_change_type(struct sk_buff *skb, u32 type)1334 * long bpf_skb_change_type(struct sk_buff *skb, u32 type)
1335 * Description1335 * Description
1336 * Change the packet type for the packet associated to *skb*. This1336 * Change the packet type for the packet associated to *skb*. This
1337 * comes down to setting *skb*\ **->pkt_type** to *type*, except1337 * comes down to setting *skb*\ **->pkt_type** to *type*, except
@@ -1358,7 +1358,7 @@ union bpf_attr { · 20 unmodified lines
1358 * Return1358 * Return
1359 * 0 on success, or a negative error in case of failure.1359 * 0 on success, or a negative error in case of failure.
1360 *1360 *
1361 * int bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index)1361 * long bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index)
1362 * Description1362 * Description
1363 * Check whether *skb* is a descendant of the cgroup2 held by1363 * Check whether *skb* is a descendant of the cgroup2 held by
1364 * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*.1364 * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*.
@@ -1389,7 +1389,7 @@ union bpf_attr { · 24 unmodified lines
1389 * Return1389 * Return
1390 * A pointer to the current task struct.1390 * A pointer to the current task struct.
1391 *1391 *
1392 * int bpf_probe_write_user(void *dst, const void *src, u32 len)1392 * long bpf_probe_write_user(void *dst, const void *src, u32 len)
1393 * Description1393 * Description
1394 * Attempt in a safe way to write *len* bytes from the buffer1394 * Attempt in a safe way to write *len* bytes from the buffer
1395 * *src* to *dst* in memory. It only works for threads that are in1395 * *src* to *dst* in memory. It only works for threads that are in
@@ -1408,7 +1408,7 @@ union bpf_attr { · 12 unmodified lines
1408 * Return1408 * Return
1409 * 0 on success, or a negative error in case of failure.1409 * 0 on success, or a negative error in case of failure.
1410 *1410 *
1411 * int bpf_current_task_under_cgroup(struct bpf_map *map, u32 index)1411 * long bpf_current_task_under_cgroup(struct bpf_map *map, u32 index)
1412 * Description1412 * Description
1413 * Check whether the probe is being run is the context of a given1413 * Check whether the probe is being run is the context of a given
1414 * subset of the cgroup2 hierarchy. The cgroup2 to test is held by1414 * subset of the cgroup2 hierarchy. The cgroup2 to test is held by
@@ -1420,7 +1420,7 @@ union bpf_attr { · 5 unmodified lines
1420 * * 1, if the *skb* task does not belong to the cgroup2.1420 * * 1, if the *skb* task does not belong to the cgroup2.
1421 * * A negative error code, if an error occurred.1421 * * A negative error code, if an error occurred.
1422 *1422 *
1423 * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)1423 * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)
1424 * Description1424 * Description
1425 * Resize (trim or grow) the packet associated to *skb* to the1425 * Resize (trim or grow) the packet associated to *skb* to the
1426 * new *len*. The *flags* are reserved for future usage, and must1426 * new *len*. The *flags* are reserved for future usage, and must
@@ -1444,7 +1444,7 @@ union bpf_attr { · 17 unmodified lines
1444 * Return1444 * Return
1445 * 0 on success, or a negative error in case of failure.1445 * 0 on success, or a negative error in case of failure.
1446 *1446 *
1447 * int bpf_skb_pull_data(struct sk_buff *skb, u32 len)1447 * long bpf_skb_pull_data(struct sk_buff *skb, u32 len)
1448 * Description1448 * Description
1449 * Pull in non-linear data in case the *skb* is non-linear and not1449 * Pull in non-linear data in case the *skb* is non-linear and not
1450 * all of *len* are part of the linear section. Make *len* bytes1450 * all of *len* are part of the linear section. Make *len* bytes
@@ -1500,7 +1500,7 @@ union bpf_attr { · 49 unmodified lines
1500 * recalculation the next time the kernel tries to access this1500 * recalculation the next time the kernel tries to access this
1501 * hash or when the **bpf_get_hash_recalc**\ () helper is called.1501 * hash or when the **bpf_get_hash_recalc**\ () helper is called.
1502 *1502 *
1503 * int bpf_get_numa_node_id(void)1503 * long bpf_get_numa_node_id(void)
1504 * Description1504 * Description
1505 * Return the id of the current NUMA node. The primary use case1505 * Return the id of the current NUMA node. The primary use case
1506 * for this helper is the selection of sockets for the local NUMA1506 * for this helper is the selection of sockets for the local NUMA
@@ -1511,7 +1511,7 @@ union bpf_attr { · 4 unmodified lines
1511 * Return1511 * Return
1512 * The id of current NUMA node.1512 * The id of current NUMA node.
1513 *1513 *
1514 * int bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags)1514 * long bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags)
1515 * Description1515 * Description
1516 * Grows headroom of packet associated to *skb* and adjusts the1516 * Grows headroom of packet associated to *skb* and adjusts the
1517 * offset of the MAC header accordingly, adding *len* bytes of1517 * offset of the MAC header accordingly, adding *len* bytes of
@@ -1532,7 +1532,7 @@ union bpf_attr { · 14 unmodified lines
1532 * Return1532 * Return
1533 * 0 on success, or a negative error in case of failure.1533 * 0 on success, or a negative error in case of failure.
1534 *1534 *
1535 * int bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta)1535 * long bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta)
1536 * Description1536 * Description
1537 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that1537 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that
1538 * it is possible to use a negative value for *delta*. This helper1538 * it is possible to use a negative value for *delta*. This helper
@@ -1547,7 +1547,7 @@ union bpf_attr { · 8 unmodified lines
1547 * Return1547 * Return
1548 * 0 on success, or a negative error in case of failure.1548 * 0 on success, or a negative error in case of failure.
1549 *1549 *
1550 * int bpf_probe_read_str(void *dst, u32 size, const void *unsafe_ptr)1550 * long bpf_probe_read_str(void *dst, u32 size, const void *unsafe_ptr)
1551 * Description1551 * Description
1552 * Copy a NUL terminated string from an unsafe kernel address1552 * Copy a NUL terminated string from an unsafe kernel address
1553 * *unsafe_ptr* to *dst*. See **bpf_probe_read_kernel_str**\ () for1553 * *unsafe_ptr* to *dst*. See **bpf_probe_read_kernel_str**\ () for
@@ -1595,14 +1595,14 @@ union bpf_attr { · 41 unmodified lines
1595 * is returned (note that **overflowuid** might also be the actual1595 * is returned (note that **overflowuid** might also be the actual
1596 * UID value for the socket).1596 * UID value for the socket).
1597 *1597 *
1598 * u32 bpf_set_hash(struct sk_buff *skb, u32 hash)1598 * long bpf_set_hash(struct sk_buff *skb, u32 hash)
1599 * Description1599 * Description
1600 * Set the full hash for *skb* (set the field *skb*\ **->hash**)1600 * Set the full hash for *skb* (set the field *skb*\ **->hash**)
1601 * to value *hash*.1601 * to value *hash*.
1602 * Return1602 * Return
1603 * 01603 * 0
1604 *1604 *
1605 * int bpf_setsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen)1605 * long bpf_setsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen)
1606 * Description1606 * Description
1607 * Emulate a call to **setsockopt()** on the socket associated to1607 * Emulate a call to **setsockopt()** on the socket associated to
1608 * *bpf_socket*, which must be a full socket. The *level* at1608 * *bpf_socket*, which must be a full socket. The *level* at
@@ -1630,7 +1630,7 @@ union bpf_attr { · 21 unmodified lines
1630 * Return1630 * Return
1631 * 0 on success, or a negative error in case of failure.1631 * 0 on success, or a negative error in case of failure.
1632 *1632 *
1633 * int bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags)1633 * long bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags)
1634 * Description1634 * Description
1635 * Grow or shrink the room for data in the packet associated to1635 * Grow or shrink the room for data in the packet associated to
1636 * *skb* by *len_diff*, and according to the selected *mode*.1636 * *skb* by *len_diff*, and according to the selected *mode*.
@@ -1676,7 +1676,7 @@ union bpf_attr { · 39 unmodified lines
1676 * Return1676 * Return
1677 * 0 on success, or a negative error in case of failure.1677 * 0 on success, or a negative error in case of failure.
1678 *1678 *
1679 * int bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)1679 * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
1680 * Description1680 * Description
1681 * Redirect the packet to the endpoint referenced by *map* at1681 * Redirect the packet to the endpoint referenced by *map* at
1682 * index *key*. Depending on its type, this *map* can contain1682 * index *key*. Depending on its type, this *map* can contain
@@ -1697,7 +1697,7 @@ union bpf_attr { · 14 unmodified lines
1697 * **XDP_REDIRECT** on success, or the value of the two lower bits1697 * **XDP_REDIRECT** on success, or the value of the two lower bits
1698 * of the *flags* argument on error.1698 * of the *flags* argument on error.
1699 *1699 *
1700 * int bpf_sk_redirect_map(struct sk_buff *skb, struct bpf_map *map, u32 key, u64 flags)1700 * long bpf_sk_redirect_map(struct sk_buff *skb, struct bpf_map *map, u32 key, u64 flags)
1701 * Description1701 * Description
1702 * Redirect the packet to the socket referenced by *map* (of type1702 * Redirect the packet to the socket referenced by *map* (of type
1703 * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and1703 * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and
@@ -1708,7 +1708,7 @@ union bpf_attr { · 4 unmodified lines
1708 * Return1708 * Return
1709 * **SK_PASS** on success, or **SK_DROP** on error.1709 * **SK_PASS** on success, or **SK_DROP** on error.
1710 *1710 *
1711 * int bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)1711 * long bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)
1712 * Description1712 * Description
1713 * Add an entry to, or update a *map* referencing sockets. The1713 * Add an entry to, or update a *map* referencing sockets. The
1714 * *skops* is used as a new value for the entry associated to1714 * *skops* is used as a new value for the entry associated to
@@ -1727,7 +1727,7 @@ union bpf_attr { · 12 unmodified lines
1727 * Return1727 * Return
1728 * 0 on success, or a negative error in case of failure.1728 * 0 on success, or a negative error in case of failure.
1729 *1729 *
1730 * int bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta)1730 * long bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta)
1731 * Description1731 * Description
1732 * Adjust the address pointed by *xdp_md*\ **->data_meta** by1732 * Adjust the address pointed by *xdp_md*\ **->data_meta** by
1733 * *delta* (which can be positive or negative). Note that this1733 * *delta* (which can be positive or negative). Note that this
@@ -1756,7 +1756,7 @@ union bpf_attr { · 22 unmodified lines
1756 * Return1756 * Return
1757 * 0 on success, or a negative error in case of failure.1757 * 0 on success, or a negative error in case of failure.
1758 *1758 *
1759 * int bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size)1759 * long bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size)
1760 * Description1760 * Description
1761 * Read the value of a perf event counter, and store it into *buf*1761 * Read the value of a perf event counter, and store it into *buf*
1762 * of size *buf_size*. This helper relies on a *map* of type1762 * of size *buf_size*. This helper relies on a *map* of type
@@ -1806,7 +1806,7 @@ union bpf_attr { · 43 unmodified lines
1806 * Return1806 * Return
1807 * 0 on success, or a negative error in case of failure.1807 * 0 on success, or a negative error in case of failure.
1808 *1808 *
1809 * int bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)1809 * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)
1810 * Description1810 * Description
1811 * For en eBPF program attached to a perf event, retrieve the1811 * For en eBPF program attached to a perf event, retrieve the
1812 * value of the event counter associated to *ctx* and store it in1812 * value of the event counter associated to *ctx* and store it in
@@ -1817,7 +1817,7 @@ union bpf_attr { · 4 unmodified lines
1817 * Return1817 * Return
1818 * 0 on success, or a negative error in case of failure.1818 * 0 on success, or a negative error in case of failure.
1819 *1819 *
1820 * int bpf_getsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen)1820 * long bpf_getsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen)
1821 * Description1821 * Description
1822 * Emulate a call to **getsockopt()** on the socket associated to1822 * Emulate a call to **getsockopt()** on the socket associated to
1823 * *bpf_socket*, which must be a full socket. The *level* at1823 * *bpf_socket*, which must be a full socket. The *level* at
@@ -1842,7 +1842,7 @@ union bpf_attr { · 18 unmodified lines
1842 * Return1842 * Return
1843 * 0 on success, or a negative error in case of failure.1843 * 0 on success, or a negative error in case of failure.
1844 *1844 *
1845 * int bpf_override_return(struct pt_regs *regs, u64 rc)1845 * long bpf_override_return(struct pt_regs *regs, u64 rc)
1846 * Description1846 * Description
1847 * Used for error injection, this helper uses kprobes to override1847 * Used for error injection, this helper uses kprobes to override
1848 * the return value of the probed function, and to set it to *rc*.1848 * the return value of the probed function, and to set it to *rc*.
@@ -1867,7 +1867,7 @@ union bpf_attr { · 18 unmodified lines
1867 * Return1867 * Return
1868 * 01868 * 0
1869 *1869 *
1870 * int bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval)1870 * long bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval)
1871 * Description1871 * Description
1872 * Attempt to set the value of the **bpf_sock_ops_cb_flags** field1872 * Attempt to set the value of the **bpf_sock_ops_cb_flags** field
1873 * for the full TCP socket associated to *bpf_sock_ops* to1873 * for the full TCP socket associated to *bpf_sock_ops* to
@@ -1911,7 +1911,7 @@ union bpf_attr { · 37 unmodified lines
1911 * be set is returned (which comes down to 0 if all bits were set1911 * be set is returned (which comes down to 0 if all bits were set
1912 * as required).1912 * as required).
1913 *1913 *
1914 * int bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags)1914 * long bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags)
1915 * Description1915 * Description
1916 * This helper is used in programs implementing policies at the1916 * This helper is used in programs implementing policies at the
1917 * socket level. If the message *msg* is allowed to pass (i.e. if1917 * socket level. If the message *msg* is allowed to pass (i.e. if
@@ -1925,7 +1925,7 @@ union bpf_attr { · 7 unmodified lines
1925 * Return1925 * Return
1926 * **SK_PASS** on success, or **SK_DROP** on error.1926 * **SK_PASS** on success, or **SK_DROP** on error.
1927 *1927 *
1928 * int bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes)1928 * long bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes)
1929 * Description1929 * Description
1930 * For socket policies, apply the verdict of the eBPF program to1930 * For socket policies, apply the verdict of the eBPF program to
1931 * the next *bytes* (number of bytes) of message *msg*.1931 * the next *bytes* (number of bytes) of message *msg*.
@@ -1959,7 +1959,7 @@ union bpf_attr { · 27 unmodified lines
1959 * Return1959 * Return
1960 * 01960 * 0
1961 *1961 *
1962 * int bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes)1962 * long bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes)
1963 * Description1963 * Description
1964 * For socket policies, prevent the execution of the verdict eBPF1964 * For socket policies, prevent the execution of the verdict eBPF
1965 * program for message *msg* until *bytes* (byte number) have been1965 * program for message *msg* until *bytes* (byte number) have been
@@ -1977,7 +1977,7 @@ union bpf_attr { · 11 unmodified lines
1977 * Return1977 * Return
1978 * 01978 * 0
1979 *1979 *
1980 * int bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags)1980 * long bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags)
1981 * Description1981 * Description
1982 * For socket policies, pull in non-linear data from user space1982 * For socket policies, pull in non-linear data from user space
1983 * for *msg* and set pointers *msg*\ **->data** and *msg*\1983 * for *msg* and set pointers *msg*\ **->data** and *msg*\
@@ -2008,7 +2008,7 @@ union bpf_attr { · 24 unmodified lines
2008 * Return2008 * Return
2009 * 0 on success, or a negative error in case of failure.2009 * 0 on success, or a negative error in case of failure.
2010 *2010 *
2011 * int bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len)2011 * long bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len)
2012 * Description2012 * Description
2013 * Bind the socket associated to *ctx* to the address pointed by2013 * Bind the socket associated to *ctx* to the address pointed by
2014 * *addr*, of length *addr_len*. This allows for making outgoing2014 * *addr*, of length *addr_len*. This allows for making outgoing
@@ -2026,7 +2026,7 @@ union bpf_attr { · 11 unmodified lines
2026 * Return2026 * Return
2027 * 0 on success, or a negative error in case of failure.2027 * 0 on success, or a negative error in case of failure.
2028 *2028 *
2029 * int bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta)2029 * long bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta)
2030 * Description2030 * Description
2031 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is2031 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is
2032 * possible to both shrink and grow the packet tail.2032 * possible to both shrink and grow the packet tail.
@@ -2040,7 +2040,7 @@ union bpf_attr { · 7 unmodified lines
2040 * Return2040 * Return
2041 * 0 on success, or a negative error in case of failure.2041 * 0 on success, or a negative error in case of failure.
2042 *2042 *
2043 * int bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags)2043 * long bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags)
2044 * Description2044 * Description
2045 * Retrieve the XFRM state (IP transform framework, see also2045 * Retrieve the XFRM state (IP transform framework, see also
2046 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.2046 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.
@@ -2056,7 +2056,7 @@ union bpf_attr { · 9 unmodified lines
2056 * Return2056 * Return
2057 * 0 on success, or a negative error in case of failure.2057 * 0 on success, or a negative error in case of failure.
2058 *2058 *
2059 * int bpf_get_stack(void *ctx, void *buf, u32 size, u64 flags)2059 * long bpf_get_stack(void *ctx, void *buf, u32 size, u64 flags)
2060 * Description2060 * Description
2061 * Return a user or a kernel stack in bpf program provided buffer.2061 * Return a user or a kernel stack in bpf program provided buffer.
2062 * To achieve this, the helper needs *ctx*, which is a pointer2062 * To achieve this, the helper needs *ctx*, which is a pointer
@@ -2089,7 +2089,7 @@ union bpf_attr { · 26 unmodified lines
2089 * A non-negative value equal to or less than *size* on success,2089 * A non-negative value equal to or less than *size* on success,
2090 * or a negative error in case of failure.2090 * or a negative error in case of failure.
2091 *2091 *
2092 * int bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header)2092 * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header)
2093 * Description2093 * Description
2094 * This helper is similar to **bpf_skb_load_bytes**\ () in that2094 * This helper is similar to **bpf_skb_load_bytes**\ () in that
2095 * it provides an easy way to load *len* bytes from *offset*2095 * it provides an easy way to load *len* bytes from *offset*
@@ -2111,7 +2111,7 @@ union bpf_attr { · 15 unmodified lines
2111 * Return2111 * Return
2112 * 0 on success, or a negative error in case of failure.2112 * 0 on success, or a negative error in case of failure.
2113 *2113 *
2114 * int bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags)2114 * long bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags)
2115 * Description2115 * Description
2116 * Do FIB lookup in kernel tables using parameters in *params*.2116 * Do FIB lookup in kernel tables using parameters in *params*.
2117 * If lookup is successful and result shows packet is to be2117 * If lookup is successful and result shows packet is to be
@@ -2142,7 +2142,7 @@ union bpf_attr { · 24 unmodified lines
2142 * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the2142 * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
2143 * packet is not forwarded or needs assist from full stack2143 * packet is not forwarded or needs assist from full stack
2144 *2144 *
2145 * int bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)2145 * long bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags)
2146 * Description2146 * Description
2147 * Add an entry to, or update a sockhash *map* referencing sockets.2147 * Add an entry to, or update a sockhash *map* referencing sockets.
2148 * The *skops* is used as a new value for the entry associated to2148 * The *skops* is used as a new value for the entry associated to
@@ -2161,7 +2161,7 @@ union bpf_attr { · 12 unmodified lines
2161 * Return2161 * Return
2162 * 0 on success, or a negative error in case of failure.2162 * 0 on success, or a negative error in case of failure.
2163 *2163 *
2164 * int bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags)2164 * long bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags)
2165 * Description2165 * Description
2166 * This helper is used in programs implementing policies at the2166 * This helper is used in programs implementing policies at the
2167 * socket level. If the message *msg* is allowed to pass (i.e. if2167 * socket level. If the message *msg* is allowed to pass (i.e. if
@@ -2175,7 +2175,7 @@ union bpf_attr { · 7 unmodified lines
2175 * Return2175 * Return
2176 * **SK_PASS** on success, or **SK_DROP** on error.2176 * **SK_PASS** on success, or **SK_DROP** on error.
2177 *2177 *
2178 * int bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags)2178 * long bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags)
2179 * Description2179 * Description
2180 * This helper is used in programs implementing policies at the2180 * This helper is used in programs implementing policies at the
2181 * skb socket level. If the sk_buff *skb* is allowed to pass (i.e.2181 * skb socket level. If the sk_buff *skb* is allowed to pass (i.e.
@@ -2189,7 +2189,7 @@ union bpf_attr { · 7 unmodified lines
2189 * Return2189 * Return
2190 * **SK_PASS** on success, or **SK_DROP** on error.2190 * **SK_PASS** on success, or **SK_DROP** on error.
2191 *2191 *
2192 * int bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len)2192 * long bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len)
2193 * Description2193 * Description
2194 * Encapsulate the packet associated to *skb* within a Layer 32194 * Encapsulate the packet associated to *skb* within a Layer 3
2195 * protocol header. This header is provided in the buffer at2195 * protocol header. This header is provided in the buffer at
@@ -2226,7 +2226,7 @@ union bpf_attr { · 30 unmodified lines
2226 * Return2226 * Return
2227 * 0 on success, or a negative error in case of failure.2227 * 0 on success, or a negative error in case of failure.
2228 *2228 *
2229 * int bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len)2229 * long bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len)
2230 * Description2230 * Description
2231 * Store *len* bytes from address *from* into the packet2231 * Store *len* bytes from address *from* into the packet
2232 * associated to *skb*, at *offset*. Only the flags, tag and TLVs2232 * associated to *skb*, at *offset*. Only the flags, tag and TLVs
@@ -2241,7 +2241,7 @@ union bpf_attr { · 8 unmodified lines
2241 * Return2241 * Return
2242 * 0 on success, or a negative error in case of failure.2242 * 0 on success, or a negative error in case of failure.
2243 *2243 *
2244 * int bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta)2244 * long bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta)
2245 * Description2245 * Description
2246 * Adjust the size allocated to TLVs in the outermost IPv62246 * Adjust the size allocated to TLVs in the outermost IPv6
2247 * Segment Routing Header contained in the packet associated to2247 * Segment Routing Header contained in the packet associated to
@@ -2257,7 +2257,7 @@ union bpf_attr { · 9 unmodified lines
2257 * Return2257 * Return
2258 * 0 on success, or a negative error in case of failure.2258 * 0 on success, or a negative error in case of failure.
2259 *2259 *
2260 * int bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len)2260 * long bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len)
2261 * Description2261 * Description
2262 * Apply an IPv6 Segment Routing action of type *action* to the2262 * Apply an IPv6 Segment Routing action of type *action* to the
2263 * packet associated to *skb*. Each action takes a parameter2263 * packet associated to *skb*. Each action takes a parameter
@@ -2286,7 +2286,7 @@ union bpf_attr { · 22 unmodified lines
2286 * Return2286 * Return
2287 * 0 on success, or a negative error in case of failure.2287 * 0 on success, or a negative error in case of failure.
2288 *2288 *
2289 * int bpf_rc_repeat(void *ctx)2289 * long bpf_rc_repeat(void *ctx)
2290 * Description2290 * Description
2291 * This helper is used in programs implementing IR decoding, to2291 * This helper is used in programs implementing IR decoding, to
2292 * report a successfully decoded repeat key message. This delays2292 * report a successfully decoded repeat key message. This delays
@@ -2305,7 +2305,7 @@ union bpf_attr { · 12 unmodified lines
2305 * Return2305 * Return
2306 * 02306 * 0
2307 *2307 *
2308 * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)2308 * long bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle)
2309 * Description2309 * Description
2310 * This helper is used in programs implementing IR decoding, to2310 * This helper is used in programs implementing IR decoding, to
2311 * report a successfully decoded key press with *scancode*,2311 * report a successfully decoded key press with *scancode*,
@@ -2370,7 +2370,7 @@ union bpf_attr { · 58 unmodified lines
2370 * Return2370 * Return
2371 * A pointer to the local storage area.2371 * A pointer to the local storage area.
2372 *2372 *
2373 * int bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags)2373 * long bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags)
2374 * Description2374 * Description
2375 * Select a **SO_REUSEPORT** socket from a2375 * Select a **SO_REUSEPORT** socket from a
2376 * **BPF_MAP_TYPE_REUSEPORT_ARRAY** *map*.2376 * **BPF_MAP_TYPE_REUSEPORT_ARRAY** *map*.
@@ -2471,7 +2471,7 @@ union bpf_attr { · 94 unmodified lines
2471 * result is from *reuse*\ **->socks**\ [] using the hash of the2471 * result is from *reuse*\ **->socks**\ [] using the hash of the
2472 * tuple.2472 * tuple.
2473 *2473 *
2474 * int bpf_sk_release(struct bpf_sock *sock)2474 * long bpf_sk_release(struct bpf_sock *sock)
2475 * Description2475 * Description
2476 * Release the reference held by *sock*. *sock* must be a2476 * Release the reference held by *sock*. *sock* must be a
2477 * non-**NULL** pointer that was returned from2477 * non-**NULL** pointer that was returned from
@@ -2479,7 +2479,7 @@ union bpf_attr { · 1 unmodified line
2479 * Return2479 * Return
2480 * 0 on success, or a negative error in case of failure.2480 * 0 on success, or a negative error in case of failure.
2481 *2481 *
2482 * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)2482 * long bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
2483 * Description2483 * Description
2484 * Push an element *value* in *map*. *flags* is one of:2484 * Push an element *value* in *map*. *flags* is one of:
2485 *2485 *
@@ -2489,19 +2489,19 @@ union bpf_attr { · 3 unmodified lines
2489 * Return2489 * Return
2490 * 0 on success, or a negative error in case of failure.2490 * 0 on success, or a negative error in case of failure.
2491 *2491 *
2492 * int bpf_map_pop_elem(struct bpf_map *map, void *value)2492 * long bpf_map_pop_elem(struct bpf_map *map, void *value)
2493 * Description2493 * Description
2494 * Pop an element from *map*.2494 * Pop an element from *map*.
2495 * Return2495 * Return
2496 * 0 on success, or a negative error in case of failure.2496 * 0 on success, or a negative error in case of failure.
2497 *2497 *
2498 * int bpf_map_peek_elem(struct bpf_map *map, void *value)2498 * long bpf_map_peek_elem(struct bpf_map *map, void *value)
2499 * Description2499 * Description
2500 * Get an element from *map* without removing it.2500 * Get an element from *map* without removing it.
2501 * Return2501 * Return
2502 * 0 on success, or a negative error in case of failure.2502 * 0 on success, or a negative error in case of failure.
2503 *2503 *
2504 * int bpf_msg_push_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags)2504 * long bpf_msg_push_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags)
2505 * Description2505 * Description
2506 * For socket policies, insert *len* bytes into *msg* at offset2506 * For socket policies, insert *len* bytes into *msg* at offset
2507 * *start*.2507 * *start*.
@@ -2517,7 +2517,7 @@ union bpf_attr { · 9 unmodified lines
2517 * Return2517 * Return
2518 * 0 on success, or a negative error in case of failure.2518 * 0 on success, or a negative error in case of failure.
2519 *2519 *
2520 * int bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags)2520 * long bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags)
2521 * Description2521 * Description
2522 * Will remove *len* bytes from a *msg* starting at byte *start*.2522 * Will remove *len* bytes from a *msg* starting at byte *start*.
2523 * This may result in **ENOMEM** errors under certain situations if2523 * This may result in **ENOMEM** errors under certain situations if
@@ -2529,7 +2529,7 @@ union bpf_attr { · 5 unmodified lines
2529 * Return2529 * Return
2530 * 0 on success, or a negative error in case of failure.2530 * 0 on success, or a negative error in case of failure.
2531 *2531 *
2532 * int bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y)2532 * long bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y)
2533 * Description2533 * Description
2534 * This helper is used in programs implementing IR decoding, to2534 * This helper is used in programs implementing IR decoding, to
2535 * report a successfully decoded pointer movement.2535 * report a successfully decoded pointer movement.
@@ -2543,7 +2543,7 @@ union bpf_attr { · 7 unmodified lines
2543 * Return2543 * Return
2544 * 02544 * 0
2545 *2545 *
2546 * int bpf_spin_lock(struct bpf_spin_lock *lock)2546 * long bpf_spin_lock(struct bpf_spin_lock *lock)
2547 * Description2547 * Description
2548 * Acquire a spinlock represented by the pointer *lock*, which is2548 * Acquire a spinlock represented by the pointer *lock*, which is
2549 * stored as part of a value of a map. Taking the lock allows to2549 * stored as part of a value of a map. Taking the lock allows to
@@ -2591,7 +2591,7 @@ union bpf_attr { · 41 unmodified lines
2591 * Return2591 * Return
2592 * 02592 * 0
2593 *2593 *
2594 * int bpf_spin_unlock(struct bpf_spin_lock *lock)2594 * long bpf_spin_unlock(struct bpf_spin_lock *lock)
2595 * Description2595 * Description
2596 * Release the *lock* previously locked by a call to2596 * Release the *lock* previously locked by a call to
2597 * **bpf_spin_lock**\ (\ *lock*\ ).2597 * **bpf_spin_lock**\ (\ *lock*\ ).
@@ -2614,7 +2614,7 @@ union bpf_attr { · 16 unmodified lines
2614 * A **struct bpf_tcp_sock** pointer on success, or **NULL** in2614 * A **struct bpf_tcp_sock** pointer on success, or **NULL** in
2615 * case of failure.2615 * case of failure.
2616 *2616 *
2617 * int bpf_skb_ecn_set_ce(struct sk_buff *skb)2617 * long bpf_skb_ecn_set_ce(struct sk_buff *skb)
2618 * Description2618 * Description
2619 * Set ECN (Explicit Congestion Notification) field of IP header2619 * Set ECN (Explicit Congestion Notification) field of IP header
2620 * to **CE** (Congestion Encountered) if current value is **ECT**2620 * to **CE** (Congestion Encountered) if current value is **ECT**
@@ -2651,7 +2651,7 @@ union bpf_attr { · 30 unmodified lines
2651 * result is from *reuse*\ **->socks**\ [] using the hash of the2651 * result is from *reuse*\ **->socks**\ [] using the hash of the
2652 * tuple.2652 * tuple.
2653 *2653 *
2654 * int bpf_tcp_check_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len)2654 * long bpf_tcp_check_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len)
2655 * Description2655 * Description
2656 * Check whether *iph* and *th* contain a valid SYN cookie ACK for2656 * Check whether *iph* and *th* contain a valid SYN cookie ACK for
2657 * the listening socket in *sk*.2657 * the listening socket in *sk*.
@@ -2666,7 +2666,7 @@ union bpf_attr { · 8 unmodified lines
2666 * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative2666 * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative
2667 * error otherwise.2667 * error otherwise.
2668 *2668 *
2669 * int bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags)2669 * long bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags)
2670 * Description2670 * Description
2671 * Get name of sysctl in /proc/sys/ and copy it into provided by2671 * Get name of sysctl in /proc/sys/ and copy it into provided by
2672 * program buffer *buf* of size *buf_len*.2672 * program buffer *buf* of size *buf_len*.
@@ -2682,7 +2682,7 @@ union bpf_attr { · 9 unmodified lines
2682 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain2682 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
2683 * truncated name in this case).2683 * truncated name in this case).
2684 *2684 *
2685 * int bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len)2685 * long bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len)
2686 * Description2686 * Description
2687 * Get current value of sysctl as it is presented in /proc/sys2687 * Get current value of sysctl as it is presented in /proc/sys
2688 * (incl. newline, etc), and copy it as a string into provided2688 * (incl. newline, etc), and copy it as a string into provided
@@ -2701,7 +2701,7 @@ union bpf_attr { · 12 unmodified lines
2701 * **-EINVAL** if current value was unavailable, e.g. because2701 * **-EINVAL** if current value was unavailable, e.g. because
2702 * sysctl is uninitialized and read returns -EIO for it.2702 * sysctl is uninitialized and read returns -EIO for it.
2703 *2703 *
2704 * int bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len)2704 * long bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len)
2705 * Description2705 * Description
2706 * Get new value being written by user space to sysctl (before2706 * Get new value being written by user space to sysctl (before
2707 * the actual write happens) and copy it as a string into2707 * the actual write happens) and copy it as a string into
@@ -2718,7 +2718,7 @@ union bpf_attr { · 10 unmodified lines
2718 *2718 *
2719 * **-EINVAL** if sysctl is being read.2719 * **-EINVAL** if sysctl is being read.
2720 *2720 *
2721 * int bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len)2721 * long bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len)
2722 * Description2722 * Description
2723 * Override new value being written by user space to sysctl with2723 * Override new value being written by user space to sysctl with
2724 * value provided by program in buffer *buf* of size *buf_len*.2724 * value provided by program in buffer *buf* of size *buf_len*.
@@ -2735,7 +2735,7 @@ union bpf_attr { · 10 unmodified lines
2735 *2735 *
2736 * **-EINVAL** if sysctl is being read.2736 * **-EINVAL** if sysctl is being read.
2737 *2737 *
2738 * int bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res)2738 * long bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res)
2739 * Description2739 * Description
2740 * Convert the initial part of the string from buffer *buf* of2740 * Convert the initial part of the string from buffer *buf* of
2741 * size *buf_len* to a long integer according to the given base2741 * size *buf_len* to a long integer according to the given base
@@ -2759,7 +2759,7 @@ union bpf_attr { · 17 unmodified lines
2759 *2759 *
2760 * **-ERANGE** if resulting value was out of range.2760 * **-ERANGE** if resulting value was out of range.
2761 *2761 *
2762 * int bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res)2762 * long bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res)
2763 * Description2763 * Description
2764 * Convert the initial part of the string from buffer *buf* of2764 * Convert the initial part of the string from buffer *buf* of
2765 * size *buf_len* to an unsigned long integer according to the2765 * size *buf_len* to an unsigned long integer according to the
@@ -2810,7 +2810,7 @@ union bpf_attr { · 44 unmodified lines
2810 * **NULL** if not found or there was an error in adding2810 * **NULL** if not found or there was an error in adding
2811 * a new bpf-local-storage.2811 * a new bpf-local-storage.
2812 *2812 *
2813 * int bpf_sk_storage_delete(struct bpf_map *map, struct bpf_sock *sk)2813 * long bpf_sk_storage_delete(struct bpf_map *map, struct bpf_sock *sk)
2814 * Description2814 * Description
2815 * Delete a bpf-local-storage from a *sk*.2815 * Delete a bpf-local-storage from a *sk*.
2816 * Return2816 * Return
@@ -2818,7 +2818,7 @@ union bpf_attr { · 1 unmodified line
2818 *2818 *
2819 * **-ENOENT** if the bpf-local-storage cannot be found.2819 * **-ENOENT** if the bpf-local-storage cannot be found.
2820 *2820 *
2821 * int bpf_send_signal(u32 sig)2821 * long bpf_send_signal(u32 sig)
2822 * Description2822 * Description
2823 * Send signal *sig* to the process of the current task.2823 * Send signal *sig* to the process of the current task.
2824 * The signal may be delivered to any of this process's threads.2824 * The signal may be delivered to any of this process's threads.
@@ -2859,7 +2859,7 @@ union bpf_attr { · 34 unmodified lines
2859 *2859 *
2860 * **-EPROTONOSUPPORT** IP packet version is not 4 or 62860 * **-EPROTONOSUPPORT** IP packet version is not 4 or 6
2861 *2861 *
2862 * int bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)2862 * long bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
2863 * Description2863 * Description
2864 * Write raw *data* blob into a special BPF perf event held by2864 * Write raw *data* blob into a special BPF perf event held by
2865 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf2865 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
@@ -2883,21 +2883,21 @@ union bpf_attr { · 17 unmodified lines
2883 * Return2883 * Return
2884 * 0 on success, or a negative error in case of failure.2884 * 0 on success, or a negative error in case of failure.
2885 *2885 *
2886 * int bpf_probe_read_user(void *dst, u32 size, const void *unsafe_ptr)2886 * long bpf_probe_read_user(void *dst, u32 size, const void *unsafe_ptr)
2887 * Description2887 * Description
2888 * Safely attempt to read *size* bytes from user space address2888 * Safely attempt to read *size* bytes from user space address
2889 * *unsafe_ptr* and store the data in *dst*.2889 * *unsafe_ptr* and store the data in *dst*.
2890 * Return2890 * Return
2891 * 0 on success, or a negative error in case of failure.2891 * 0 on success, or a negative error in case of failure.
2892 *2892 *
2893 * int bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)2893 * long bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
2894 * Description2894 * Description
2895 * Safely attempt to read *size* bytes from kernel space address2895 * Safely attempt to read *size* bytes from kernel space address
2896 * *unsafe_ptr* and store the data in *dst*.2896 * *unsafe_ptr* and store the data in *dst*.
2897 * Return2897 * Return
2898 * 0 on success, or a negative error in case of failure.2898 * 0 on success, or a negative error in case of failure.
2899 *2899 *
2900 * int bpf_probe_read_user_str(void *dst, u32 size, const void *unsafe_ptr)2900 * long bpf_probe_read_user_str(void *dst, u32 size, const void *unsafe_ptr)
2901 * Description2901 * Description
2902 * Copy a NUL terminated string from an unsafe user address2902 * Copy a NUL terminated string from an unsafe user address
2903 * *unsafe_ptr* to *dst*. The *size* should include the2903 * *unsafe_ptr* to *dst*. The *size* should include the
@@ -2941,7 +2941,7 @@ union bpf_attr { · 37 unmodified lines
2941 * including the trailing NUL character. On error, a negative2941 * including the trailing NUL character. On error, a negative
2942 * value.2942 * value.
2943 *2943 *
2944 * int bpf_probe_read_kernel_str(void *dst, u32 size, const void *unsafe_ptr)2944 * long bpf_probe_read_kernel_str(void *dst, u32 size, const void *unsafe_ptr)
2945 * Description2945 * Description
2946 * Copy a NUL terminated string from an unsafe kernel address *unsafe_ptr*2946 * Copy a NUL terminated string from an unsafe kernel address *unsafe_ptr*
2947 * to *dst*. Same semantics as with **bpf_probe_read_user_str**\ () apply.2947 * to *dst*. Same semantics as with **bpf_probe_read_user_str**\ () apply.
@@ -2949,14 +2949,14 @@ union bpf_attr { · 1 unmodified line
2949 * On success, the strictly positive length of the string, including2949 * On success, the strictly positive length of the string, including
2950 * the trailing NUL character. On error, a negative value.2950 * the trailing NUL character. On error, a negative value.
2951 *2951 *
2952 * int bpf_tcp_send_ack(void *tp, u32 rcv_nxt)2952 * long bpf_tcp_send_ack(void *tp, u32 rcv_nxt)
2953 * Description2953 * Description
2954 * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**.2954 * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**.
2955 * *rcv_nxt* is the ack_seq to be sent out.2955 * *rcv_nxt* is the ack_seq to be sent out.
2956 * Return2956 * Return
2957 * 0 on success, or a negative error in case of failure.2957 * 0 on success, or a negative error in case of failure.
2958 *2958 *
2959 * int bpf_send_signal_thread(u32 sig)2959 * long bpf_send_signal_thread(u32 sig)
2960 * Description2960 * Description
2961 * Send signal *sig* to the thread corresponding to the current task.2961 * Send signal *sig* to the thread corresponding to the current task.
2962 * Return2962 * Return
@@ -2976,7 +2976,7 @@ union bpf_attr { · 13 unmodified lines
2976 * Return2976 * Return
2977 * The 64 bit jiffies2977 * The 64 bit jiffies
2978 *2978 *
2979 * int bpf_read_branch_records(struct bpf_perf_event_data *ctx, void *buf, u32 size, u64 flags)2979 * long bpf_read_branch_records(struct bpf_perf_event_data *ctx, void *buf, u32 size, u64 flags)
2980 * Description2980 * Description
2981 * For an eBPF program attached to a perf event, retrieve the2981 * For an eBPF program attached to a perf event, retrieve the
2982 * branch records (**struct perf_branch_entry**) associated to *ctx*2982 * branch records (**struct perf_branch_entry**) associated to *ctx*
@@ -2995,7 +2995,7 @@ union bpf_attr { · 12 unmodified lines
2995 *2995 *
2996 * **-ENOENT** if architecture does not support branch records.2996 * **-ENOENT** if architecture does not support branch records.
2997 *2997 *
2998 * int bpf_get_ns_current_pid_tgid(u64 dev, u64 ino, struct bpf_pidns_info *nsdata, u32 size)2998 * long bpf_get_ns_current_pid_tgid(u64 dev, u64 ino, struct bpf_pidns_info *nsdata, u32 size)
2999 * Description2999 * Description
3000 * Returns 0 on success, values for *pid* and *tgid* as seen from the current3000 * Returns 0 on success, values for *pid* and *tgid* as seen from the current
3001 * *namespace* will be returned in *nsdata*.3001 * *namespace* will be returned in *nsdata*.
@@ -3007,7 +3007,7 @@ union bpf_attr { · 5 unmodified lines
3007 *3007 *
3008 * **-ENOENT** if pidns does not exists for the current task.3008 * **-ENOENT** if pidns does not exists for the current task.
3009 *3009 *
3010 * int bpf_xdp_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)3010 * long bpf_xdp_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size)
3011 * Description3011 * Description
3012 * Write raw *data* blob into a special BPF perf event held by3012 * Write raw *data* blob into a special BPF perf event held by
3013 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf3013 * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf
@@ -3062,7 +3062,7 @@ union bpf_attr { · 48 unmodified lines
3062 * Return3062 * Return
3063 * The id is returned or 0 in case the id could not be retrieved.3063 * The id is returned or 0 in case the id could not be retrieved.
3064 *3064 *
3065 * int bpf_sk_assign(struct sk_buff *skb, struct bpf_sock *sk, u64 flags)3065 * long bpf_sk_assign(struct sk_buff *skb, struct bpf_sock *sk, u64 flags)
3066 * Description3066 * Description
3067 * Assign the *sk* to the *skb*. When combined with appropriate3067 * Assign the *sk* to the *skb*. When combined with appropriate
3068 * routing configuration to receive the packet towards the socket,3068 * routing configuration to receive the packet towards the socket,
@@ -3097,7 +3097,7 @@ union bpf_attr { · 28 unmodified lines
3097 * Return3097 * Return
3098 * Current *ktime*.3098 * Current *ktime*.
3099 *3099 *
3100 * int bpf_seq_printf(struct seq_file *m, const char *fmt, u32 fmt_size, const void *data, u32 data_len)3100 * long bpf_seq_printf(struct seq_file *m, const char *fmt, u32 fmt_size, const void *data, u32 data_len)
3101 * Description3101 * Description
3102 * **bpf_seq_printf**\ () uses seq_file **seq_printf**\ () to print3102 * **bpf_seq_printf**\ () uses seq_file **seq_printf**\ () to print
3103 * out the format string.3103 * out the format string.
@@ -3126,7 +3126,7 @@ union bpf_attr { · 22 unmodified lines
3126 *3126 *
3127 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.3127 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
3128 *3128 *
3129 * int bpf_seq_write(struct seq_file *m, const void *data, u32 len)3129 * long bpf_seq_write(struct seq_file *m, const void *data, u32 len)
3130 * Description3130 * Description
3131 * **bpf_seq_write**\ () uses seq_file **seq_write**\ () to write the data.3131 * **bpf_seq_write**\ () uses seq_file **seq_write**\ () to write the data.
3132 * The *m* represents the seq_file. The *data* and *len* represent the3132 * The *m* represents the seq_file. The *data* and *len* represent the
@@ -3221,7 +3221,7 @@ union bpf_attr { · 88 unmodified lines
3221 * Return3221 * Return
3222 * Requested value, or 0, if flags are not recognized.3222 * Requested value, or 0, if flags are not recognized.
3223 *3223 *
3224 * int bpf_csum_level(struct sk_buff *skb, u64 level)3224 * long bpf_csum_level(struct sk_buff *skb, u64 level)
3225 * Description3225 * Description
3226 * Change the skbs checksum level by one layer up or down, or3226 * Change the skbs checksum level by one layer up or down, or
3227 * reset it entirely to none in order to have the stack perform3227 * reset it entirely to none in order to have the stack perform