Lines Matching +full:five +full:- +full:cell

1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
21 #define BPF_DW 0x18 /* double word (64-bit) */
23 #define BPF_ATOMIC 0xc0 /* atomic memory ops - op type in immediate */
24 #define BPF_XADD 0xc0 /* exclusive add - legacy name */
32 #define BPF_TO_LE 0x00 /* convert to little-endian */
33 #define BPF_TO_BE 0x08 /* convert to big-endian */
52 #define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
54 #define BPF_LOAD_ACQ 0x100 /* load-acquire */
55 #define BPF_STORE_REL 0x110 /* store-release */
77 /* BPF has 10 general purpose 64-bit registers and stack frame. */
119 BPF_CGROUP_ITER_DESCENDANTS_PRE, /* walk descendants in pre-order. */
120 BPF_CGROUP_ITER_DESCENDANTS_POST, /* walk descendants in post-order. */
131 /* At most one of cgroup_fd and cgroup_id can be non-zero. If
147 /* BPF syscall commands, see bpf(2) man-page for more details. */
162 * map. The close-on-exec file descriptor flag (see **fcntl**\ (2))
169 * A new file descriptor (a nonnegative integer), or -1 if an
181 * Look up the value of a spin-locked map without
186 * Returns zero on success. On error, -1 is returned and *errno*
203 * Update a spin_lock-ed map element.
206 * Returns zero on success. On error, -1 is returned and *errno*
227 * Returns zero on success. On error, -1 is returned and *errno*
237 * Returns zero on success. On error, -1 is returned and *errno*
247 * * If *key* is the last element, returns -1 and *errno* is set
261 * The close-on-exec file descriptor flag (see **fcntl**\ (2)) is
265 * A new file descriptor (a nonnegative integer), or -1 if an
290 * Returns zero on success. On error, -1 is returned and *errno*
299 * A new file descriptor (a nonnegative integer), or -1 if an
345 * Returns zero on success. On error, -1 is returned and *errno*
355 * Returns zero on success. On error, -1 is returned and *errno*
387 * Returns zero on success. On error, -1 is returned and *errno*
402 * remain with ids higher than *start_id*, returns -1 and sets
406 * Returns zero on success. On error, or when no id remains, -1
415 * remain with ids higher than *start_id*, returns -1 and sets
419 * Returns zero on success. On error, or when no id remains, -1
428 * A new file descriptor (a nonnegative integer), or -1 if an
437 * A new file descriptor (a nonnegative integer), or -1 if an
455 * Returns zero on success. On error, -1 is returned and *errno*
501 * Returns zero on success. On error, -1 is returned and *errno*
519 * A new file descriptor (a nonnegative integer), or -1 if an
542 * A new file descriptor (a nonnegative integer), or -1 if an
551 * A new file descriptor (a nonnegative integer), or -1 if an
572 * Returns zero on success. On error, -1 is returned and *errno*
585 * Look up and delete the value of a spin-locked map
604 * Returns zero on success. On error, -1 is returned and *errno*
619 * Returns zero on success. On error, -1 is returned and *errno*
629 * remain with ids higher than *start_id*, returns -1 and sets
633 * Returns zero on success. On error, or when no id remains, -1
661 * Look up the value of a spin-locked map without
673 * Returns zero on success. On error, -1 is returned and *errno*
678 * iteration of a hash-based map type.
695 * Returns zero on success. On error, -1 is returned and *errno*
722 * Update spin_lock-ed map elements. This must be
731 * Returns zero on success. On error, -1 is returned and *errno*
765 * Look up the value of a spin-locked map without
777 * Returns zero on success. On error, -1 is returned and *errno*
787 * A new file descriptor (a nonnegative integer), or -1 if an
796 * Returns zero on success. On error, -1 is returned and *errno*
805 * A new file descriptor (a nonnegative integer), or -1 if an
814 * remain with ids higher than *start_id*, returns -1 and sets
818 * Returns zero on success. On error, or when no id remains, -1
833 * disabled system-wide when all outstanding file descriptors
837 * A new file descriptor (a nonnegative integer), or -1 if an
852 * A new file descriptor (a nonnegative integer), or -1 if an
861 * Returns zero on success. On error, -1 is returned and *errno*
876 * Returns zero on success. On error, -1 is returned and *errno*
882 * BPF-related functionality it allows:
883 * - a set of allowed bpf() syscall commands;
884 * - a set of allowed BPF map types to be created with
886 * - a set of allowed BPF program types and BPF program attach
906 * A new file descriptor (a nonnegative integer), or -1 if an
990 * both cgroup-attached and other progs and supports all functionality
1162 /* cgroup-bpf attach flags used in BPF_PROG_ATTACH command
1166 * BPF_F_ALLOW_OVERRIDE: If a sub-cgroup installs some bpf program,
1167 * the program in this cgroup yields to sub-cgroup program.
1169 * BPF_F_ALLOW_MULTI: If a sub-cgroup installs some bpf program,
1180 * The programs of sub-cgroup are executed first, then programs of
1190 * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups.
1191 * A cgroup with NONE doesn't allow any programs in sub-cgroups.
1193 * cgrp1 (MULTI progs A, B) ->
1194 * cgrp2 (OVERRIDE prog C) ->
1195 * cgrp3 (MULTI prog D) ->
1196 * cgrp4 (OVERRIDE prog E) ->
1238 * Verifier does sub-register def/use analysis and identifies instructions whose
1239 * def only matters for low 32-bit, high 32-bit is never referenced later
1240 * through implicit zero extension. Therefore verifier notifies JIT back-ends
1241 * that it is safe to ignore clearing high 32-bit for these instructions. This
1242 * saves some back-ends a lot of code-gen. However such optimization is not
1243 * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends
1249 * 32-bit for those instructions who has been identified as safe to ignore them.
1272 * program becomes device-bound but can access XDP metadata.
1343 /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
1347 /* when bpf_call->src_reg == BPF_PSEUDO_KFUNC_CALL,
1348 * bpf_call->imm == btf_id of a BTF_KIND_FUNC in the running kernel
1361 BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */
1384 /* Zero-initialize hash function seed. This should only be used for testing. */
1394 /* Enable memory-mapping BPF map */
1484 __u32 btf_vmlinux_value_type_id;/* BTF type_id of a kernel-
1488 /* Any per-map-type extra fields
1490 * BPF_MAP_TYPE_BLOOM_FILTER - the lowest 4 bits indicate the
1494 * BPF_MAP_TYPE_ARENA - contains the address where user space
1560 __u32 attach_btf_id; /* in-kernel BTF type id to attach to */
1586 * then the fd_array[0,...,fd_array_cnt-1] is expected to be
1678 /* output: per-program attach_flags.
1746 /* black box user-provided value passed through
1762 /* black box user-provided value passed through
1853 * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst
1854 * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7
1855 * $ man /tmp/bpf-helpers.7
1915 * This helper is a "printk()-like" facility for debugging. It
1920 * limited to five).
1933 * telnet-470 [001] .N.. 419421.045894: 0x00000001: <formatted msg>
1958 * helper will return **-EINVAL** (but print nothing) if it
1974 * Get a pseudo-random number.
1977 * pseudo-random internal state, and cannot be used to infer the
1982 * A random 32-bit unsigned value.
2001 * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
2002 * **->swhash** and *skb*\ **->l4hash** to 0).
2025 * which does not update the checksum in-place, but offers more
2054 * the checksum is to be computed against a pseudo-header.
2057 * which does not update the checksum in-place, but offers more
2130 * A 64-bit integer containing the current tgid and pid, and
2132 * *current_task*\ **->tgid << 32 \|**
2133 * *current_task*\ **->pid**.
2139 * A 64-bit integer containing the current GID and UID, and
2148 * helper makes sure that the *buf* is NUL-terminated. On failure,
2161 * based on a user-provided identifier for all traffic coming from
2164 * *Documentation/admin-guide/cgroup-v1/net_cls.rst*.
2170 * run on cgroups, which is a cgroup-v2-only feature (a socket can
2222 * in *key*\ **->remote_ipv4** or *key*\ **->remote_ipv6**. Also,
2223 * this struct exposes the *key*\ **->tunnel_id**, which is
2304 * is the number of available CPUs, and each cell contains a value
2354 * identifier retrieved is a user-provided tag, similar to the
2360 * (see also **tc-bpf(8)**), or alternatively on conventional
2428 * manipulated with *skb*\ **->data** and *skb*\ **->data_end**
2459 * generating a variety of graphs (such as flame graphs or off-cpu
2517 * and retrieving arbitrary TLVs (Type-Length-Value headers) from
2563 * comes down to setting *skb*\ **->pkt_type** to *type*, except
2565 * **->pkt_type** beside this helper. Using a helper here allows
2600 * Retrieve the hash of the packet, *skb*\ **->hash**. If it is
2603 * directly with *skb*\ **->hash**.
2612 * The 32-bit hash.
2627 * security mechanism because of TOC-TOU attacks, but rather to
2628 * debug, divert, and manipulate execution of semi-cooperative
2677 * Pull in non-linear data in case the *skb* is non-linear and not
2687 * are within packet boundaries (test on *skb*\ **->data_end**) is
2689 * data is in non-linear parts of the *skb*. On failure the
2690 * program can just bail out, or in the case of a non-linear
2694 * to pull in once the non-linear parts, then retesting and
2714 * Add the checksum *csum* into *skb*\ **->csum** in case the
2726 * Invalidate the current *skb*\ **->hash**. It can be used after
2768 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that
2804 * A 8-byte long unique number on success, or 0 if the socket
2812 * A 8-byte long unique number.
2819 * A 8-byte long unique number.
2827 * A 8-byte long unique number or 0 if *sk* is NULL.
2835 * time-wait or a request socket instead), **overflowuid** value
2841 * Set the full hash for *skb* (set the field *skb*\ **->hash**)
2996 * Adjust the address pointed by *xdp_md*\ **->data_meta** by
2998 * operation modifies the address stored in *xdp_md*\ **->data**,
3002 * The use of *xdp_md*\ **->data_meta** is optional and programs
3008 * this up for further post-processing. Since TC works with socket
3030 * available CPUs, and each cell contains a value relative to one
3042 * **->enabled** and *buf*\ **->running**, respectively) are
3156 * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)**
3167 * Code **-EINVAL** if the socket is not a full TCP socket;
3207 * *bytes* will be sent and the eBPF program will be re-run with
3215 * a non-zero value, this is not a problem because data is not
3230 * 1-byte long message segments. Obviously, this is bad for
3240 * For socket policies, pull in non-linear data from user space
3241 * for *msg* and set pointers *msg*\ **->data** and *msg*\
3242 * **->data_end** to *start* and *end* bytes offsets into *msg*,
3278 * domain (*addr*\ **->sa_family**) must be **AF_INET** (or
3280 * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like
3282 * port as long as 4-tuple is unique. Passing non-zero port might
3289 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is
3304 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.
3341 * adjusted by adding (sh_addr - sh_offset), where
3357 * The non-negative copied *buf* length equal to or less than
3376 * in socket filters where *skb*\ **->data** does not always point
3403 * Use the routing table ID present in *params*->tbid
3409 * Skip the neighbour table lookup. *params*->dmac
3410 * and *params*->smac will not be set as output. A common
3414 * Derive and set source IP addr in *params*->ipv{4,6}_src
3417 * case, *params*->dmac and *params*->smac are not set either.
3419 * Use the mark present in *params*->mark for the fib lookup.
3432 * was exceeded and output params->mtu_result contains the MTU.
3557 * End.X action: Endpoint with Layer-3 cross-connect.
3631 * to the same 64-bit id.
3644 * A 64-bit integer containing the current cgroup id based
3696 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3704 * **sizeof**\ (*tuple*\ **->ipv4**)
3706 * **sizeof**\ (*tuple*\ **->ipv6**)
3709 * If the *netns* is a negative signed 32-bit integer, then the
3713 * If *netns* is any other signed 32-bit value greater than or
3716 * range of 32-bit integers are reserved for future use.
3726 * result is from *reuse*\ **->socks**\ [] using the hash of the
3733 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3741 * **sizeof**\ (*tuple*\ **->ipv4**)
3743 * **sizeof**\ (*tuple*\ **->ipv6**)
3746 * If the *netns* is a negative signed 32-bit integer, then the
3750 * If *netns* is any other signed 32-bit value greater than or
3753 * range of 32-bit integers are reserved for future use.
3763 * result is from *reuse*\ **->socks**\ [] using the hash of the
3769 * non-**NULL** pointer that was returned from
3859 * allowed inside a spinlock-ed region.
3882 * * **bpf_spin_lock** is not allowed in inner maps of map-in-map.
3931 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3943 * result is from *reuse*\ **->socks**\ [] using the hash of the
3967 * The buffer is always NUL terminated, unless it's zero-sized.
3975 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3987 * The buffer is always NUL terminated, unless it's zero-sized.
3991 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3994 * **-EINVAL** if current value was unavailable, e.g. because
3995 * sysctl is uninitialized and read returns -EIO for it.
4005 * The buffer is always NUL terminated, unless it's zero-sized.
4009 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
4012 * **-EINVAL** if sysctl is being read.
4027 * **-E2BIG** if the *buf_len* is too big.
4029 * **-EINVAL** if sysctl is being read.
4039 * optional '**-**' sign.
4041 * Five least significant bits of *flags* encode base, other bits
4050 * **-EINVAL** if no valid digits were found or unsupported base
4053 * **-ERANGE** if resulting value was out of range.
4064 * Five least significant bits of *flags* encode base, other bits
4073 * **-EINVAL** if no valid digits were found or unsupported base
4076 * **-ERANGE** if resulting value was out of range.
4080 * Get a bpf-local-storage from a *sk*.
4090 * the *map*. The *map* is used as the bpf-local-storage
4091 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4092 * searched against all bpf-local-storages residing at *sk*.
4098 * used such that a new bpf-local-storage will be
4101 * the initial value of a bpf-local-storage. If *value* is
4102 * **NULL**, the new bpf-local-storage will be zero initialized.
4104 * A bpf-local-storage pointer is returned on success.
4107 * a new bpf-local-storage.
4111 * Delete a bpf-local-storage from a *sk*.
4115 * **-ENOENT** if the bpf-local-storage cannot be found.
4116 * **-EINVAL** if sk is not a fullsock (e.g. a request_sock).
4125 * **-EBUSY** if work queue under nmi is full.
4127 * **-EINVAL** if *sig* is invalid.
4129 * **-EPERM** if no permission to send the *sig*.
4131 * **-EAGAIN** if bpf program can try again.
4152 * **-EINVAL** SYN cookie cannot be issued due to error
4154 * **-ENOENT** SYN cookie should not be issued (no SYN flood)
4156 * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies
4158 * **-EPROTONOSUPPORT** IP packet version is not 4 or 6
4177 * *ctx* is a pointer to in-kernel struct sk_buff.
4204 * string length is larger than *size*, just *size*-1 bytes are
4219 * ctx->di);
4234 * *current*\ **->mm->arg_start** and *current*\
4235 * **->mm->env_start**: using this helper and the return value,
4252 * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**.
4263 * **-EBUSY** if work queue under nmi is full.
4265 * **-EINVAL** if *sig* is invalid.
4267 * **-EPERM** if no permission to send the *sig*.
4269 * **-EAGAIN** if bpf program can try again.
4291 * **-EINVAL** if arguments invalid or **size** not a multiple
4294 * **-ENOENT** if architecture does not support branch records.
4303 * **-EINVAL** if dev and inum supplied don't match dev_t and inode number
4306 * **-ENOENT** if pidns does not exists for the current task.
4325 * *ctx* is a pointer to in-kernel struct xdp_buff.
4343 * A 8-byte long opaque number.
4382 * **-EINVAL** if specified *flags* are not supported.
4384 * **-ENOENT** if the socket is unavailable for assignment.
4386 * **-ENETUNREACH** if the socket is unreachable (wrong netns).
4388 * **-EOPNOTSUPP** if the operation is not supported, for example
4404 * that are not v6-only can be selected for IPv4 packets.
4417 * load-balancing within reuseport group for the socket
4420 * On success *ctx->sk* will point to the selected socket.
4425 * * **-EAFNOSUPPORT** if socket family (*sk->family*) is
4426 * not compatible with packet family (*ctx->family*).
4428 * * **-EEXIST** if socket has been already selected,
4432 * * **-EINVAL** if unsupported flags were specified.
4434 * * **-EPROTOTYPE** if socket L4 protocol
4435 * (*sk->protocol*) doesn't match packet protocol
4436 * (*ctx->protocol*).
4438 * * **-ESOCKTNOSUPPORT** if socket is not in allowed
4458 * The *data_len* is the size of *data* in bytes - must be a multiple of 8.
4469 * **-EBUSY** if per-CPU memory copy buffer is busy, can try again
4472 * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported.
4474 * **-E2BIG** if *fmt* contains too many format specifiers.
4476 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4486 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4492 * *sk* must be a non-**NULL** pointer to a socket, e.g. one
4530 * An adaptive notification is a notification sent whenever the user-space
4531 * process has caught up and consumed all available payloads. In case the user-space
4608 * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs
4610 * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs
4612 * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and
4614 * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current
4615 * skb->csum_level.
4618 * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level
4619 * is returned or the error code -EACCES in case the skb is not
4656 * the current task; all other tasks will return -EOPNOTSUPP.
4684 * The non-negative copied *buf* length equal to or less than
4693 * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops**
4695 * *skops*\ **->op**.
4705 * the 2nd byte which is "kind-length" of a TCP
4706 * header option and the "kind-length" also
4707 * includes the first 2 bytes "kind" and "kind-length"
4716 * Note, kind-length must be 0 for regular option.
4718 * Searching for No-Op (0) and End-of-Option-List (1) are
4727 * saved_syn packet or the just-received syn packet.
4734 * **-EINVAL** if a parameter is invalid.
4736 * **-ENOMSG** if the option is not found.
4738 * **-ENOENT** if no syn packet is available when
4741 * **-ENOSPC** if there is not enough space. Only *len* number of
4744 * **-EFAULT** on failure to parse the header options in the
4747 * **-EPERM** if the helper cannot be used under the current
4748 * *skops*\ **->op**.
4756 * includes the kind, kind-length, and the actual
4757 * option data. The *len* must be at least kind-length
4758 * long. The kind-length does not have to be 4 byte
4760 * and setting the 4 bytes aligned value to th->doff.
4771 * **-EINVAL** If param is invalid.
4773 * **-ENOSPC** if there is not enough space in the header.
4776 * **-EEXIST** if the option already exists.
4778 * **-EFAULT** on failure to parse the existing header options.
4780 * **-EPERM** if the helper cannot be used under the current
4781 * *skops*\ **->op**.
4798 * **-EINVAL** if a parameter is invalid.
4800 * **-ENOSPC** if there is not enough space in the header.
4802 * **-EPERM** if the helper cannot be used under the current
4803 * *skops*\ **->op**.
4817 * the *map*. The *map* is used as the bpf-local-storage
4818 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4839 * **-ENOENT** if the bpf_local_storage cannot be found.
4862 * Use BTF to store a string representation of *ptr*->ptr in *str*,
4863 * using *ptr*->type_id. This value should specify the type
4864 * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1)
4867 * stored in the first *str_size* - 1 bytes of *str*. Safe copy of
4888 * show zero-valued struct/union members; they
4899 * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf().
4971 * *skb*\ **->mark** and *skb*\ **->tstamp** are not cleared during
4994 * the *map*. The *map* is used as the bpf-local-storage
4995 * "type". The bpf-local-storage "type" (i.e. the *map*) is
5016 * **-ENOENT** if the bpf_local_storage cannot be found.
5034 * **-EINVAL** if invalid *flags* are passed, zero otherwise.
5038 * Return a coarse-grained version of the time elapsed since
5053 * **-EOPNOTSUPP** if IMA is disabled or **-EINVAL** if
5088 * this value is L3 as this correlate to MTU and IP-header tot_len
5107 * possible for the skb packet to get re-segmented
5117 * MTU value in your BPF-code.
5134 * **map**, **callback_ctx** and other map-specific parameters.
5157 * The number of traversed map elements for success, **-EINVAL** for
5163 * based on a format string stored in a read-only map pointed by
5169 * array. The *data_len* is the size of *data* in bytes - must be
5184 * be zero-terminated except when **str_size** is 0.
5186 * Or **-EBUSY** if the per-CPU memory copy buffer is busy.
5216 * **-EBUSY** if *timer* is already initialized.
5217 * **-EINVAL** if invalid *flags* are passed.
5218 * **-EPERM** if *timer* is in a map that doesn't have any user references.
5228 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
5229 * **-EPERM** if *timer* is in a map that doesn't have any user references.
5245 * decremented. This is done to make sure that Ctrl-C of a user
5247 * bpffs the callback_fn can re-arm itself indefinitely.
5250 * The map can contain timers that invoke callback_fn-s from different
5265 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier
5274 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
5275 * **-EDEADLK** if callback_fn tried to call bpf_timer_cancel() on its
5298 * - kprobe/uprobe;
5299 * - tracepoint;
5300 * - perf_event.
5328 * **-EINVAL** if *flags* is not zero.
5330 * **-ENOENT** if architecture does not support branch records.
5355 * **-EINVAL** if *flags* is not zero.
5357 * **-EINVAL** if string *name* is not the same size as *name_sz*.
5359 * **-ENOENT** if symbol is not found.
5361 * **-EPERM** if caller does not have permission to obtain kernel address.
5378 * **-ENOENT** if *task->mm* is NULL, or no vma contains *addr*.
5379 * **-EBUSY** if failed to try lock mmap_lock.
5380 * **-EINVAL** for invalid **flags**.
5395 * is zero-indexed.
5403 * The number of loops performed, **-EINVAL** for invalid **flags**,
5404 * **-E2BIG** if **nr_loops** exceeds the maximum number of loops.
5409 * to be null-terminated and **s1_sz** is the maximum storage
5410 * size of **s1**. **s2** must be a read-only string.
5418 * Get **n**-th argument register (zero based) of the traced function (for tracing programs)
5423 * **-EINVAL** if n >= argument register count of traced function.
5432 * **-EOPNOTSUPP** for tracing programs other than BPF_TRACE_FEXIT or BPF_MODIFY_RETURN.
5461 * bpf_set_retval(-EPERM);
5464 * In this case, the BPF program's return value will use helper's -EPERM. This
5504 * Change the __sk_buff->tstamp_type to *tstamp_type*
5505 * and set *tstamp* to the __sk_buff->tstamp together.
5507 * If there is no need to change the __sk_buff->tstamp_type,
5508 * the tstamp value can be directly written to __sk_buff->tstamp
5519 * Only IPv4 and IPv6 skb->protocol are supported.
5522 * mono delivery time to __sk_buff->tstamp and then
5524 * changing the (rcv) timestamp in __sk_buff->tstamp at
5526 * to sch_fq@phy-dev.
5529 * **-EINVAL** for invalid input
5530 * **-EOPNOTSUPP** for unsupported protocol
5539 * **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if
5576 * 0 on success, -E2BIG if the size exceeds DYNPTR_MAX_SIZE,
5577 * -EINVAL if flags is not 0.
5593 * through the dynptr interface. This is a no-op if the dynptr is
5604 * interface. This is a no-op if the dynptr is invalid/null.
5617 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5618 * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
5626 * *flags* must be 0 except for skb-type dynptrs.
5628 * For skb-type dynptrs:
5637 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5638 * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
5639 * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs,
5653 * read-only, if the dynptr is invalid, or if the offset and length
5674 * **-EINVAL** if *th_len* is invalid.
5694 * **-EINVAL** if *th_len* is invalid.
5696 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5711 * **-EACCES** if the SYN cookie is not valid.
5726 * **-EACCES** if the SYN cookie is not valid.
5728 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5732 * A nonsettable system-wide clock derived from wall-clock time but
5757 * buffer. If a user-space producer was epoll-waiting on this map,
5767 * **-EBUSY** if the ring buffer is contended, and another calling
5770 * **-EINVAL** if user-space is not properly tracking the ring
5775 * **-E2BIG** if user-space has tried to publish a sample which is
5790 * In reality, the local-storage value is embedded directly inside of the
5792 * **BPF_MAP_TYPE_CGRP_STORAGE** map. When the local-storage value is
5794 * O(n) iteration over all of the live local-storage values for that
5795 * *cgroup* object until the local-storage value for the *map* is found.
5815 * **-ENOENT** if the bpf_local_storage cannot be found.
6035 /* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't
6114 BPF_F_CURRENT_NETNS = (-1L),
6233 /* The enum used in skb->tstamp_type. It specifies the clock type
6234 * of the time stored in the skb->tstamp.
6243 * the bpf prog can try to deduce it by ingress/egress/skb->sk->sk_clockid.
6247 /* user accessible mirror of in-kernel sk_buff.
6311 /* user accessible mirror of in-kernel xfrm_state.
6326 * The values are binary compatible with their TC_ACT_* counter-part to
6336 /* 3-6 reserved */
6438 * their TC_ACT_* counter-parts. For compatibility in behavior, unknown
6442 TCX_NEXT = -1,
6475 __u32 ingress_ifindex; /* rxq->dev->ifindex */
6476 __u32 rx_queue_index; /* rxq->queue_index */
6478 __u32 egress_ifindex; /* txq->dev->ifindex */
6481 /* DEVMAP map-value layout
6483 * The struct data-layout of map-value is a configuration interface.
6494 /* CPUMAP map-value layout
6496 * The struct data-layout of map-value is a configuration interface.
6541 * Note that the directly accessible bytes (data_end - data)
6554 /* When reuse->migrating_sk is NULL, it is selecting a sk for the
6556 * the received SYN in the TCP case). reuse->sk is one of the sk
6557 * in the reuseport group. The bpf prog can use reuse->sk to learn
6560 * When reuse->migrating_sk is not NULL, reuse->sk is closed and
6561 * reuse->migrating_sk is the socket that needs to be migrated
6563 * sk that is fully established or a reqsk that is in-the-middle
6564 * of 3-way handshake.
6769 __u32 user_family; /* Allows 4-byte read, but no write. */
6770 __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write.
6773 __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
6776 __u32 user_port; /* Allows 1,2,4-byte read and 4-byte write.
6779 __u32 family; /* Allows 4-byte read, but no write */
6780 __u32 type; /* Allows 4-byte read, but no write */
6781 __u32 protocol; /* Allows 4-byte read, but no write */
6782 __u32 msg_src_ip4; /* Allows 1,2,4-byte read and 4-byte write.
6785 __u32 msg_src_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
6881 * called under sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB
6889 * mode and required the active side to resend the bpf-written
6890 * options. The active side can keep writing the bpf-options until
6901 * sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB.
6911 * sock_ops->op == BPF_SOCK_OPS_HDR_OPT_LEN_CB. Then
6913 * under sock_ops->op == BPF_SOCK_OPS_WRITE_HDR_OPT_CB.
6929 SK_BPF_CB_MASK = (SK_BPF_CB_TX_TIMESTAMPING - 1) |
6938 BPF_SOCK_OPS_TIMEOUT_INIT, /* Should return SYN-RTO value to use or
6939 * -1 if default value should be used
6942 * window (in packets) or -1 if default
6994 * sock_ops->skb_data:
7008 * sock_ops->skb_data:
7012 * sock_ops->skb_tcp_flags:
7023 * sock_ops->skb_data:
7028 * earlier bpf-progs.
7030 * sock_ops->skb_tcp_flags:
7043 * earlier bpf-progs.
7105 * 1. the just-received SYN packet (only available when writing the
7119 * If the bpf-prog does not need the IP[46] header, the
7120 * bpf-prog can avoid parsing the IP header by using
7121 * TCP_BPF_SYN. Otherwise, the bpf-prog can get both
7125 * -ENOSPC: Not enough space in optval. Only optlen number of
7127 * -ENOENT: The SYN skb is not available now and the earlier SYN pkt
7216 /* set if lookup is to consider L4 data - e.g., FIB rules */
7223 __u16 tot_len; /* L3 length from network hdr (iph->tot_len) */
7276 /* 2 4-byte holes for input */
7305 BPF_MTU_CHK_RET_SEGS_TOOBIG, /* GSO re-segmentation needed to fwd */
7401 * Allows 1,2,4-byte read, but no write.
7404 * Allows 1,2,4-byte read an 4-byte write.
7428 __u64 cookie; /* Non-zero if socket was selected in PROG_TEST_RUN */
7446 * via the bpf_snprintf_btf() helper described above. A flags field -
7448 * (rather than its mode of display) - is included for future use.
7449 * Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately.
7459 * - BTF_F_COMPACT: no formatting around type information
7460 * - BTF_F_NONAME: no struct/union member names/types
7461 * - BTF_F_PTR_RAW: show raw (unobfuscated) pointer values;
7463 * - BTF_F_ZERO: show zero-valued struct/union members; they
7481 BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */
7482 BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */
7483 BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */
7497 * CO-RE relocation captures the following data:
7498 * - insn_off - instruction offset (in bytes) within a BPF program that needs
7499 * its insn->imm field to be relocated with actual field info;
7500 * - type_id - BTF type ID of the "root" (containing) entity of a relocatable
7502 * - access_str_off - offset into corresponding .BTF string section. String
7504 * - for field-based relocations, string encodes an accessed field using
7508 * - for type-based relocations, strings is expected to be just "0";
7509 * - for enum value-based relocations, string contains an index of enum
7511 * - kind - one of enum bpf_core_relo_kind;
7522 * int *x = &s->a; // encoded as "0:0" (a is field #0)
7523 * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1,
7525 * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array)
7531 * Clang built-in, passing expression that captures field address, e.g.:
7534 * __builtin_preserve_access_index(&src->a.b.c));
7539 * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction
7550 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
7552 * - BPF_F_TIMER_CPU_PIN: Timer will be pinned to the CPU of the caller.
7569 * - BPF_F_PAD_ZEROS: Pad destination buffer with zeros. (See the respective