1. 01 Jun, 2023 1 commit
    • Louis DeLosSantos's avatar
      bpf: Add table ID to bpf_fib_lookup BPF helper · 8ad77e72
      Louis DeLosSantos authored
      Add ability to specify routing table ID to the `bpf_fib_lookup` BPF
      helper.
      
      A new field `tbid` is added to `struct bpf_fib_lookup` used as
      parameters to the `bpf_fib_lookup` BPF helper.
      
      When the helper is called with the `BPF_FIB_LOOKUP_DIRECT` and
      `BPF_FIB_LOOKUP_TBID` flags the `tbid` field in `struct bpf_fib_lookup`
      will be used as the table ID for the fib lookup.
      
      If the `tbid` does not exist the fib lookup will fail with
      `BPF_FIB_LKUP_RET_NOT_FWDED`.
      
      The `tbid` field becomes a union over the vlan related output fields
      in `struct bpf_fib_lookup` and will be zeroed immediately after usage.
      
      This functionality is useful in containerized environments.
      
      For instance, if a CNI wants to dictate the next-hop for traffic leaving
      a container it can create a container-specific routing table and perform
      a fib lookup against this table in a "host-net-namespace-side" TC program.
      
      This functionality also allows `ip rule` like functionality at the TC
      layer, allowing an eBPF program to pick a routing table based on some
      aspect of the sk_buff.
      
      As a concrete use case, this feature will be used in Cilium's SRv6 L3VPN
      datapath.
      
      When egress traffic leaves a Pod an eBPF program attached by Cilium will
      determine which VRF the egress traffic should target, and then perform a
      FIB lookup in a specific table representing this VRF's FIB.
      Signed-off-by: default avatarLouis DeLosSantos <louis.delos.devel@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20230505-bpf-add-tbid-fib-lookup-v2-1-0a31c22c748c@gmail.com
      8ad77e72
  2. 31 May, 2023 4 commits
  3. 30 May, 2023 33 commits
  4. 27 May, 2023 1 commit
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 75455b90
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2023-05-26
      
      We've added 54 non-merge commits during the last 10 day(s) which contain
      a total of 76 files changed, 2729 insertions(+), 1003 deletions(-).
      
      The main changes are:
      
      1) Add the capability to destroy sockets in BPF through a new kfunc,
         from Aditi Ghag.
      
      2) Support O_PATH fds in BPF_OBJ_PIN and BPF_OBJ_GET commands,
         from Andrii Nakryiko.
      
      3) Add capability for libbpf to resize datasec maps when backed via mmap,
         from JP Kobryn.
      
      4) Move all the test kfuncs for CI out of the kernel and into bpf_testmod,
         from Jiri Olsa.
      
      5) Big batch of xsk selftest improvements to prep for multi-buffer testing,
         from Magnus Karlsson.
      
      6) Show the target_{obj,btf}_id in tracing link's fdinfo and dump it
         via bpftool, from Yafang Shao.
      
      7) Various misc BPF selftest improvements to work with upcoming LLVM 17,
         from Yonghong Song.
      
      8) Extend bpftool to specify netdevice for resolving XDP hints,
         from Larysa Zaremba.
      
      9) Document masking in shift operations for the insn set document,
         from Dave Thaler.
      
      10) Extend BPF selftests to check xdp_feature support for bond driver,
          from Lorenzo Bianconi.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (54 commits)
        bpf: Fix bad unlock balance on freeze_mutex
        libbpf: Ensure FD >= 3 during bpf_map__reuse_fd()
        libbpf: Ensure libbpf always opens files with O_CLOEXEC
        selftests/bpf: Check whether to run selftest
        libbpf: Change var type in datasec resize func
        bpf: drop unnecessary bpf_capable() check in BPF_MAP_FREEZE command
        libbpf: Selftests for resizing datasec maps
        libbpf: Add capability for resizing datasec maps
        selftests/bpf: Add path_fd-based BPF_OBJ_PIN and BPF_OBJ_GET tests
        libbpf: Add opts-based bpf_obj_pin() API and add support for path_fd
        bpf: Support O_PATH FDs in BPF_OBJ_PIN and BPF_OBJ_GET commands
        libbpf: Start v1.3 development cycle
        bpf: Validate BPF object in BPF_OBJ_PIN before calling LSM
        bpftool: Specify XDP Hints ifname when loading program
        selftests/bpf: Add xdp_feature selftest for bond device
        selftests/bpf: Test bpf_sock_destroy
        selftests/bpf: Add helper to get port using getsockname
        bpf: Add bpf_sock_destroy kfunc
        bpf: Add kfunc filter function to 'struct btf_kfunc_id_set'
        bpf: udp: Implement batching for sockets iterator
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20230526222747.17775-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      75455b90
  5. 26 May, 2023 1 commit