1. 13 Dec, 2023 14 commits
  2. 12 Dec, 2023 9 commits
  3. 11 Dec, 2023 2 commits
  4. 10 Dec, 2023 12 commits
  5. 09 Dec, 2023 3 commits
    • Sergei Trofimovich's avatar
      libbpf: Add pr_warn() for EINVAL cases in linker_sanity_check_elf · 32fa0583
      Sergei Trofimovich authored
      Before the change on `i686-linux` `systemd` build failed as:
      
          $ bpftool gen object src/core/bpf/socket_bind/socket-bind.bpf.o src/core/bpf/socket_bind/socket-bind.bpf.unstripped.o
          Error: failed to link 'src/core/bpf/socket_bind/socket-bind.bpf.unstripped.o': Invalid argument (22)
      
      After the change it fails as:
      
          $ bpftool gen object src/core/bpf/socket_bind/socket-bind.bpf.o src/core/bpf/socket_bind/socket-bind.bpf.unstripped.o
          libbpf: ELF section #9 has inconsistent alignment addr=8 != d=4 in src/core/bpf/socket_bind/socket-bind.bpf.unstripped.o
          Error: failed to link 'src/core/bpf/socket_bind/socket-bind.bpf.unstripped.o': Invalid argument (22)
      
      Now it's slightly easier to figure out what is wrong with an ELF file.
      Signed-off-by: default avatarSergei Trofimovich <slyich@gmail.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarEduard Zingerman <eddyz87@gmail.com>
      Link: https://lore.kernel.org/bpf/20231208215100.435876-1-slyich@gmail.com
      32fa0583
    • Martin KaFai Lau's avatar
      Merge branch 'bpf: Expand bpf_cgrp_storage to support cgroup1 non-attach case' · 09115c33
      Martin KaFai Lau authored
      Yafang Shao says:
      
      ====================
      In the current cgroup1 environment, associating operations between a cgroup
      and applications in a BPF program requires storing a mapping of cgroup_id
      to application either in a hash map or maintaining it in userspace.
      However, by enabling bpf_cgrp_storage for cgroup1, it becomes possible to
      conveniently store application-specific information in cgroup-local storage
      and utilize it within BPF programs. Furthermore, enabling this feature for
      cgroup1 involves minor modifications for the non-attach case, streamlining
      the process.
      
      However, when it comes to enabling this functionality for the cgroup1
      attach case, it presents challenges. Therefore, the decision is to focus on
      enabling it solely for the cgroup1 non-attach case at present. If
      attempting to attach to a cgroup1 fd, the operation will simply fail with
      the error code -EBADF.
      
      Changes:
      - RFC -> v1:
        - Collect acked-by
        - Avoid unnecessary is_cgroup1 check (Yonghong)
        - Keep the code patterns consistent (Yonghong)
      ====================
      Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      09115c33
    • Yafang Shao's avatar
      selftests/bpf: Add selftests for cgroup1 local storage · a2c6380b
      Yafang Shao authored
      Expanding the test coverage from cgroup2 to include cgroup1. The result
      as follows,
      
      Already existing test cases for cgroup2:
        #48/1    cgrp_local_storage/tp_btf:OK
        #48/2    cgrp_local_storage/attach_cgroup:OK
        #48/3    cgrp_local_storage/recursion:OK
        #48/4    cgrp_local_storage/negative:OK
        #48/5    cgrp_local_storage/cgroup_iter_sleepable:OK
        #48/6    cgrp_local_storage/yes_rcu_lock:OK
        #48/7    cgrp_local_storage/no_rcu_lock:OK
      
      Expanded test cases for cgroup1:
        #48/8    cgrp_local_storage/cgrp1_tp_btf:OK
        #48/9    cgrp_local_storage/cgrp1_recursion:OK
        #48/10   cgrp_local_storage/cgrp1_negative:OK
        #48/11   cgrp_local_storage/cgrp1_iter_sleepable:OK
        #48/12   cgrp_local_storage/cgrp1_yes_rcu_lock:OK
        #48/13   cgrp_local_storage/cgrp1_no_rcu_lock:OK
      
      Summary:
        #48      cgrp_local_storage:OK
        Summary: 1/13 PASSED, 0 SKIPPED, 0 FAILED
      Signed-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarYonghong Song <yonghong.song@linux.dev>
      Link: https://lore.kernel.org/r/20231206115326.4295-4-laoar.shao@gmail.comSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      a2c6380b