[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220511093854.411-1-zhoufeng.zf@bytedance.com>
Date: Wed, 11 May 2022 17:38:52 +0800
From: Feng zhou <zhoufeng.zf@...edance.com>
To: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org, rostedt@...dmis.org,
mingo@...hat.com, jolsa@...nel.org, davemarchevsky@...com,
joannekoong@...com, geliang.tang@...e.com
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, duanxiongchun@...edance.com,
songmuchun@...edance.com, wangdongdong.6@...edance.com,
cong.wang@...edance.com, zhouchengming@...edance.com,
zhoufeng.zf@...edance.com, yosryahmed@...gle.com
Subject: [PATCH bpf-next v2 0/2] Introduce access remote cpu elem support in BPF percpu map
From: Feng Zhou <zhoufeng.zf@...edance.com>
Trace some functions, such as enqueue_task_fair, need to access the
corresponding cpu, not the current cpu, and bpf_map_lookup_elem percpu map
cannot do it. So add bpf_map_lookup_percpu_elem to accomplish it for
percpu_array_map, percpu_hash_map, lru_percpu_hash_map.
v1->v2: Addressed comments from Alexei Starovoitov.
- add a selftest for bpf_map_lookup_percpu_elem.
Feng Zhou (2):
bpf: add bpf_map_lookup_percpu_elem for percpu map
selftests/bpf: add test case for bpf_map_lookup_percpu_elem
include/linux/bpf.h | 2 +
include/uapi/linux/bpf.h | 9 ++++
kernel/bpf/arraymap.c | 15 ++++++
kernel/bpf/core.c | 1 +
kernel/bpf/hashtab.c | 32 +++++++++++
kernel/bpf/helpers.c | 18 +++++++
kernel/bpf/verifier.c | 17 +++++-
kernel/trace/bpf_trace.c | 2 +
tools/include/uapi/linux/bpf.h | 9 ++++
.../bpf/prog_tests/map_lookup_percpu_elem.c | 46 ++++++++++++++++
.../bpf/progs/test_map_lookup_percpu_elem.c | 54 +++++++++++++++++++
11 files changed, 203 insertions(+), 2 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/map_lookup_percpu_elem.c
create mode 100644 tools/testing/selftests/bpf/progs/test_map_lookup_percpu_elem.c
--
2.20.1
Powered by blists - more mailing lists