From: Yonghong Song <yonghong.song@linux.dev>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next v2 06/13] libbpf: Add __percpu_kptr macro definition
Date: Fri, 25 Aug 2023 16:13:41 -0700 [thread overview]
Message-ID: <5afada42-8548-1709-26a1-ad68d4c45915@linux.dev> (raw)
In-Reply-To: <CAEf4BzaA6y5sru6y0HK=6u4n+F-tOZ+5TFvBCbiMfRj7Ti-iUw@mail.gmail.com>
On 8/25/23 2:13 PM, Andrii Nakryiko wrote:
> On Fri, Aug 25, 2023 at 12:54 PM Yonghong Song <yonghong.song@linux.dev> wrote:
>>
>> Add __percpu_kptr macro definition in bpf_helpers.h.
>>
>> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
>> ---
>> tools/lib/bpf/bpf_helpers.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h
>> index bbab9ad9dc5a..77ceea575dc7 100644
>> --- a/tools/lib/bpf/bpf_helpers.h
>> +++ b/tools/lib/bpf/bpf_helpers.h
>> @@ -181,6 +181,7 @@ enum libbpf_tristate {
>> #define __ksym __attribute__((section(".ksyms")))
>> #define __kptr_untrusted __attribute__((btf_type_tag("kptr_untrusted")))
>> #define __kptr __attribute__((btf_type_tag("kptr")))
>> +#define __percpu_kptr __attribute__((btf_type_tag("percpu_kptr")))
>
> total nitpick, but given kptr_untrusted, should this stick to the
> pattern and be __kptr_percpu? It keeps this "kptr" umbrella/namespace
> consistent
Alexei mentioned that __kptr_untrusted might be deprecated in
the future.
I am using __percpu_kptr just feel it is more nature to user
e.g., we use 'percpu ptr' for kernel percpu ptr. But I can change
the name if there is a consensus among community.
>
>>
>> #define bpf_ksym_exists(sym) ({ \
>> _Static_assert(!__builtin_constant_p(!!sym), #sym " should be marked as __weak"); \
>> --
>> 2.34.1
>>
next prev parent reply other threads:[~2023-08-25 23:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 19:53 [PATCH bpf-next v2 00/13] bpf: Add support for local percpu kptr Yonghong Song
2023-08-25 19:53 ` [PATCH bpf-next v2 01/13] bpf: Add support for non-fix-size percpu mem allocation Yonghong Song
2023-08-25 19:53 ` [PATCH bpf-next v2 02/13] bpf: Add BPF_KPTR_PERCPU as a field type Yonghong Song
2023-08-25 19:53 ` [PATCH bpf-next v2 03/13] bpf: Add alloc/xchg/direct_access support for local percpu kptr Yonghong Song
2023-08-25 19:53 ` [PATCH bpf-next v2 04/13] bpf: Add bpf_this_cpu_ptr/bpf_per_cpu_ptr support for allocated percpu obj Yonghong Song
2023-08-25 19:53 ` [PATCH bpf-next v2 05/13] selftests/bpf: Update error message in negative linked_list test Yonghong Song
2023-08-25 19:53 ` [PATCH bpf-next v2 06/13] libbpf: Add __percpu_kptr macro definition Yonghong Song
2023-08-25 21:13 ` Andrii Nakryiko
2023-08-25 23:13 ` Yonghong Song [this message]
2023-08-25 19:54 ` [PATCH bpf-next v2 07/13] selftests/bpf: Add bpf_percpu_obj_{new,drop}() macro in bpf_experimental.h Yonghong Song
2023-08-25 19:54 ` [PATCH bpf-next v2 08/13] selftests/bpf: Add tests for array map with local percpu kptr Yonghong Song
2023-08-25 19:54 ` [PATCH bpf-next v2 09/13] bpf: Mark OBJ_RELEASE argument as MEM_RCU when possible Yonghong Song
2023-08-25 19:54 ` [PATCH bpf-next v2 10/13] selftests/bpf: Remove unnecessary direct read of local percpu kptr Yonghong Song
2023-08-25 19:54 ` [PATCH bpf-next v2 11/13] selftests/bpf: Add tests for cgrp_local_storage with " Yonghong Song
2023-08-25 19:54 ` [PATCH bpf-next v2 12/13] selftests/bpf: Add some negative tests Yonghong Song
2023-08-25 19:54 ` [PATCH bpf-next v2 13/13] bpf: Mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated Yonghong Song
2023-08-26 5:58 ` [PATCH bpf-next v2 00/13] bpf: Add support for local percpu kptr Yonghong Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5afada42-8548-1709-26a1-ad68d4c45915@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.