All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Alexei Starovoitov <ast@plumgrid.com>, He Kuang <hekuang@huawei.com>
Cc: wangnan0@huawei.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] bpf: Suggestion on bpf syscall interface
Date: Sat, 28 Mar 2015 23:16:36 +0100	[thread overview]
Message-ID: <55172844.7070108@iogearbox.net> (raw)
In-Reply-To: <5516E32B.6030502@plumgrid.com>

On 03/28/2015 06:21 PM, Alexei Starovoitov wrote:
> On 3/28/15 4:36 AM, He Kuang wrote:
>> Hi, Alexei
>>
>> In our end-end IO module project, we use bpf maps to record
>> configurations. According to current bpf syscall interface, we
>> should specify map_fd to lookup/update bpf maps, so we are
>> restricted to do config in the same user program.
>
> you can pass map_fd and prog_fd from one process to another via normal
> scm_rights mechanism.

+1, I've just tried that out in the context of a different work and
works like a charm.

>> My suggestion is to export this kind of operations to sysfs, so
>> we can load&attach bpf progs and config it seperately. We
>> implement this feature in our demo project. What's your opinion
>> on this?
>
> Eventually we may use single sysfs file for lsmod-like listings, but I
> definitely don't want to create parallel interface to maps via sysfs.

Yes, that would be a bad design decision. Btw, even more lightweight
for kernel-side would be to just implement .show_fdinfo() for the anon
indoes on the map/prog store and have some meta information exported
from there. You can then grab that via /proc/<pid>/fdinfo/<fd>, I
would consider such a thing a slow-path operation anyway, and you would
also get the app info using it for free.

> It's way too expensive and not really suitable for binary key/values.

+1

  reply	other threads:[~2015-03-28 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-28 11:36 [RFC] bpf: Suggestion on bpf syscall interface He Kuang
2015-03-28 17:21 ` Alexei Starovoitov
2015-03-28 22:16   ` Daniel Borkmann [this message]
2015-03-30  3:13   ` He Kuang
2015-03-31  3:23     ` Alexei Starovoitov

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=55172844.7070108@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@plumgrid.com \
    --cc=hekuang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangnan0@huawei.com \
    /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.