On Sat, Feb 4, 2017 at 6:25 PM, Daehyeok Kim via iovisor-dev
<iovisor-dev@lists.iovisor.org> wrote:
> Hello,
>
> I am trying to use the eBPF map to share data between two different BPF 
> modules.
> In eBPF module A, I defined a table using BPF_TABLE_PUBLIC ("hash",..,...) and
> in the other module B, I define a table using BPF_TABLE ("extern", ..., ...).
> I confirmed that the module B can access a content of the original
> table defined in A when I loaded the modules in the same network
> namespace.
Are they also in the same process?
>
> I encountered a problem when I tried to load the module A in a network
> namespace A and load the module B in a namespace B; while the module A
> is loaded successfully, it fails to compile the module B with the
> following error:
I suspect that the error is due to attempting to share between
processes, rather than between namespaces. The former requires support
via map pinning whereas the latter should work (but likely depends on
the former in practice).
>
> /virtual/main.c:29:1: error: could not open bpf map: No such file or directory
> is maps/extern map type enabled in your kernel?
> BPF_TABLE("extern", struct Key, struct Val, test, 1000);
> ^
> /virtual/include/bcc/helpers.h:58:76: note: expanded from macro 'BPF_TABLE'
> #define BPF_TABLE(_table_type, _key_type, _leaf_type, _name, _max_entries) \
>                                                                            ^
> /virtual/include/bcc/helpers.h:54:4: note: expanded from macro '\
> BPF_F_TABLE'
> }; \
>
> It seems that it cannot find the public table from different namespace.
> Is there any way to solve this problem?
> Or is it invalid to access a public BPF table of another module
> running on a different namespace?
Were the externed maps to support pinning, then sharing across
namespaces should work with some hoop jumping.
>
> Thanks!
> _______________________________________________
> iovisor-dev mailing list
> iovisor-dev@lists.iovisor.org
> https://lists.iovisor.org/mailman/listinfo/iovisor-dev
_______________________________________________
iovisor-dev mailing list
iovisor-dev@lists.iovisor.org
https://lists.iovisor.org/mailman/listinfo/iovisor-dev

Reply via email to