Re: [PATCH bpf-next v2 06/13] libbpf: Add __percpu_kptr macro definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8/25/23 2:13 PM, Andrii Nakryiko wrote:
On Fri, Aug 25, 2023 at 12:54 PM Yonghong Song <yonghong.song@xxxxxxxxx> wrote:

Add __percpu_kptr macro definition in bpf_helpers.h.

Signed-off-by: Yonghong Song <yonghong.song@xxxxxxxxx>
---
  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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux