xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using pinned maps within a network namespace
@ 2020-09-15 17:00 John McDowall
  2020-09-16  5:11 ` Y Song
  2020-09-16  9:22 ` Quentin Monnet
  0 siblings, 2 replies; 7+ messages in thread
From: John McDowall @ 2020-09-15 17:00 UTC (permalink / raw)
  To: xdp-newbies

Hi everyone,

This may be a dumb question, I have set up a simple test environment
with multiple network namespaces running on a ubuntu 20.04 vagrant
box, with the latest github libbpf.

I want to use a pinned map, I can make /sys/fs/bpf shared by:

$ mount mount --make-shared /sys/fs/bpf
$ mount --bind /sys/fs/bpf /sys/fs/bpf

but when I try access the maps from a C program running in a namespace
using bpf I get

 Access to /sys/fs/bpf/lwtconfig map failed obj_pin errno: No such
file or directory

The code snippet is:

mapfd = bpf_obj_pin(pin_fd,CONFIG_MAP_PATH);
        if (mapfd < 0) {
            jed_info(jed_logfile,"Access to %s map failed obj_pin ",
CONFIG_MAP_PATH);
            pin_fd = bpf_obj_get(CONFIG_MAP_PATH);
            if (pin_fd < 0){
             jed_error(jed_logfile,"Access to %s map failed with
obj_get ", CONFIG_MAP_PATH);
            }
        }

Is this possible, and if so what am I missing?

Regards

John

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

end of thread, other threads:[~2020-09-28 17:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 17:00 Using pinned maps within a network namespace John McDowall
2020-09-16  5:11 ` Y Song
2020-09-16 14:49   ` John McDowall
2020-09-25 22:54   ` John McDowall
2020-09-28 17:23     ` Y Song
2020-09-16  9:22 ` Quentin Monnet
2020-09-16 14:53   ` John McDowall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).