From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Networking <netdev@vger.kernel.org>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
David Miller <davem@davemloft.net>,
Jonathan Lemon <jonathan.lemon@gmail.com>
Subject: Re: [PATCH bpf-next v4 3/3] devmap: Allow map lookups from eBPF
Date: Fri, 14 Jun 2019 17:08:45 -0700 [thread overview]
Message-ID: <CAEf4Bzb_vB7VSCAEuXa_Rh04NzbOf8=0TzZ-yW8mV9uK3Jimsg@mail.gmail.com> (raw)
In-Reply-To: <156042464164.25684.10124291261871041128.stgit@alrua-x1>
On Thu, Jun 13, 2019 at 8:31 AM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> We don't currently allow lookups into a devmap from eBPF, because the map
> lookup returns a pointer directly to the dev->ifindex, which shouldn't be
> modifiable from eBPF.
>
> However, being able to do lookups in devmaps is useful to know (e.g.)
> whether forwarding to a specific interface is enabled. Currently, programs
> work around this by keeping a shadow map of another type which indicates
> whether a map index is valid.
>
> Since we now have a flag to make maps read-only from the eBPF side, we can
> simply lift the lookup restriction if we make sure this flag is always set.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> ---
Acked-by: Andrii Nakryiko <andriin@fb.com>
next prev parent reply other threads:[~2019-06-15 0:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 11:17 [PATCH bpf-next v4 0/3] xdp: Allow lookup into devmaps before redirect Toke Høiland-Jørgensen
2019-06-13 11:17 ` [PATCH bpf-next v4 3/3] devmap: Allow map lookups from eBPF Toke Høiland-Jørgensen
2019-06-15 0:08 ` Andrii Nakryiko [this message]
2019-06-13 11:17 ` [PATCH bpf-next v4 2/3] bpf_xdp_redirect_map: Perform map lookup in eBPF helper Toke Høiland-Jørgensen
2019-06-14 23:07 ` Andrii Nakryiko
2019-06-15 10:11 ` Toke Høiland-Jørgensen
2019-06-13 11:17 ` [PATCH bpf-next v4 1/3] devmap/cpumap: Use flush list instead of bitmap Toke Høiland-Jørgensen
2019-06-13 18:36 ` Andrii Nakryiko
2019-06-13 18:40 ` [PATCH bpf-next v4 0/3] xdp: Allow lookup into devmaps before redirect Jonathan Lemon
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='CAEf4Bzb_vB7VSCAEuXa_Rh04NzbOf8=0TzZ-yW8mV9uK3Jimsg@mail.gmail.com' \
--to=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jonathan.lemon@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.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 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).