Run below commands to create and update a map,
# bpftool map create /sys/fs/bpf/map1 type hash key 4 value 4 entries 8 name map1
# bpftool map update name map1 key 0x01 0x02 0x03 0x04 value 0x05 0x06 0x07 0x08
the key:value can be seen with dump,
# bpftool map dump name map1
key: 01 02 03 04 value: 05 06 07 08
Found 1 element
but can't be looked up,
# bpftool map lookup name map1 key 0x01 0x02 0x03 0x04
no output
it works on {*}ubuntu 22.04+bpftool-v7.0.0{*},
sudo bpftool map lookup name map1 key 0x01 0x02 0x03 0x04
key: 01 02 03 04 value: 05 06 07 08
$ setup.sh --machines intel-x86-64 --templates feature/bpf --distro wrlinux --dl-layers=1 --accept-eula=yes && source environment-setup-x86_64-wrlinuxsdk-linux && source oe-init-build-env build $ echo 'IMAGE_INSTALL:append = " clang libbpf libbpf-dev"' >>conf/local.conf $ bitbake wrlinux-image-std # boot the target and run bpftool commands