Open
Description
When a map value contains a bpf_spin_lock field, the map could not be declared as BPF_MAP_TYPE_LRU_HASH
.
struct value {
struct bpf_spin_lock semaphore;
// other fields
}
This is a eBPF its own requirement. But currently I see the error message is a generic map create: operation not supported
. I see we have similar effort before on refining error message, #1072
And in map.go
map loader would try to provide more information
func handleMapCreateError(attr sys.MapCreateAttr, spec *MapSpec, err error) error {
if errors.Is(err, unix.EPERM) {
return fmt.Errorf("map create: %w (MEMLOCK may be too low, consider rlimit.RemoveMemlock)", err)
}
if errors.Is(err, unix.EINVAL) && spec.MaxEntries == 0 {
return fmt.Errorf("map create: %w (MaxEntries may be incorrectly set to zero)", err)
}
if errors.Is(err, unix.EINVAL) && spec.Type == UnspecifiedMap {
return fmt.Errorf("map create: cannot use type %s", UnspecifiedMap)
}
if errors.Is(err, unix.EINVAL) && spec.Flags&sys.BPF_F_NO_PREALLOC > 0 {
return fmt.Errorf("map create: %w (noPrealloc flag may be incompatible with map type %s)", err, spec.Type)
}
It would be great to indicate this type of error as well.
Version: 0.17.3
Metadata
Metadata
Assignees
Labels
No labels