mbox series

[bpf-next,0/3] bpf: Add support to set and get tunnel source ip

Message ID 20220319130538.55741-1-fankaixi.li@bytedance.com (mailing list archive)
Headers show
Series bpf: Add support to set and get tunnel source ip | expand

Message

Kaixi Fan March 19, 2022, 1:05 p.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.

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(-)