All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Kiran T <kiran.lkml@gmail.com>
Cc: xdp-newbies@vger.kernel.org, brouer@redhat.com
Subject: Re: Accessing userspace created persistent eBPF maps from kernel bpf restricted C
Date: Fri, 8 Sep 2017 09:45:25 +0200	[thread overview]
Message-ID: <20170908094525.7b05dcf9@redhat.com> (raw)
In-Reply-To: <CABUc5FF3Lx=7ECCT_bzxcbKHkXX1Vs66KJHabJExqTJ8Bz0VgA@mail.gmail.com>

On Thu, 7 Sep 2017 14:37:42 -0700 Kiran T <kiran.lkml@gmail.com> wrote:

> The samples and test cases have examples showing how user space
> programs can pin maps and get pinned maps as FDs.  However, how would
> one access a user-space created pinned map from kernel space, without
> having to statically have a 'maps' section defined (and depend on the
> elf loader)?

Reading further in the thread, I do realize that you have special or
strange use case that is hard/impossible with bpf, as the map type is
needed at bpf load/verifier time.

(IMHO) A more common issue is: asking how can I change/update an
BPF-elf-object-file to use another bpf-map at load-time?

The use-case behind this question is:  I have pinned bpf-map accessible
via the filesystem (bpffs), and I want several BPF programs to
share-and-use this map (on the kernel side).

This is what I'm doing in my xdp_ddos01 example[1].  You can load
xdp_ddos01 on several NICs and they will all share and use the same
blacklist-maps. I've highlighted the code here[1]:

[1] https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/samples/bpf/xdp_ddos01_blacklist_user.c#L186-L218

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  parent reply	other threads:[~2017-09-08  7:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 21:37 Accessing userspace created persistent eBPF maps from kernel bpf restricted C Kiran T
2017-09-07 23:17 ` Zvi Effron
2017-09-08  0:46   ` Kiran T
2017-09-08  0:57     ` Zvi Effron
2017-09-08  2:12     ` David Miller
2017-09-08  5:28       ` Kiran T
2017-09-08  6:11         ` David Miller
2017-09-08  6:34         ` Zvi Effron
2017-09-08 16:42           ` Kiran T
2017-09-08 17:37             ` Zvi Effron
2017-09-08 18:02               ` Y Song
2017-09-08 15:35         ` Daniel Borkmann
2017-09-08  7:45 ` Jesper Dangaard Brouer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-07 17:38 Kiran T

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=20170908094525.7b05dcf9@redhat.com \
    --to=brouer@redhat.com \
    --cc=kiran.lkml@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.