xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John McDowall <jmcdowall@paloaltonetworks.com>
To: "xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>
Subject: Using pinned maps within a network namespace
Date: Tue, 15 Sep 2020 10:00:11 -0700	[thread overview]
Message-ID: <CAHQoOTbXqZ0_djDbMuXwSs31Mo3dRCSFShD1NvW+Dz2YmKiejw@mail.gmail.com> (raw)

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

             reply	other threads:[~2020-09-15 18:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 17:00 John McDowall [this message]
2020-09-16  5:11 ` Using pinned maps within a network namespace 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHQoOTbXqZ0_djDbMuXwSs31Mo3dRCSFShD1NvW+Dz2YmKiejw@mail.gmail.com \
    --to=jmcdowall@paloaltonetworks.com \
    --cc=xdp-newbies@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).