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.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Quentin Monnet 2018-05-29 12:27:44 +01:00 committed by Daniel Borkmann
parent f198222f05
commit 7a279e9333
2 changed files with 20 additions and 22 deletions

View File

@ -1010,7 +1010,6 @@ union bpf_attr {
* :: * ::
* *
* # sysctl kernel.perf_event_max_stack=<new value> * # sysctl kernel.perf_event_max_stack=<new value>
*
* Return * Return
* The positive or null stack id on success, or a negative error * The positive or null stack id on success, or a negative error
* in case of failure. * in case of failure.
@ -1821,10 +1820,9 @@ union bpf_attr {
* :: * ::
* *
* # sysctl kernel.perf_event_max_stack=<new value> * # sysctl kernel.perf_event_max_stack=<new value>
*
* Return * Return
* a non-negative value equal to or less than size on success, or * A non-negative value equal to or less than *size* on success,
* a negative error in case of failure. * or a negative error in case of failure.
* *
* int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header) * int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header)
* Description * Description
@ -1845,7 +1843,6 @@ union bpf_attr {
* in socket filters where *skb*\ **->data** does not always point * in socket filters where *skb*\ **->data** does not always point
* to the start of the mac header and where "direct packet access" * to the start of the mac header and where "direct packet access"
* is not available. * is not available.
*
* Return * Return
* 0 on success, or a negative error in case of failure. * 0 on success, or a negative error in case of failure.
* *
@ -1861,16 +1858,18 @@ union bpf_attr {
* rt_metric is set to metric from route. * rt_metric is set to metric from route.
* *
* *plen* argument is the size of the passed in struct. * *plen* argument is the size of the passed in struct.
* *flags* argument can be one or more BPF_FIB_LOOKUP_ flags: * *flags* argument can be a combination of one or more of the
* following values:
* *
* **BPF_FIB_LOOKUP_DIRECT** means do a direct table lookup vs * **BPF_FIB_LOOKUP_DIRECT**
* full lookup using FIB rules * Do a direct table lookup vs full lookup using FIB
* **BPF_FIB_LOOKUP_OUTPUT** means do lookup from an egress * rules.
* perspective (default is ingress) * **BPF_FIB_LOOKUP_OUTPUT**
* Perform lookup from an egress perspective (default is
* ingress).
* *
* *ctx* is either **struct xdp_md** for XDP programs or * *ctx* is either **struct xdp_md** for XDP programs or
* **struct sk_buff** tc cls_act programs. * **struct sk_buff** tc cls_act programs.
*
* Return * Return
* Egress device index on success, 0 if packet needs to continue * Egress device index on success, 0 if packet needs to continue
* up the stack for further processing or a negative error in case * up the stack for further processing or a negative error in case

View File

@ -1010,7 +1010,6 @@ union bpf_attr {
* :: * ::
* *
* # sysctl kernel.perf_event_max_stack=<new value> * # sysctl kernel.perf_event_max_stack=<new value>
*
* Return * Return
* The positive or null stack id on success, or a negative error * The positive or null stack id on success, or a negative error
* in case of failure. * in case of failure.
@ -1821,10 +1820,9 @@ union bpf_attr {
* :: * ::
* *
* # sysctl kernel.perf_event_max_stack=<new value> * # sysctl kernel.perf_event_max_stack=<new value>
*
* Return * Return
* a non-negative value equal to or less than size on success, or * A non-negative value equal to or less than *size* on success,
* a negative error in case of failure. * or a negative error in case of failure.
* *
* int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header) * int skb_load_bytes_relative(const struct sk_buff *skb, u32 offset, void *to, u32 len, u32 start_header)
* Description * Description
@ -1845,7 +1843,6 @@ union bpf_attr {
* in socket filters where *skb*\ **->data** does not always point * in socket filters where *skb*\ **->data** does not always point
* to the start of the mac header and where "direct packet access" * to the start of the mac header and where "direct packet access"
* is not available. * is not available.
*
* Return * Return
* 0 on success, or a negative error in case of failure. * 0 on success, or a negative error in case of failure.
* *
@ -1861,16 +1858,18 @@ union bpf_attr {
* rt_metric is set to metric from route. * rt_metric is set to metric from route.
* *
* *plen* argument is the size of the passed in struct. * *plen* argument is the size of the passed in struct.
* *flags* argument can be one or more BPF_FIB_LOOKUP_ flags: * *flags* argument can be a combination of one or more of the
* following values:
* *
* **BPF_FIB_LOOKUP_DIRECT** means do a direct table lookup vs * **BPF_FIB_LOOKUP_DIRECT**
* full lookup using FIB rules * Do a direct table lookup vs full lookup using FIB
* **BPF_FIB_LOOKUP_OUTPUT** means do lookup from an egress * rules.
* perspective (default is ingress) * **BPF_FIB_LOOKUP_OUTPUT**
* Perform lookup from an egress perspective (default is
* ingress).
* *
* *ctx* is either **struct xdp_md** for XDP programs or * *ctx* is either **struct xdp_md** for XDP programs or
* **struct sk_buff** tc cls_act programs. * **struct sk_buff** tc cls_act programs.
*
* Return * Return
* Egress device index on success, 0 if packet needs to continue * Egress device index on success, 0 if packet needs to continue
* up the stack for further processing or a negative error in case * up the stack for further processing or a negative error in case