bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fankaixi.li@bytedance.com
To: john.fastabend@gmail.com, kafai@fb.com, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net,
	"kaixi.fan" <fankaixi.li@bytedance.com>
Subject: [PATCH bpf-next 0/3] bpf: Add support to set and get tunnel source ip
Date: Sat, 19 Mar 2022 21:05:35 +0800	[thread overview]
Message-ID: <20220319130538.55741-1-fankaixi.li@bytedance.com> (raw)

From: "kaixi.fan" <fankaixi.li@bytedance.com>

Now bpf code could not set tunnel source ip address of ip tunnel. So it
could not support flow based tunnel mode completely. Because flow based
tunnel mode could set tunnel source, destination ip address and tunnel 
key simultaneously.

Flow based tunnel is useful for overlay networks. And by configuring tunnel
source ip address, user could make their networks more elastic.
For example, tunnel source ip could be used to select different egress
nic interface for different flows with same tunnel destination ip. Another
example, user could choose one of multiple ip address of the egress nic
interface as the packet's tunnel source ip.

kaixi.fan (3):
  bpf: Add source ip in "struct bpf_tunnel_key"
  selftests/bpf: add ipv4 vxlan tunnel source testcase
  selftests/bpf: add ipv6 vxlan tunnel source testcase

 include/uapi/linux/bpf.h                      |   4 +
 net/core/filter.c                             |   9 ++
 tools/include/uapi/linux/bpf.h                |   4 +
 .../selftests/bpf/progs/test_tunnel_kern.c    | 106 +++++++++++++++++
 tools/testing/selftests/bpf/test_tunnel.sh    | 109 +++++++++++++++---
 5 files changed, 219 insertions(+), 13 deletions(-)

-- 
2.24.3 (Apple Git-128)


             reply	other threads:[~2022-03-19 13:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-19 13:05 fankaixi.li [this message]
2022-03-19 13:05 ` [PATCH bpf-next 1/3] bpf: Add source ip in "struct bpf_tunnel_key" fankaixi.li
2022-03-19 13:05 ` [PATCH bpf-next 2/3] selftests/bpf: add ipv4 vxlan tunnel source testcase fankaixi.li
2022-03-19 13:05 ` [PATCH bpf-next 3/3] selftests/bpf: add ipv6 " fankaixi.li
2022-03-22  0:33   ` Martin KaFai Lau
2022-03-22  1:53     ` [External] " 范开喜

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=20220319130538.55741-1-fankaixi.li@bytedance.com \
    --to=fankaixi.li@bytedance.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.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).