From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: alexei.starovoitov@gmail.com, daniel@iogearbox.net,
tom@herbertland.com, netdev@vger.kernel.org,
roopa@cumulusnetworks.com
Subject: [PATCH net-next 0/4] BPF for lightweight tunnel encapsulation
Date: Sun, 30 Oct 2016 12:58:01 +0100 [thread overview]
Message-ID: <cover.1477827877.git.tgraf@suug.ch> (raw)
This series implements BPF program invocation from dst entries via the
lightweight tunnels infrastructure. The BPF program can be attached to
lwtunnel_input(), lwtunnel_output() or lwtunnel_xmit() and sees an L3
skb as context. input is read-only, output can write, xmit can write,
push headers, and redirect.
Motiviation for this work:
- Restricting outgoing routes beyond what the route tuple supports
- Per route accounting byond realms
- Fast attachment of L2 headers where header does not require resolving
L2 addresses
- ILA like uses cases where L3 addresses are resolved and then routed
in an async manner
- Fast encapsulation + redirect. For now limited to use cases where not
setting inner and outer offset/protocol is OK.
A couple of samples on how to use it can be found in patch 04.
Thomas Graf (4):
route: Set orig_output when redirecting to lwt on locally generated
traffic
route: Set lwtstate for local traffic and cached input dsts
bpf: BPF for lightweight tunnel encapsulation
bpf: Add samples for LWT-BPF
include/linux/filter.h | 2 +-
include/uapi/linux/bpf.h | 31 +++-
include/uapi/linux/lwtunnel.h | 21 +++
kernel/bpf/verifier.c | 16 +-
net/core/Makefile | 2 +-
net/core/filter.c | 148 ++++++++++++++++-
net/core/lwt_bpf.c | 365 ++++++++++++++++++++++++++++++++++++++++++
net/core/lwtunnel.c | 1 +
net/ipv4/route.c | 37 +++--
samples/bpf/bpf_helpers.h | 4 +
samples/bpf/lwt_bpf.c | 210 ++++++++++++++++++++++++
samples/bpf/test_lwt_bpf.sh | 337 ++++++++++++++++++++++++++++++++++++++
12 files changed, 1156 insertions(+), 18 deletions(-)
create mode 100644 net/core/lwt_bpf.c
create mode 100644 samples/bpf/lwt_bpf.c
create mode 100755 samples/bpf/test_lwt_bpf.sh
--
2.7.4
next reply other threads:[~2016-10-30 11:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-30 11:58 Thomas Graf [this message]
2016-10-30 11:58 ` [PATCH net-next 1/4] route: Set orig_output when redirecting to lwt on locally generated traffic Thomas Graf
2016-10-30 11:58 ` [PATCH net-next 2/4] route: Set lwtstate for local traffic and cached input dsts Thomas Graf
2016-10-30 11:58 ` [PATCH net-next 3/4] bpf: BPF for lightweight tunnel encapsulation Thomas Graf
2016-10-30 20:34 ` Tom Herbert
2016-10-30 21:47 ` Thomas Graf
2016-10-31 1:28 ` Tom Herbert
2016-10-31 8:19 ` Thomas Graf
2016-10-31 12:59 ` Thomas Graf
2016-10-31 14:17 ` Tom Herbert
2016-10-31 15:06 ` Thomas Graf
2016-10-31 16:07 ` Tom Herbert
2016-10-31 17:35 ` Thomas Graf
2016-10-30 11:58 ` [PATCH net-next 4/4] bpf: Add samples for LWT-BPF Thomas Graf
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=cover.1477827877.git.tgraf@suug.ch \
--to=tgraf@suug.ch \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=tom@herbertland.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).