History

uapi/bpf: Add missing description and returns for helper documentation

Both description and returns section will become mandatory for helpers and syscalls in a later commit to generate man pages. This commit also adds in the documentation that BPF_PROG_RUN is an alias for BPF_PROG_TEST_RUN for anyone searching for the syscall in the generated man pages.

Usama Arif committed 4 years ago

Commit e40fbbf1 parent b6620002 files · +30 −0Browse files

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

Unified · Split

tools/include/uapi/linux/bpf.h+15−0
@@ -330,6 +330,8 @@ union bpf_iter_link_info { · 329 unmodified lines
330330 * *ctx_out*, *data_in* and *data_out* must be NULL.
331331 * *repeat* must be zero.
332332 *
333+ * BPF_PROG_RUN is an alias for BPF_PROG_TEST_RUN.
334+ *
333335 * Return
334336 * Returns zero on success. On error, -1 is returned and *errno*
335337 * is set appropriately.
@@ -1775,6 +1777,8 @@ union bpf_attr { · 1439 unmodified lines
17751777 * 0 on success, or a negative error in case of failure.
17761778 *
17771779 * u64 bpf_get_current_pid_tgid(void)
1780+ * Description
1781+ * Get the current pid and tgid.
17781782 * Return
17791783 * A 64-bit integer containing the current tgid and pid, and
17801784 * created as such:
@@ -1782,6 +1786,8 @@ union bpf_attr { · 1 unmodified line
17821786 * *current_task*\ **->pid**.
17831787 *
17841788 * u64 bpf_get_current_uid_gid(void)
1789+ * Description
1790+ * Get the current uid and gid.
17851791 * Return
17861792 * A 64-bit integer containing the current GID and UID, and
17871793 * created as such: *current_gid* **<< 32 \|** *current_uid*.
@@ -2256,6 +2262,8 @@ union bpf_attr { · 468 unmodified lines
22562262 * The 32-bit hash.
22572263 *
22582264 * u64 bpf_get_current_task(void)
2265+ * Description
2266+ * Get the current task.
22592267 * Return
22602268 * A pointer to the current task struct.
22612269 *
@@ -2369,6 +2377,8 @@ union bpf_attr { · 107 unmodified lines
23692377 * indicate that the hash is outdated and to trigger a
23702378 * recalculation the next time the kernel tries to access this
23712379 * hash or when the **bpf_get_hash_recalc**\ () helper is called.
2380+ * Return
2381+ * void.
23722382 *
23732383 * long bpf_get_numa_node_id(void)
23742384 * Description
@@ -2466,6 +2476,8 @@ union bpf_attr { · 91 unmodified lines
24662476 * A 8-byte long unique number or 0 if *sk* is NULL.
24672477 *
24682478 * u32 bpf_get_socket_uid(struct sk_buff *skb)
2479+ * Description
2480+ * Get the owner UID of the socked associated to *skb*.
24692481 * Return
24702482 * The owner UID of the socket associated to *skb*. If the socket
24712483 * is **NULL**, or if it is not a full socket (i.e. if it is a
@@ -3240,6 +3252,9 @@ union bpf_attr { · 768 unmodified lines
32403252 * The id is returned or 0 in case the id could not be retrieved.
32413253 *
32423254 * u64 bpf_get_current_cgroup_id(void)
3255+ * Description
3256+ * Get the current cgroup id based on the cgroup within which
3257+ * the current task is running.
32433258 * Return
32443259 * A 64-bit integer containing the current cgroup id based
32453260 * on the cgroup within which the current task is running.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t