Skip to content

powerpc: net: bpf_jit_comp: Fix misuse of fallthrough#119

Closed
kernel-patches-bot wants to merge 2 commits intobpf-nextfrom
series/204533=>bpf-next
Closed

powerpc: net: bpf_jit_comp: Fix misuse of fallthrough#119
kernel-patches-bot wants to merge 2 commits intobpf-nextfrom
series/204533=>bpf-next

Conversation

@kernel-patches-bot
Copy link

Pull request for series with
subject: powerpc: net: bpf_jit_comp: Fix misuse of fallthrough
version: 1
url: https://patchwork.ozlabs.org/project/netdev/list/?series=204533

@kernel-patches-bot
Copy link
Author

Master branch: ba5f4cf
series: https://patchwork.ozlabs.org/project/netdev/list/?series=204533
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.ozlabs.org/project/netdev/list/?series=204533, error message:
Cmd('git') failed due to: exit code(128)
cmdline: git am -3
stderr: 'fatal: previous rebase directory .git/rebase-apply still exists but mbox given.'

@kernel-patches-bot
Copy link
Author

Master branch: ba5f4cf
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 1fd17c8
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 09d8ad1
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: efa90b5
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 84a20d8
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: b000def
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: a871b04
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 98b972d
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: bc60090
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 00e8c44
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 9d9aae5
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: f1fc8ec
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: f970cbc
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 85e3f31
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

kernel-patches-bot and others added 2 commits September 29, 2020 13:30
The user defined label following "fallthrough" is not considered by GCC
and causes build failure.

kernel-source/include/linux/compiler_attributes.h:208:41: error: attribute
'fallthrough' not preceding a case label or default label [-Werror]
 208   define fallthrough _attribute((fallthrough_))
                          ^~~~~~~~~~~~~

Signed-off-by: He Zhe <zhe.he@windriver.com>
@kernel-patches-bot
Copy link
Author

Master branch: c810b31
series: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=204581
version: 1

@kernel-patches-bot kernel-patches-bot deleted the series/204533=>bpf-next branch September 30, 2020 16:13
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jan 26, 2024
Like commit 1cf3bfc ("bpf: Support 64-bit pointers to kfuncs")
for s390x, add support for 64-bit pointers to kfuncs for LoongArch.
Since the infrastructure is already implemented in BPF core, the only
thing need to be done is to override bpf_jit_supports_far_kfunc_call().

Before this change, several test_verifier tests failed:

  # ./test_verifier | grep # | grep FAIL
  #119/p calls: invalid kfunc call: ptr_to_mem to struct with non-scalar FAIL
  #120/p calls: invalid kfunc call: ptr_to_mem to struct with nesting depth > 4 FAIL
  #121/p calls: invalid kfunc call: ptr_to_mem to struct with FAM FAIL
  #122/p calls: invalid kfunc call: reg->type != PTR_TO_CTX FAIL
  #123/p calls: invalid kfunc call: void * not allowed in func proto without mem size arg FAIL
  #124/p calls: trigger reg2btf_ids[reg->type] for reg->type > __BPF_REG_TYPE_MAX FAIL
  #125/p calls: invalid kfunc call: reg->off must be zero when passed to release kfunc FAIL
  #126/p calls: invalid kfunc call: don't match first member type when passed to release kfunc FAIL
  #127/p calls: invalid kfunc call: PTR_TO_BTF_ID with negative offset FAIL
  #128/p calls: invalid kfunc call: PTR_TO_BTF_ID with variable offset FAIL
  #129/p calls: invalid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  #130/p calls: valid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  #486/p map_kptr: ref: reference state created and released on xchg FAIL

This is because the kfuncs in the loaded module are far away from
__bpf_call_base:

  ffff800002009440 t bpf_kfunc_call_test_fail1    [bpf_testmod]
  9000000002e128d8 T __bpf_call_base

The offset relative to __bpf_call_base does NOT fit in s32, which breaks
the assumption in BPF core. Enable bpf_jit_supports_far_kfunc_call() lifts
this limit.

Note that to reproduce the above result, tools/testing/selftests/bpf/config
should be applied, and run the test with JIT enabled, unpriv BPF enabled.

With this change, the test_verifier tests now all passed:

  # ./test_verifier
  ...
  Summary: 777 PASSED, 0 SKIPPED, 0 FAILED

Tested-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Feb 26, 2026
In a similar fashion to the IPv4 output route tests, add equivalent IPv6
tests.

Output without "bpf: fib_lookup: Honor oif in IPv6 output route
lookups":

 # ./test_progs -a fib_lookup
 [...]
 Testing IPv6 output route, without source, via second device test_fib_lookup:PASS:bpf_prog_test_run_opts 0 nsec
 test_fib_lookup:PASS:fib_lookup_ret 0 nsec
 test_fib_lookup:FAIL:ifindex does not match unexpected ifindex does not match: actual 10010 != expected 10020
 [...]
 Testing IPv6 output route, with source, via second device set_lookup_params:PASS:inet_pton(IPV6_IFACE_ADDR) 0 nsec
 test_fib_lookup:PASS:bpf_prog_test_run_opts 0 nsec
 test_fib_lookup:PASS:fib_lookup_ret 0 nsec
 test_fib_lookup:FAIL:ifindex does not match unexpected ifindex does not match: actual 10010 != expected 10020
 [...]
 Testing IPv6 output route, oif mismatch set_lookup_params:PASS:inet_pton(IPV6_IFACE_ADDR) 0 nsec
 test_fib_lookup:PASS:bpf_prog_test_run_opts 0 nsec
 test_fib_lookup:FAIL:fib_lookup_ret unexpected fib_lookup_ret: actual 0 != expected 4
 [...]
 #119     fib_lookup:FAIL
 Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED

Output with "bpf: fib_lookup: Honor oif in IPv6 output route lookups":

 # ./test_progs -a fib_lookup
 #119     fib_lookup:OK
 Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

That is, without the specified patch, unlike IPv4, IPv6 would always
resolve the most specific route with the lowest metric, even if its
nexthop device does not match the specified oif.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Feb 26, 2026
Add tests that verify that bpf_fib_lookup() is able to resolve the
destination MAC for an IPv6 link-local address when specifying the
BPF_FIB_LOOKUP_OUTPUT flag.

Output without "bpf: fib_lookup: Allow output lookups for IPv6
link-local addresses":

 # ./test_progs -a fib_lookup
 [...]
 Testing IPv6 output route, link-local, via first device set_lookup_params:PASS:inet_pton(IPV6_IFACE_ADDR) 0 nsec
 test_fib_lookup:PASS:bpf_prog_test_run_opts 0 nsec
 test_fib_lookup:FAIL:fib_lookup_ret unexpected fib_lookup_ret: actual 4 != expected 0
 [...]
 Testing IPv6 output route, link-local, via second device set_lookup_params:PASS:inet_pton(IPV6_IFACE_ADDR) 0 nsec
 test_fib_lookup:PASS:bpf_prog_test_run_opts 0 nsec
 test_fib_lookup:FAIL:fib_lookup_ret unexpected fib_lookup_ret: actual 4 != expected 0
 [...]
 #119     fib_lookup:FAIL
 Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED

Output with "bpf: fib_lookup: Allow output lookups for IPv6 link-local
addresses":

 # ./test_progs -a fib_lookup
 #119     fib_lookup:OK
 Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant