From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: mtahhan@redhat.com, bpf@vger.kernel.org, linux-doc@vger.kernel.org
Cc: Maryam Tahhan <mtahhan@redhat.com>
Subject: Re: [PATCH bpf-next v4 1/1] doc: DEVMAPs and XDP_REDIRECT
Date: Sat, 22 Oct 2022 02:17:22 +0200 [thread overview]
Message-ID: <877d0su2y5.fsf@toke.dk> (raw)
In-Reply-To: <20221021165919.509652-2-mtahhan@redhat.com>
mtahhan@redhat.com writes:
> From: Maryam Tahhan <mtahhan@redhat.com>
>
> Add documentation for BPF_MAP_TYPE_DEVMAP and
> BPF_MAP_TYPE_DEVMAP_HASH including kernel version
> introduced, usage and examples.
>
> Add documentation that describes XDP_REDIRECT.
>
> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
With one small nit below:
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
[...]
> +The following code snippet shows a BPF program that is broadcasting packets to
> +all the interfaces in the ``tx_port`` devmap.
> +
> +.. code-block:: c
> +
> + SEC("xdp")
> + int xdp_redirect_map_func(struct xdp_md *ctx)
> + {
> + int index = ctx->ingress_ifindex;
Let's get rid of this index variable (it's not used).
> + return bpf_redirect_map(&tx_port, 0, BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS);
> + }
-Toke
prev parent reply other threads:[~2022-10-22 0:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 16:59 [PATCH bpf-next v4 0/1] doc: DEVMAPs and XDP_REDIRECT mtahhan
2022-10-21 16:59 ` [PATCH bpf-next v4 1/1] " mtahhan
2022-10-21 19:20 ` Alexei Starovoitov
2022-10-22 0:17 ` Toke Høiland-Jørgensen [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=877d0su2y5.fsf@toke.dk \
--to=toke@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=mtahhan@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).