Skip to content

map: don't unmarshal unnecessary items on batch lookup #1080

Open
@ti-mo

Description

@ti-mo

It does seem like Map.batchLookup() always tries to unmarshal the whole keyBuf and valueBuf regardless of the Count received from the batch syscall.

ebpf/map.go

Lines 1076 to 1083 in c739d15

err := sysenc.Unmarshal(keysOut, keyBuf)
if err != nil {
return 0, err
}
err = sysenc.Unmarshal(valuesOut, valueBuf)
if err != nil {
return 0, err
}

It would be nice if we instead only decoded count keys and values.

See #1078 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions