From 4364227e70429a882ac0e46d5a40ac85282179b5 Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Tue, 25 Mar 2025 09:25:11 +0900 Subject: [PATCH] Set BPF_F_NO_PREALLOC for BPF_MAP_TYPE_SK_STORAGE by default BPF_F_NO_PREALLOC flag is mandatory for BPF_MAP_TYPE_SK_STORAGE Test: boot Bug: 406080305 Change-Id: I22f12525512ea8047ef5ad9fbf93490558c13c3d --- bpf/headers/include/bpf_helpers.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bpf/headers/include/bpf_helpers.h b/bpf/headers/include/bpf_helpers.h index 9d6b6f6920..199661de65 100644 --- a/bpf/headers/include/bpf_helpers.h +++ b/bpf/headers/include/bpf_helpers.h @@ -256,10 +256,11 @@ static void (*bpf_ringbuf_submit_unsafe)(const void* data, __u64 flags) = (void* #define ABSOLUTE(x) ((x) < 0 ? -(x) : (x)) -#define DEFAULT_BPF_MAP_FLAGS(type, num_entries, mapflags) \ - ( (mapflags) | \ - ((num_entries) < 0 ? BPF_F_NO_PREALLOC : 0) | \ - (type == BPF_MAP_TYPE_LPM_TRIE ? BPF_F_NO_PREALLOC : 0) \ +#define DEFAULT_BPF_MAP_FLAGS(type, num_entries, mapflags) \ + ( (mapflags) | \ + ((num_entries) < 0 ? BPF_F_NO_PREALLOC : 0) | \ + ( (type == BPF_MAP_TYPE_LPM_TRIE || \ + type == BPF_MAP_TYPE_SK_STORAGE) ? BPF_F_NO_PREALLOC : 0) \ ) #define DEFINE_BPF_MAP_BASE(the_map, TYPE, keysize, valuesize, num_entries, \