bpf map collision
Hi,
Can someone please explain to me the magic that makes the map accessed in the program running in the kernel same as one created in the user program. What is the use of the map name? can there be collision if say two separate processes load the exact same program.
Thanks,
Shoaib
Quoted 7 lines · Rao Shoaib
Hi,
Can someone please explain to me the magic that makes the map accessed in the program running in the kernel same as one created in the user program. What is the use of the map name? can there be collision if say two separate processes load the exact same program.
It's not magic. Map name is just a hint and there is no uniqueness requirement (and also nothing in the kernel relies on map name). Everything is working based on file descriptors (FDs). When a BPF map is created, kernel returns FD to user space. User space uses that FD to identify the BPF map.
Quoted 6 lines
Thanks,
Shoaib