mbox series

[bpf-next,0/2] Enable inline bpf_kptr_xchg() for RV64

Message ID 20240130124659.670321-1-pulehui@huaweicloud.com (mailing list archive)
Headers show
Series Enable inline bpf_kptr_xchg() for RV64 | expand

Message

Pu Lehui Jan. 30, 2024, 12:46 p.m. UTC
This patch is the RV64 implementation of inline bpf_kptr_xchg()[0]. RV64
JIT supports 64-bit BPF_XCHG atomic instructions. At the same time, the
underlying implementation of xchg() and atomic64_xchg() in RV64 both are
raw_xchg() that supported 64-bit. Therefore inline bpf_kptr_xchg() will
have equivalent semantics. Let's inline it for better performance.

link: https://lore.kernel.org/bpf/20240105104819.3916743-1-houtao@huaweicloud.com [0]

Pu Lehui (2):
  riscv, bpf: Enable inline bpf_kptr_xchg() for RV64
  selftests/bpf: Enable inline bpf_kptr_xchg() test for RV64

 arch/riscv/net/bpf_jit_comp64.c                           | 5 +++++
 tools/testing/selftests/bpf/prog_tests/kptr_xchg_inline.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Björn Töpel Jan. 30, 2024, 5:39 p.m. UTC | #1
Pu Lehui <pulehui@huaweicloud.com> writes:

> This patch is the RV64 implementation of inline bpf_kptr_xchg()[0]. RV64
> JIT supports 64-bit BPF_XCHG atomic instructions. At the same time, the
> underlying implementation of xchg() and atomic64_xchg() in RV64 both are
> raw_xchg() that supported 64-bit. Therefore inline bpf_kptr_xchg() will
> have equivalent semantics. Let's inline it for better performance.
>
> link: https://lore.kernel.org/bpf/20240105104819.3916743-1-houtao@huaweicloud.com [0]

Acked-by: Björn Töpel <bjorn@kernel.org>
patchwork-bot+netdevbpf@kernel.org Feb. 1, 2024, 10:40 a.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Tue, 30 Jan 2024 12:46:57 +0000 you wrote:
> This patch is the RV64 implementation of inline bpf_kptr_xchg()[0]. RV64
> JIT supports 64-bit BPF_XCHG atomic instructions. At the same time, the
> underlying implementation of xchg() and atomic64_xchg() in RV64 both are
> raw_xchg() that supported 64-bit. Therefore inline bpf_kptr_xchg() will
> have equivalent semantics. Let's inline it for better performance.
> 
> link: https://lore.kernel.org/bpf/20240105104819.3916743-1-houtao@huaweicloud.com [0]
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/2] riscv, bpf: Enable inline bpf_kptr_xchg() for RV64
    https://git.kernel.org/bpf/bpf-next/c/69065aa11ca6
  - [bpf-next,2/2] selftests/bpf: Enable inline bpf_kptr_xchg() test for RV64
    https://git.kernel.org/bpf/bpf-next/c/994ff2f79739

You are awesome, thank you!