[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <34c873d1-5014-9fd4-8372-4980f6787904@gmail.com>
Date: Wed, 30 Sep 2020 09:08:34 -0700
From: David Ahern <dsahern@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>, ast@...nel.org
Cc: john.fastabend@...il.com, kafai@...com, netdev@...r.kernel.org,
bpf@...r.kernel.org, David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH bpf-next v4 3/6] bpf: add redirect_neigh helper as
redirect drop-in
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@...il.com>
Powered by blists - more mailing lists