Netdev List
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: John Fastabend <john.fastabend@gmail.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, ast@fb.com
Subject: Re: [net-next PATCH] net: comment fixes against BPF devmap helper calls
Date: Fri, 04 Aug 2017 15:21:34 +0200	[thread overview]
Message-ID: <598474DE.9040005@iogearbox.net> (raw)
In-Reply-To: <20170804045822.1032.43840.stgit@john-Precision-Tower-5810>

On 08/04/2017 06:58 AM, John Fastabend wrote:
> Update BPF comments to accurately reflect XDP usage.
>
> Fixes: 97f91a7cf04ff ("bpf: add bpf_redirect_map helper routine")
> Reported-by: Alexei Starovoitov <ast@kernel.org>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
> ---
>   include/uapi/linux/bpf.h |   16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 1106a8c..1ae061e 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -345,14 +345,20 @@ enum bpf_attach_type {
>    * int bpf_redirect(ifindex, flags)
>    *     redirect to another netdev
>    *     @ifindex: ifindex of the net device
> - *     @flags: bit 0 - if set, redirect to ingress instead of egress
> - *             other bits - reserved
> - *     Return: TC_ACT_REDIRECT
> - * int bpf_redirect_map(key, map, flags)
> + *     @flags:
> + *	  cls_bpf:
> + *          bit 0 - if set, redirect to ingress instead of egress
> + *          other bits - reserved
> + *	  xdp_bpf:
> + *	    all bits - reserved
> + *     Return: cls_bpf: TC_ACT_REDIRECT
> + *	       xdp_bfp: XDP_REDIRECT

We should probably also mention the XDP_ABORTED / TC_ACT_SHOT
on error(/misuse) similarly as below.

> + * int bpf_redirect_map(map, key, flags)
>    *     redirect to endpoint in map
> + *     @map: pointer to dev map
>    *     @key: index in map to lookup
> - *     @map: fd of map to do lookup in
>    *     @flags: --
> + *     Return: XDP_REDIRECT on success or XDP_ABORT on error
>    *
>    * u32 bpf_get_route_realm(skb)
>    *     retrieve a dst's tclassid
>

      reply	other threads:[~2017-08-04 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04  4:58 [net-next PATCH] net: comment fixes against BPF devmap helper calls John Fastabend
2017-08-04 13:21 ` Daniel Borkmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=598474DE.9040005@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@fb.com \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox