BPF List
 help / color / mirror / Atom feed
* bpf map collision
@ 2024-06-17 10:22 Rao Shoaib
  2024-06-25  3:30 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Rao Shoaib @ 2024-06-17 10:22 UTC (permalink / raw)
  To: bpf

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bpf map collision
  2024-06-17 10:22 bpf map collision Rao Shoaib
@ 2024-06-25  3:30 ` Andrii Nakryiko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2024-06-25  3:30 UTC (permalink / raw)
  To: Rao Shoaib; +Cc: bpf

On Mon, Jun 17, 2024 at 3:22 AM Rao Shoaib <rao.shoaib@oracle.com> wrote:
>
> 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.

>
> Thanks,
>
> Shoaib
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-25  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 10:22 bpf map collision Rao Shoaib
2024-06-25  3:30 ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox