Commit c0fcc955 authored by Haoran Jiang's avatar Haoran Jiang Committed by Huacai Chen
Browse files

LoongArch: BPF: Fix the tailcall hierarchy



In specific use cases combining tailcalls and BPF-to-BPF calls,
MAX_TAIL_CALL_CNT won't work because of missing tail_call_cnt
back-propagation from callee to caller. This patch fixes this
tailcall issue caused by abusing the tailcall in bpf2bpf feature
on LoongArch like the way of "bpf, x64: Fix tailcall hierarchy".

Push tail_call_cnt_ptr and tail_call_cnt into the stack,
tail_call_cnt_ptr is passed between tailcall and bpf2bpf,
uses tail_call_cnt_ptr to increment tail_call_cnt.

Fixes: bb035ef0 ("LoongArch: BPF: Support mixing bpf2bpf and tailcalls")
Reviewed-by: default avatarGeliang Tang <geliang@kernel.org>
Reviewed-by: default avatarHengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: default avatarHaoran Jiang <jianghaoran@kylinos.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent cd39d9e6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment