Skip to content

Commit 99d0a38

Browse files
htejunAlexei Starovoitov
authored andcommitted
bpf: Move BPF_MAP_TYPE for INODE_STORAGE and TASK_STORAGE outside of CONFIG_NET
bpf_types.h has BPF_MAP_TYPE_INODE_STORAGE and BPF_MAP_TYPE_TASK_STORAGE declared inside #ifdef CONFIG_NET although they are built regardless of CONFIG_NET. So, when CONFIG_BPF_SYSCALL && !CONFIG_NET, they are built without the declarations leading to spurious build failures and not registered to bpf_map_types making them unavailable. Fix it by moving the BPF_MAP_TYPE for the two map types outside of CONFIG_NET. Reported-by: kernel test robot <[email protected]> Fixes: a10787e ("bpf: Enable task local storage for tracing programs") Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent a94b5aa commit 99d0a38

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/bpf_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_STACK_TRACE, stack_trace_map_ops)
101101
#endif
102102
BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops)
103103
BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
104-
#ifdef CONFIG_NET
105-
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
106-
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
107-
BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
108104
#ifdef CONFIG_BPF_LSM
109105
BPF_MAP_TYPE(BPF_MAP_TYPE_INODE_STORAGE, inode_storage_map_ops)
110106
#endif
111107
BPF_MAP_TYPE(BPF_MAP_TYPE_TASK_STORAGE, task_storage_map_ops)
108+
#ifdef CONFIG_NET
109+
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
110+
BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
111+
BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
112112
BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
113113
#if defined(CONFIG_XDP_SOCKETS)
114114
BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)

0 commit comments

Comments
 (0)