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 include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/bpf.h+15−0
@@ -330,6 +330,8 @@ union bpf_iter_link_info { · 329 unmodified lines
330 * *ctx_out*, *data_in* and *data_out* must be NULL.330 * *ctx_out*, *data_in* and *data_out* must be NULL.
331 * *repeat* must be zero.331 * *repeat* must be zero.
332 *332 *
333 * BPF_PROG_RUN is an alias for BPF_PROG_TEST_RUN.
334 *
333 * Return335 * Return
334 * Returns zero on success. On error, -1 is returned and *errno*336 * Returns zero on success. On error, -1 is returned and *errno*
335 * is set appropriately.337 * is set appropriately.
@@ -1775,6 +1777,8 @@ union bpf_attr { · 1439 unmodified lines
1775 * 0 on success, or a negative error in case of failure.1777 * 0 on success, or a negative error in case of failure.
1776 *1778 *
1777 * u64 bpf_get_current_pid_tgid(void)1779 * u64 bpf_get_current_pid_tgid(void)
1780 * Description
1781 * Get the current pid and tgid.
1778 * Return1782 * Return
1779 * A 64-bit integer containing the current tgid and pid, and1783 * A 64-bit integer containing the current tgid and pid, and
1780 * created as such:1784 * created as such:
@@ -1782,6 +1786,8 @@ union bpf_attr { · 1 unmodified line
1782 * *current_task*\ **->pid**.1786 * *current_task*\ **->pid**.
1783 *1787 *
1784 * u64 bpf_get_current_uid_gid(void)1788 * u64 bpf_get_current_uid_gid(void)
1789 * Description
1790 * Get the current uid and gid.
1785 * Return1791 * Return
1786 * A 64-bit integer containing the current GID and UID, and1792 * A 64-bit integer containing the current GID and UID, and
1787 * created as such: *current_gid* **<< 32 \|** *current_uid*.1793 * created as such: *current_gid* **<< 32 \|** *current_uid*.
@@ -2256,6 +2262,8 @@ union bpf_attr { · 468 unmodified lines
2256 * The 32-bit hash.2262 * The 32-bit hash.
2257 *2263 *
2258 * u64 bpf_get_current_task(void)2264 * u64 bpf_get_current_task(void)
2265 * Description
2266 * Get the current task.
2259 * Return2267 * Return
2260 * A pointer to the current task struct.2268 * A pointer to the current task struct.
2261 *2269 *
@@ -2369,6 +2377,8 @@ union bpf_attr { · 107 unmodified lines
2369 * indicate that the hash is outdated and to trigger a2377 * indicate that the hash is outdated and to trigger a
2370 * recalculation the next time the kernel tries to access this2378 * recalculation the next time the kernel tries to access this
2371 * hash or when the **bpf_get_hash_recalc**\ () helper is called.2379 * hash or when the **bpf_get_hash_recalc**\ () helper is called.
2380 * Return
2381 * void.
2372 *2382 *
2373 * long bpf_get_numa_node_id(void)2383 * long bpf_get_numa_node_id(void)
2374 * Description2384 * Description
@@ -2466,6 +2476,8 @@ union bpf_attr { · 91 unmodified lines
2466 * A 8-byte long unique number or 0 if *sk* is NULL.2476 * A 8-byte long unique number or 0 if *sk* is NULL.
2467 *2477 *
2468 * u32 bpf_get_socket_uid(struct sk_buff *skb)2478 * u32 bpf_get_socket_uid(struct sk_buff *skb)
2479 * Description
2480 * Get the owner UID of the socked associated to *skb*.
2469 * Return2481 * Return
2470 * The owner UID of the socket associated to *skb*. If the socket2482 * The owner UID of the socket associated to *skb*. If the socket
2471 * is **NULL**, or if it is not a full socket (i.e. if it is a2483 * 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
3240 * The id is returned or 0 in case the id could not be retrieved.3252 * The id is returned or 0 in case the id could not be retrieved.
3241 *3253 *
3242 * u64 bpf_get_current_cgroup_id(void)3254 * 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.
3243 * Return3258 * Return
3244 * A 64-bit integer containing the current cgroup id based3259 * A 64-bit integer containing the current cgroup id based
3245 * on the cgroup within which the current task is running.3260 * 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