From: David Ahern <dsahern@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>, ast@kernel.org
Cc: john.fastabend@gmail.com, kafai@fb.com, netdev@vger.kernel.org,
bpf@vger.kernel.org, David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH bpf-next v4 3/6] bpf: add redirect_neigh helper as redirect drop-in
Date: Wed, 30 Sep 2020 09:08:34 -0700 [thread overview]
Message-ID: <34c873d1-5014-9fd4-8372-4980f6787904@gmail.com> (raw)
In-Reply-To: <f207de81629e1724899b73b8112e0013be782d35.1601477936.git.daniel@iogearbox.net>
On 9/30/20 8:18 AM, Daniel Borkmann wrote:
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 6116a7f54c8f..1f17c6752deb 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -3652,6 +3652,19 @@ union bpf_attr {
> * associated socket instead of the current process.
> * Return
> * The id is returned or 0 in case the id could not be retrieved.
> + *
> + * long bpf_redirect_neigh(u32 ifindex, u64 flags)
> + * Description
> + * Redirect the packet to another net device of index *ifindex*
> + * and fill in L2 addresses from neighboring subsystem. This helper
It is worth mentioning in the documentation that this helper does a FIB
lookup based on the skb's networking header to get the address of the
next hop and then relies on the neighbor lookup for the L2 address of
the nexthop.
> + * is somewhat similar to **bpf_redirect**\ (), except that it
> + * fills in e.g. MAC addresses based on the L3 information from
> + * the packet. This helper is supported for IPv4 and IPv6 protocols.
> + * The *flags* argument is reserved and must be 0. The helper is
> + * currently only supported for tc BPF program types.
> + * Return
> + * The helper returns **TC_ACT_REDIRECT** on success or
> + * **TC_ACT_SHOT** on error.
> */
> #define __BPF_FUNC_MAPPER(FN) \
> FN(unspec), \
Code change looks fine to me:
Reviewed-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2020-09-30 16:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 15:18 [PATCH bpf-next v4 0/6] Various BPF helper improvements Daniel Borkmann
2020-09-30 15:18 ` [PATCH bpf-next v4 1/6] bpf: add classid helper only based on skb->sk Daniel Borkmann
2020-09-30 15:18 ` [PATCH bpf-next v4 2/6] bpf, net: rework cookie generator as per-cpu one Daniel Borkmann
2020-09-30 15:55 ` Eric Dumazet
2020-09-30 15:18 ` [PATCH bpf-next v4 3/6] bpf: add redirect_neigh helper as redirect drop-in Daniel Borkmann
2020-09-30 16:08 ` David Ahern [this message]
2020-09-30 20:56 ` Daniel Borkmann
2020-09-30 15:18 ` [PATCH bpf-next v4 4/6] bpf, libbpf: add bpf_tail_call_static helper for bpf programs Daniel Borkmann
2020-09-30 15:18 ` [PATCH bpf-next v4 5/6] bpf, selftests: use bpf_tail_call_static where appropriate Daniel Borkmann
2020-09-30 17:23 ` Martin KaFai Lau
2020-09-30 15:18 ` [PATCH bpf-next v4 6/6] bpf, selftests: add redirect_neigh selftest Daniel Borkmann
2020-09-30 17:31 ` Martin KaFai Lau
2020-09-30 19:20 ` Alexei Starovoitov
2020-09-30 21:01 ` Daniel Borkmann
2020-09-30 21:12 ` Alexei Starovoitov
2020-09-30 19:10 ` [PATCH bpf-next v4 0/6] Various BPF helper improvements patchwork-bot+bpf
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=34c873d1-5014-9fd4-8372-4980f6787904@gmail.com \
--to=dsahern@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dsahern@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.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