From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Peter Oskolkov <posk@google.com>
Cc: brouer@redhat.com, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
netdev@vger.kernel.org, Peter Oskolkov <posk@posk.io>,
David Ahern <dsahern@gmail.com>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH bpf-next v7 1/6] bpf: add plumbing for BPF_LWT_ENCAP_IP in bpf_lwt_push_encap
Date: Thu, 7 Feb 2019 15:20:42 +0100 [thread overview]
Message-ID: <20190207152042.18a97a71@carbon> (raw)
In-Reply-To: <20190207003720.51096-2-posk@google.com>
On Wed, 6 Feb 2019 16:37:15 -0800
Peter Oskolkov <posk@google.com> wrote:
> This patch adds all needed plumbing in preparation to allowing
> bpf programs to do IP encapping via bpf_lwt_push_encap. Actual
> implementation is added in the next patch in the patchset.
>
> Of note:
> - bpf_lwt_push_encap can now be called from BPF_PROG_TYPE_LWT_XMIT
> prog types in addition to BPF_PROG_TYPE_LWT_IN;
> - if the skb being encapped has GSO set, encapsulation is limited
> to IPIP/IP+GRE/IP+GUE (both IPv4 and IPv6);
> - as route lookups are different for ingress vs egress, the single
> external bpf_lwt_push_encap BPF helper is routed internally to
> either bpf_lwt_in_push_encap or bpf_lwt_xmit_push_encap BPF_CALLs,
> depending on prog type.
>
> Signed-off-by: Peter Oskolkov <posk@google.com>
> ---
> include/uapi/linux/bpf.h | 26 +++++++++++++++++++++--
> net/core/filter.c | 46 +++++++++++++++++++++++++++++++++++-----
> 2 files changed, 65 insertions(+), 7 deletions(-)
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 1777fa0c61e4..138089ff24cf 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -2016,6 +2016,19 @@ union bpf_attr {
> * Only works if *skb* contains an IPv6 packet. Insert a
> * Segment Routing Header (**struct ipv6_sr_hdr**) inside
> * the IPv6 header.
> + * **BPF_LWT_ENCAP_IP**
> + * IP encapsulation (GRE/GUE/IPIP/etc). The outer header
> + * must be IPv4 or IPv6, followed by zero or more
> + * additional headers, up to LWT_BPF_MAX_HEADROOM total
> + * bytes in all prepended headers. PLease note that
^^
Trivial typo PLease
> + * if skb_is_gso(skb) is true, no more than two headers
> + * can be prepended, and the inner header, if present,
> + * should be either GRE or UDP/GUE.
> +
next prev parent reply other threads:[~2019-02-07 14:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 0:37 [PATCH bpf-next v7 0/6] bpf: add BPF_LWT_ENCAP_IP option to bpf_lwt_push_encap Peter Oskolkov
2019-02-07 0:37 ` [PATCH bpf-next v7 1/6] bpf: add plumbing for BPF_LWT_ENCAP_IP in bpf_lwt_push_encap Peter Oskolkov
2019-02-07 14:20 ` Jesper Dangaard Brouer [this message]
2019-02-07 0:37 ` [PATCH bpf-next v7 2/6] bpf: implement BPF_LWT_ENCAP_IP mode " Peter Oskolkov
2019-02-07 13:43 ` kbuild test robot
2019-02-07 14:04 ` kbuild test robot
2019-02-07 0:37 ` [PATCH bpf-next v7 3/6] bpf: handle GSO " Peter Oskolkov
2019-02-07 17:57 ` Willem de Bruijn
2019-02-07 0:37 ` [PATCH bpf-next v7 4/6] bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c Peter Oskolkov
2019-02-07 14:40 ` kbuild test robot
2019-02-07 0:37 ` [PATCH bpf-next v7 5/6] bpf: sync <kdir>/include/.../bpf.h with tools/include/.../bpf.h Peter Oskolkov
2019-02-07 0:37 ` [PATCH bpf-next v7 6/6] selftests: bpf: add test_lwt_ip_encap selftest Peter Oskolkov
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=20190207152042.18a97a71@carbon \
--to=brouer@redhat.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=posk@google.com \
--cc=posk@posk.io \
--cc=willemb@google.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).