mbox series

[External,bpf-next,v6,0/3] Add source ip in bpf tunnel key

Message ID 20220430074844.69214-1-fankaixi.li@bytedance.com (mailing list archive)
Headers show
Series Add source ip in bpf tunnel key | expand

Message

Kaixi Fan April 30, 2022, 7:48 a.m. UTC
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.

v6:
- use libbpf api to attach tc progs and remove some shell commands to reduce
  test runtime based on Alexei Starovoitov's suggestion

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    | 423 ++++++++++++++++++
 .../selftests/bpf/progs/test_tunnel_kern.c    | 371 +++++++++------
 tools/testing/selftests/bpf/test_tunnel.sh    | 124 +----
 6 files changed, 687 insertions(+), 248 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/test_tunnel.c

Comments

patchwork-bot+netdevbpf@kernel.org May 10, 2022, 6 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Sat, 30 Apr 2022 15:48:41 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [External,bpf-next,v6,1/3] bpf: Add source ip in "struct bpf_tunnel_key"
    https://git.kernel.org/bpf/bpf-next/c/26101f5ab6bd
  - [External,bpf-next,v6,2/3] selftests/bpf: Move vxlan tunnel testcases to test_progs
    https://git.kernel.org/bpf/bpf-next/c/1ee7efd40abf
  - [External,bpf-next,v6,3/3] selftests/bpf: Replace bpf_trace_printk in tunnel kernel code
    https://git.kernel.org/bpf/bpf-next/c/71b2ec21c331

You are awesome, thank you!