Thanks for your reply.
BPF_TABLE("extern") seems to work only if the eBPF program is loaded by the
same userspace process which creates the map, like in this example.
But, what if a map is created (and pinned) by process A, and an eBPF
program is loaded by another process B?
Is there any way for the eBPF program to access the pinned map?
bpf_obj_get cannot be used by eBPF programs as it is a userspace API.
On Thu, Jul 19, 2018 at 3:33 PM, Y Song <[email protected]> wrote:
> The following is an example in C++ to import an external map to BPF
> modules.
> https://github.com/iovisor/bcc/blob/master/examples/cpp/UseExternalMap.cc
> You can use libbpf function `bpf_obj_get` to get a map fd in the above
> example.
>
> On Wed, Jul 18, 2018 at 11:48 AM, <[email protected]> wrote:
> > Hi,
> >
> > I have an eBPF map created and pinned by a userspace process.
> >
> > Now I would like several eBPF programs to access this pinned eBPF map.
> >
> > Is there any bcc APIs that can be used?
> >
> > BPF_TABLE(), etc creates a new eBPF map, not loads an existing pinned
> map.
> >
> > Thanks,
> > -hs
> >
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1388): https://lists.iovisor.org/g/iovisor-dev/message/1388
Mute This Topic: https://lists.iovisor.org/mt/23673879/21656
Group Owner: [email protected]
Unsubscribe: https://lists.iovisor.org/g/iovisor-dev/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-