summaryrefslogtreecommitdiff
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2022-11-14 22:15:23 +0300
committerAlexei Starovoitov <ast@kernel.org>2022-11-15 08:52:45 +0300
commit2d577252579b3efb9e934b68948a2edfa9920110 (patch)
tree8b38a496bcd346b6302ab2665aca32c451b14502 /include/linux/bpf.h
parent1f6d52f1a8947436dc5b2575e2fffb831f240141 (diff)
downloadlinux-2d577252579b3efb9e934b68948a2edfa9920110.tar.xz
bpf: Remove BPF_MAP_OFF_ARR_MAX
In f71b2f64177a ("bpf: Refactor map->off_arr handling"), map->off_arr was refactored to be btf_field_offs. The number of field offsets is equal to maximum possible fields limited by BTF_FIELDS_MAX. Hence, reuse BTF_FIELDS_MAX as spin_lock and timer no longer are to be handled specially for offset sorting, fix the comment, and remove incorrect WARN_ON as its rec->cnt can never exceed this value. The reason to keep separate constant was the it was always more 2 more than total kptrs. This is no longer the case. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20221114191547.1694267-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 798aec816970..1a66a1df1af1 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -165,9 +165,8 @@ struct bpf_map_ops {
};
enum {
- /* Support at most 8 pointers in a BTF type */
- BTF_FIELDS_MAX = 10,
- BPF_MAP_OFF_ARR_MAX = BTF_FIELDS_MAX,
+ /* Support at most 10 fields in a BTF type */
+ BTF_FIELDS_MAX = 10,
};
enum btf_field_type {
@@ -203,8 +202,8 @@ struct btf_record {
struct btf_field_offs {
u32 cnt;
- u32 field_off[BPF_MAP_OFF_ARR_MAX];
- u8 field_sz[BPF_MAP_OFF_ARR_MAX];
+ u32 field_off[BTF_FIELDS_MAX];
+ u8 field_sz[BTF_FIELDS_MAX];
};
struct bpf_map {