All of lore.kernel.org
 help / color / mirror / Atom feed
From: fankaixi.li@bytedance.com
To: kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org,
	bpf@vger.kernel.org
Cc: ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net,
	Kaixi Fan <fankaixi.li@bytedance.com>
Subject: [External] [PATCH bpf-next v5 0/3] Add source ip in bpf tunnel key
Date: Fri, 22 Apr 2022 20:02:56 +0800	[thread overview]
Message-ID: <20220422120259.10185-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.

Add tunnel and tunnel source testcases in test_progs. Other types of
tunnel testcases would be moved to test_progs step by step in the
future.

v5:
- fix some code format errors
- use bpf kernel code at namespace at_ns0 to set tunnel metadata

v4:
- fix subject error of first patch

v3:
- move vxlan tunnel testcases to test_progs
- replace bpf_trace_printk with bpf_printk
- rename bpf kernel prog section name to tic

v2:
- merge vxlan tunnel and tunnel source ip testcases in test_tunnel.sh

Kaixi Fan (3):
  bpf: Add source ip in "struct bpf_tunnel_key"
  selftests/bpf: Move vxlan tunnel testcases to test_progs
  selftests/bpf: Replace bpf_trace_printk in tunnel kernel code

 include/uapi/linux/bpf.h                      |   4 +
 net/core/filter.c                             |   9 +
 tools/include/uapi/linux/bpf.h                |   4 +
 .../selftests/bpf/prog_tests/test_tunnel.c    | 395 ++++++++++++++++++
 .../selftests/bpf/progs/test_tunnel_kern.c    | 371 ++++++++++------
 tools/testing/selftests/bpf/test_tunnel.sh    | 124 +-----
 6 files changed, 659 insertions(+), 248 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/test_tunnel.c

-- 
2.20.1


             reply	other threads:[~2022-04-22 12:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 12:02 fankaixi.li [this message]
2022-04-22 12:02 ` [External] [PATCH bpf-next v5 1/3] bpf: Add source ip in "struct bpf_tunnel_key" fankaixi.li
2022-04-22 12:02 ` [External] [PATCH bpf-next v5 2/3] selftests/bpf: Move vxlan tunnel testcases to test_progs fankaixi.li
2022-04-23  0:36   ` Alexei Starovoitov
2022-04-23  2:51     ` Kaixi Fan
2022-04-24  2:57       ` Alexei Starovoitov
2022-04-24  3:32         ` Kaixi Fan
2022-04-26 18:24           ` Alexei Starovoitov
2022-04-29 14:46             ` Kaixi Fan
2022-04-22 12:02 ` [External] [PATCH bpf-next v5 3/3] selftests/bpf: Replace bpf_trace_printk in tunnel kernel code fankaixi.li

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=20220422120259.10185-1-fankaixi.li@bytedance.com \
    --to=fankaixi.li@bytedance.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.