History

bpf: clean up eBPF helpers documentation

These are minor edits for the eBPF helpers documentation in include/uapi/linux/bpf.h. The main fix consists in removing "BPF_FIB_LOOKUP_", because it ends with a non-escaped underscore that gets interpreted by rst2man and produces the following message in the resulting manual page: DOCUTILS SYSTEM MESSAGES System Message: ERROR/3 (/tmp/bpf-helpers.rst:, line 1514) Unknown target name: "bpf_fib_lookup". Other edits consist in: - Improving formatting for flag values for "bpf_fib_lookup()" helper. - Emphasising a parameter name in description of the return value for "bpf_get_stack()" helper. - Removing unnecessary blank lines between "Description" and "Return" sections for the few helpers that would use it, for consistency.

Quentin Monnet committed 8 years ago

Commit 7a279e91 parent f1982222 files · +20 −22Browse files

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

Unified · Split

include/uapi/linux/bpf.h+10−11
@@ -1010,7 +1010,6 @@ union bpf_attr { · 1009 unmodified lines
10101010 * ::
10111011 *
10121012 * # sysctl kernel.perf_event_max_stack=<new value>
1013− *
10141013 * Return
10151014 * The positive or null stack id on success, or a negative error
10161015 * in case of failure.
@@ -1821,10 +1820,9 @@ union bpf_attr { · 804 unmodified lines
18211820 * ::
18221821 *
18231822 * # sysctl kernel.perf_event_max_stack=<new value>
1824− *
18251823 * Return
1826− * a non-negative value equal to or less than size on success, or
1827− * a negative error in case of failure.
1824+ * A non-negative value equal to or less than *size* on success,
1825+ * or a negative error in case of failure.
18281826 *
18291827 * int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header)
18301828 * Description
@@ -1845,7 +1843,6 @@ union bpf_attr { · 14 unmodified lines
18451843 * in socket filters where *skb*\ **->data** does not always point
18461844 * to the start of the mac header and where "direct packet access"
18471845 * is not available.
1848− *
18491846 * Return
18501847 * 0 on success, or a negative error in case of failure.
18511848 *
@@ -1861,16 +1858,18 @@ union bpf_attr { · 9 unmodified lines
18611858 * rt_metric is set to metric from route.
18621859 *
18631860 * *plen* argument is the size of the passed in struct.
1864− * *flags* argument can be one or more BPF_FIB_LOOKUP_ flags:
1861+ * *flags* argument can be a combination of one or more of the
1862+ * following values:
18651863 *
1866− * **BPF_FIB_LOOKUP_DIRECT** means do a direct table lookup vs
1867− * full lookup using FIB rules
1868− * **BPF_FIB_LOOKUP_OUTPUT** means do lookup from an egress
1869− * perspective (default is ingress)
1864+ * **BPF_FIB_LOOKUP_DIRECT**
1865+ * Do a direct table lookup vs full lookup using FIB
1866+ * rules.
1867+ * **BPF_FIB_LOOKUP_OUTPUT**
1868+ * Perform lookup from an egress perspective (default is
1869+ * ingress).
18701870 *
18711871 * *ctx* is either **struct xdp_md** for XDP programs or
18721872 * **struct sk_buff** tc cls_act programs.
1873− *
18741873 * Return
18751874 * Egress device index on success, 0 if packet needs to continue
18761875 * up the stack for further processing or a negative error in case