profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/lmb/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

cloudflare/tableflip 1888

Graceful process restarts in Go

cilium/ebpf 1511

eBPF Library for Go

cloudflare/golibs 382

Various small golang libraries

cloudflare/rakelimit 114

A fair-share ratelimiter implemented in BPF

cloudflare/dns 54

Clone of https://github.com/miekg/dns

cloudflare/backoff 35

Backoff timer shared between several projects.

lmb/asinine 28

Embeddable ASN.1 (DER) and X.509v3 decoder

cilium/ci-kernels 2

A collection of kernels used for CI builds

lmb/consul 1

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.

lmb/dns 1

DNS library in Go

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) ( 		return prog, nil 	} +	populateMaps = func() error {+		for mapName, m := range maps {+			// TODO: Store reference to MapSpec in Map to avoid this?

Nit: make your mind up about the TODO.

ti-mo

comment created time in 15 hours

PullRequestReviewEvent
PullRequestReviewEvent

push eventcilium/ebpf

Lorenz Bauer

commit sha 13cf5facb9778b4e78b90dc2bcd4ebb34e125751

link: support creating bpf_map_elem iterators We need to pass the target map fd in a separate struct to iterate the elements of a map, e.g. for bpf_map_elem and sockmap iterators.

view details

Lorenz Bauer

commit sha e68272a62f65c7ddbec8d3c2d02ec5ce2967dc4e

internal: always wrap SYS_BPF errors Make sure we never return a plain syscall.Errno so that comparisons using plain == never succeed. We do this to ensure that we can influence error comparisons via errors.Is later on.

view details

Lorenz Bauer

commit sha 12affbffce179ee00ac70210799ff6bcae53e134

map, program: remove wrapObjErr Get rid of wrapObjErr. This works by aliasing ErrNotExist to os.ErrNotExist, since errors.Is(unix.ENOENT, os.ErrNotExist) is true.

view details

Lorenz Bauer

commit sha ca492085341e0e917f48ec30704d5054c5d42ca8

map: include errnos with errors We replace some errnos from map syscalls with more descriptive sentinel errors. Include the original errno with the error so that both errors.Is(err, ErrKeyNotExist) errors.Is(err, unix.ENOENT) work. We'll use this for other errors in the future where we want to introduce our own errors without breaking callers that rely on the (coarser) errno semantics.

view details

Lorenz Bauer

commit sha dbd486fd7e27abe7af043b2835626ed4ca695656

testdata: update vmlinux BTF to 5.13.2

view details

Mauricio Vásquez

commit sha f7c00a7b0e39904bf62aa83910b55dd6c82fd834

btf: Add support for BTF_KIND_FLOAT Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>

view details

Feng Zhou

commit sha d8053b0fac2899f6262ce916991c0bdb9c392f7a

elf: support cgroup getsockname/getpeername prog Signed-off-by: Feng Zhou <zhoufeng.zf@bytedance.com>

view details

Robin Gögge

commit sha 8d021777a618a3664bd8e3ae01f73679561a1e83

features: add HaveMapType API With this commit we add a new subpackage `features`. `features` provides an API for calling processes to probe the kernel for available BPF features. The first public API function added with this commit is `HaveMapType(mt ebpf.MapType) error`, which allows to probe for available BPF map types. The results of an API call are stored in an internal cache, resulting in a probe being run at most once even if called repeatedly. Signed-off-by: Robin Gögge <r.goegge@outlook.com>

view details

Timo Beckers

commit sha 64cd6182f3a26d5ced8420d47a6ca57c1bf1c468

features/map: handle syscall errors using switch statement - Removed naked error comparison to ErrNotSupported (although valid) - Converted error handling logic to switch statement so only a single case may fire. Before, it was possible to hit multiple cases if the error from BPFMapCreate contained multiple wrapped errors. - Skipped wrapping of EPERM to avoid ending up with 'unexpected error during feature probe: operation not permitted'. Permission errors are not unexpected. Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Timo Beckers

commit sha e892d395a93c6e86ae67f0575b7259ded49bee42

features/map: unexport MapCache struct Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Sharjeel Aziz

commit sha 9ea42aad834dd529edd7a6058b05067f5ec52a02

Fix minor typos

view details

Timo Beckers

commit sha 2643aee1090899955304f1a29e4b5471444d10a9

link: document losing references to K/U(ret)probe and Tracepoint objects The finalizer we set when attaching a perfEvent as a safety measure, is potentially surprising to users. Our initial documentation was too vague, we need to explicitly state that losing the reference cuts off the event. This change documents the consequence on Tracepoint and K/U(ret)probe. Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Timo Beckers

commit sha e0b11575bb6d2b25be335e383168979d6cf4e392

link/uprobe: handle ENOTSUPP from the kernel's prepare_uprobe() When running the uprobe tests, I noticed this was failing with my copy of Bash. Offset 0x12345 seems to contain a trap instruction and is rejected by prepare_uprobe(): https://elixir.bootlin.com/linux/v5.13.3/source/kernel/events/uprobes.c#L854 This patch changes the dummy offset to 0x1 and adds some error context to the slightly esoteric ENOTSUPP. Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Zvi Effron

commit sha 5926f180ade88a568666ac364745895a8dfe91a7

Find the cgroupv2 mount point in unit tests Previous unit tests assumed that cgroupv2 was mounted at /sys/fs/cgroup/unified. While this is usually the case for systems supporting both cgroupv1 and cgroupv2, systems don't have to mount cgroupv2 to that path, and systems that don't mount cgroupv1 usually don't (or, at least, Fedora doesn't). This assumption broke unit tests on systems where cgroupv2 was mounted elsewhere. Fortunately /proc/mounts will list the cgroupv2 mount point with the file system type of `cgroup2` which makes it convenient for locating the cgroupv2 file system. Unit tests now lookup (once) the mount point instead of assuming its location, fixing unit tests on modern Fedora systems.

view details

Mattia Meleleo

commit sha 595a3a5bec60f192e15d3c2b925867e6dc3cb176

link/uprobe: support filtering by pid Signed-off-by: Mattia Meleleo <melmat@tuta.io>

view details

Jean-Tiare Le Bigot

commit sha 5089069a7881cd10934f0215ee5874f507ed9be1

types: mark PerCPUCGroupStorage as per-cpu Signed-off-by: Jean-Tiare Le Bigot <jt@yadutaf.fr>

view details

Timo Beckers

commit sha e56329f3a14fa32aaebb2cc1b5c73dfc48ddeab5

link: move cgroup2Path to testutils/, clean up mustCgroupFixtures Also execute cgroup2Path() in testutils.CreateCgroup(), simplify mustCgroupFixtures(). Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Timo Beckers

commit sha bf9a97c3237e1a178f72db8d37effe0d40f826bf

elf_reader: validate .maps ELF data one BTF map definition at a time Currently, the whole .maps section is checked for non-zero bytes, rejecting the whole ELF if it contains even a single non-zero byte. This patch results in nicer error output and doesn't reject the whole program, which currently prevents us from mixing valid and invalid BTF map definitions in a single testdata ELF. An extra check is added at the end of the function to ensure all bytes in .maps are accounted for with BTF metadata. Also documented loadBTFMaps() a bit to clarify the rationale. Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Timo Beckers

commit sha dfa597c92a8979f7f09d9dc934e43d51b10d3cd5

types_string: re-generate Stringer for maxMapType Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

Timo Beckers

commit sha 763593d2a104b8a4d8f47b1ec9cf9aeb6ceaf362

collection: remove ineffective assignments in hc.close() value receiver Signed-off-by: Timo Beckers <timo@isovalent.com>

view details

push time in 15 hours

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) ( 		return prog, nil 	} +	populateMaps = func() error {+		for mapName, m := range maps {+			// TODO: Store reference to MapSpec in Map to avoid this?+			mapSpec, ok := coll.Maps[mapName]+			if !ok {+				return fmt.Errorf("missing map spec %s", mapName)+			}++			mapSpec = mapSpec.Copy()++			// Replace any object stubs with loaded objects.+			for i, kv := range mapSpec.Contents {+				switch v := kv.Value.(type) {+				case programStub:+					prog, ok := progs[string(v)]+					if !ok {+						return fmt.Errorf("program %s not assigned, but map %s requires it: %w", v, mapName, errUnsatisfiedReference)

Program arrays can be pinned, I don't think that's an issue. Let's say userspace creates a program and a program array, writes a reference to the program to prog array index 0, and then closes the fd because it was not requested by LoadAndAssign.

I only half remembered the problem, sorry. In your scenario there is no problem when closing the program fd. The issue is that closing the fd for the program array (so, removing the last user space reference) will clear all slots of the program array even though it might still be referenced by the BPF. The result is missed tail calls. This is a really big footgun that has bitten us in production before. I thought that BPF_F_PRESERVE_ELEMS would fix this, but that flag only works for perf event arrays, not program arrays.

For map auto population this means that a program array that is populated by the library has to be explicitly requested / held on to by the user. Otherwise tail calls will fail mysteriously.

In the best case we could detect that a program array is only referenced by the BPF and return an error? Unfortunately that requires fudging lazyLoadCollection even more to distinguish between "map required by BPF" and "map required by user".

Otherwise we could ignore the problem.

The last reference to that program is the entry in index 0, and if that map key gets overwritten, the program gets deallocated.

That's sane behaviour, don't you think?

ti-mo

comment created time in 18 hours

PullRequestReviewEvent

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { 	return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging+// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map+// definitions to extract static declarations of map contents.+func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) {+	// The elements of a .values pointer array are not encoded in BTF.+	// Instead, relocations are generated into each array index.+	// However, it's possible to leave certain array indices empty, so all+	// indices' offsets need to be checked for emitted relocations.++	// The offset of the 'values' member within the _struct_ (in bits)+	// is the starting point of the array. Convert to bytes. Add VarSecinfo+	// offset to get the absolute position in the ELF blob.+	start := (member.Offset / 8) + vs.Offset

Yeah, we can do that in a separate PR.

ti-mo

comment created time in 19 hours

PullRequestReviewEvent

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) ( 		return prog, nil 	} +	populateMaps = func() error {+		for mapName, m := range maps {+			// TODO: Store reference to MapSpec in Map to avoid this?+			mapSpec, ok := coll.Maps[mapName]+			if !ok {+				return fmt.Errorf("missing map spec %s", mapName)+			}++			mapSpec = mapSpec.Copy()++			// Replace any object stubs with loaded objects.+			for i, kv := range mapSpec.Contents {+				switch v := kv.Value.(type) {+				case programStub:+					prog, ok := progs[string(v)]+					if !ok {+						return fmt.Errorf("program %s not assigned, but map %s requires it: %w", v, mapName, errUnsatisfiedReference)

I'm concerned about refcounting traps since we won't be holding on to any references to inner maps/progs.

Hmm you mean the behaviour that program arrays are removed when the user space handle goes away? Yeah, that is really annoying. I remember that there is a flag which restores a sane behaviour, could we force enable this for ProgramArrays?

ti-mo

comment created time in 19 hours

PullRequestReviewEvent

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { 	return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging+// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map+// definitions to extract static declarations of map contents.+func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) {+	// The elements of a .values pointer array are not encoded in BTF.+	// Instead, relocations are generated into each array index.+	// However, it's possible to leave certain array indices empty, so all+	// indices' offsets need to be checked for emitted relocations.++	// The offset of the 'values' member within the _struct_ (in bits)+	// is the starting point of the array. Convert to bytes. Add VarSecinfo+	// offset to get the absolute position in the ELF blob.+	start := (member.Offset / 8) + vs.Offset+	// 'values' is encoded in BTF as a zero (variable) length struct+	// member, and its contents run until the end of the VarSecinfo.+	// Add VarSecinfo offset to get the absolute position in the ELF blob.+	end := vs.Size + vs.Offset+	// The size of an address in this section. This determines the width of+	// an index in the array.+	align := uint32(es.SectionHeader.Addralign)++	// Check if variable-length section is aligned.+	if (end-start)%align != 0 {+		return nil, errors.New("unaligned static values section")+	}+	elems := (end - start) / align++	if elems == 0 {+		return nil, nil+	}++	contents := make([]MapKV, 0, elems)++	// k is the array index, off is its corresponding ELF section offset.+	for k, off := uint32(0), start; k < elems; k, off = k+1, off+align {+		r, ok := es.relocations[uint64(off)]+		if ok {+			// Relocation exists for the current offset in the ELF section.+			// Emit a value stub based on the type of relocation to be replaced by+			// a real fd later in the pipeline before populating the map.+			// Map keys are encoded in MapKV entries, so empty array indices are+			// skipped here.+			switch t := elf.ST_TYPE(r.Info); t {+			case elf.STT_FUNC:

I mean using this info: https://github.com/cilium/ebpf/blob/master/elf_reader.go#L219-L231 The loader already classifies sections based on some heuristics. Instead of asking "is the symbol of the correct type" we'd check that the symbol's section has the correct kind. Writing this out, it's probably best to stick with what you have right now. We'll return an error if the map or program don't exist when creating the map.

ti-mo

comment created time in 19 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentcilium/ebpf

Support ELF map definitions larger than `bpf_map_def`

 type MapSpec struct { 	// InnerMap is used as a template for ArrayOfMaps and HashOfMaps 	InnerMap *MapSpec +	// Extra trailing bytes found in the ELF map definition when using structs+	// larger than libbpf's bpf_map_def. Must be empty before instantiating+	// the MapSpec into a Map.+	Extra bytes.Buffer

I'm trying to figure out what MapSpec.Copy should do with Extra. For consistency it would be nice to copy the field but doing that with a Buffer while keeping the original read position doesn't seem straightforward. []byte doesn't have that problem and has a smaller API surface and you can get a reader by using bytes.NewReader(spec.Extra).

ti-mo

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentcilium/ebpf

Support ELF map definitions larger than `bpf_map_def`

 type MapSpec struct { 	// InnerMap is used as a template for ArrayOfMaps and HashOfMaps 	InnerMap *MapSpec +	// Extra trailing bytes found in the ELF map definition when using structs+	// larger than libbpf's bpf_map_def. Must be empty before instantiating+	// the MapSpec into a Map.+	Extra bytes.Buffer

Why not []byte?

ti-mo

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func (m *Map) Freeze() error { 	return nil } -func (m *Map) populate(contents []MapKV) error {-	for _, kv := range contents {+// populate populates the Map according to the Contents specified+// in spec and freezes the Map if requested by spec.+func (m *Map) populate(spec *MapSpec) error {

Maybe finalize? populate makes me forget that the map might be frozen after this.

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { 	return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging+// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map+// definitions to extract static declarations of map contents.+func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) {

Why is this a free function and not a method on elfSection, like the mapSpecFromBTF change you made?

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) ( 		return prog, nil 	} +	populateMaps = func() error {+		for mapName, m := range maps {+			// TODO: Store reference to MapSpec in Map to avoid this?+			mapSpec, ok := coll.Maps[mapName]+			if !ok {+				return fmt.Errorf("missing map spec %s", mapName)+			}++			mapSpec = mapSpec.Copy()++			// Replace any object stubs with loaded objects.+			for i, kv := range mapSpec.Contents {+				switch v := kv.Value.(type) {+				case programStub:+					prog, ok := progs[string(v)]+					if !ok {+						return fmt.Errorf("program %s not assigned, but map %s requires it: %w", v, mapName, errUnsatisfiedReference)

I think this is a bit problematic, because it breaks lazy loading a bit: it's now not enough to request the maps and programs your code needs, you also need to add the transitive dependencies of maps. That isn't straight forward, except in the "load everything always" case.

Maybe its enough to call loadMap here? Same for loadProgram.

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { 	return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging+// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map+// definitions to extract static declarations of map contents.+func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) {+	// The elements of a .values pointer array are not encoded in BTF.+	// Instead, relocations are generated into each array index.+	// However, it's possible to leave certain array indices empty, so all+	// indices' offsets need to be checked for emitted relocations.++	// The offset of the 'values' member within the _struct_ (in bits)+	// is the starting point of the array. Convert to bytes. Add VarSecinfo+	// offset to get the absolute position in the ELF blob.+	start := (member.Offset / 8) + vs.Offset+	// 'values' is encoded in BTF as a zero (variable) length struct+	// member, and its contents run until the end of the VarSecinfo.+	// Add VarSecinfo offset to get the absolute position in the ELF blob.+	end := vs.Size + vs.Offset+	// The size of an address in this section. This determines the width of+	// an index in the array.+	align := uint32(es.SectionHeader.Addralign)++	// Check if variable-length section is aligned.+	if (end-start)%align != 0 {+		return nil, errors.New("unaligned static values section")+	}+	elems := (end - start) / align++	if elems == 0 {+		return nil, nil+	}++	contents := make([]MapKV, 0, elems)++	// k is the array index, off is its corresponding ELF section offset.+	for k, off := uint32(0), start; k < elems; k, off = k+1, off+align {+		r, ok := es.relocations[uint64(off)]+		if ok {+			// Relocation exists for the current offset in the ELF section.+			// Emit a value stub based on the type of relocation to be replaced by+			// a real fd later in the pipeline before populating the map.+			// Map keys are encoded in MapKV entries, so empty array indices are+			// skipped here.+			switch t := elf.ST_TYPE(r.Info); t {+			case elf.STT_FUNC:

What if we check elfCode.sections[r.Section???].kind instead? The STT_FUNC / STT_OBJECT semantics are kind of brittle, the less we rely on it the better I think.

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func (hc handleCache) close() { func lazyLoadCollection(coll *CollectionSpec, opts *CollectionOptions) (

This function is such a turd :fearful:

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { 	return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging+// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map+// definitions to extract static declarations of map contents.+func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) {+	// The elements of a .values pointer array are not encoded in BTF.+	// Instead, relocations are generated into each array index.+	// However, it's possible to leave certain array indices empty, so all+	// indices' offsets need to be checked for emitted relocations.++	// The offset of the 'values' member within the _struct_ (in bits)+	// is the starting point of the array. Convert to bytes. Add VarSecinfo+	// offset to get the absolute position in the ELF blob.+	start := (member.Offset / 8) + vs.Offset

OT: the fact that the two offsets are in different units is a footgun. Should we rename one of them, or keep both in bits?

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func resolveBTFArrayMacro(typ btf.Type) (btf.Type, error) { 	return ptr.Target, nil } +// resolveBTFValuesContents resolves relocations into ELF sections belonging+// to btf.VarSecinfo's. This can be used on the 'values' member in BTF map+// definitions to extract static declarations of map contents.+func resolveBTFValuesContents(es *elfSection, vs *btf.VarSecinfo, member btf.Member) ([]MapKV, error) {+	// The elements of a .values pointer array are not encoded in BTF.+	// Instead, relocations are generated into each array index.+	// However, it's possible to leave certain array indices empty, so all+	// indices' offsets need to be checked for emitted relocations.++	// The offset of the 'values' member within the _struct_ (in bits)+	// is the starting point of the array. Convert to bytes. Add VarSecinfo+	// offset to get the absolute position in the ELF blob.+	start := (member.Offset / 8) + vs.Offset+	// 'values' is encoded in BTF as a zero (variable) length struct+	// member, and its contents run until the end of the VarSecinfo.+	// Add VarSecinfo offset to get the absolute position in the ELF blob.+	end := vs.Size + vs.Offset+	// The size of an address in this section. This determines the width of+	// an index in the array.+	align := uint32(es.SectionHeader.Addralign)++	// Check if variable-length section is aligned.+	if (end-start)%align != 0 {+		return nil, errors.New("unaligned static values section")+	}+	elems := (end - start) / align++	if elems == 0 {+		return nil, nil+	}++	contents := make([]MapKV, 0, elems)++	// k is the array index, off is its corresponding ELF section offset.+	for k, off := uint32(0), start; k < elems; k, off = k+1, off+align {+		r, ok := es.relocations[uint64(off)]+		if ok {

Nit: if !ok { continue }

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

+/* This file excercises the ELF loader. It is not a valid BPF program. */++#include "common.h"++#if __clang_major__ >= 9++int __section("socket/tail") tail_1() {+	return 42;+}++// Tail call map (program array) initialized with program pointers.+struct {+	__uint(type, BPF_MAP_TYPE_PROG_ARRAY);+	__uint(key_size, sizeof(uint32_t));+	__uint(max_entries, 2);+	__array(values, int ());

Echoing Andrii's comment from the earlier PR: does this work for int (void*) as well?

ti-mo

comment created time in 2 days

Pull request review commentcilium/ebpf

Auto-populate tail-call and map-in-map maps from ELF/BTF

 func newMapWithOptions(spec *MapSpec, opts MapOptions, handles *handleCache) (_ 	return m, nil } -func createMap(spec *MapSpec, inner *internal.FD, opts MapOptions, handles *handleCache) (_ *Map, err error) {+// create validates the spec's properties and creates the map in the kernel+// using the given opts. It does not populate or freeze the map.+func (spec *MapSpec) create(inner *internal.FD, opts MapOptions, handles *handleCache) (_ *Map, err error) {

Bikeshed: can we stick to createMap? To me the function belongs more to Map rather than MapSpec.

ti-mo

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent