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.

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:

/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?

Thanks!
_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev

Reply via email to