From: Daniel Borkmann <daniel@iogearbox•net>
To: Martin KaFai Lau <kafai@fb•com>, netdev <netdev@vger•kernel.org>
Cc: Alexei Starovoitov <ast@fb•com>, FB Kernel Team <Kernel-team@fb•com>
Subject: Re: [PATCH net-next 1/4] bpf: Fix and simplifications on inline map lookup
Date: Wed, 22 Mar 2017 20:33:16 +0100 [thread overview]
Message-ID: <58D2D17C.5000508@iogearbox.net> (raw)
In-Reply-To: <20170322170035.923581-2-kafai@fb.com>
On 03/22/2017 06:00 PM, Martin KaFai Lau wrote:
> Fix in verifier:
> For the same bpf_map_lookup_elem() instruction (i.e. "call 1"),
> a broken case is "a different type of map could be used for the
> same lookup instruction". For example, an array in one case and a
> hashmap in another. We have to resort to the old dynamic call behavior
> in this case. The fix is to check for collision on insn_aux->map_ptr.
> If there is collision, don't inline the map lookup.
>
> Please see the "do_reg_lookup()" in test_map_in_map_kern.c in the later
> patch for how-to trigger the above case.
>
> Simplifications on array_map_gen_lookup():
> 1. Calculate elem_size from map->value_size. It removes the
> need for 'struct bpf_array' which makes the later map-in-map
> implementation easier.
> 2. Remove the 'elem_size == 1' test
>
> Fixes: 81ed18ab3098 ("bpf: add helper inlining infra and optimize map_array lookup")
> Signed-off-by: Martin KaFai Lau <kafai@fb•com>
> Acked-by: Alexei Starovoitov <ast@kernel•org>
Ok, makes sense (could have been split into two actually).
Acked-by: Daniel Borkmann <daniel@iogearbox•net>
next prev parent reply other threads:[~2017-03-22 19:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 17:00 [PATCH net-next 0/4] bpf: Add map-in-map support Martin KaFai Lau
2017-03-22 17:00 ` [PATCH net-next 1/4] bpf: Fix and simplifications on inline map lookup Martin KaFai Lau
2017-03-22 19:33 ` Daniel Borkmann [this message]
2017-03-22 17:00 ` [PATCH net-next 2/4] bpf: Add array of maps support Martin KaFai Lau
2017-03-22 17:00 ` [PATCH net-next 3/4] bpf: Add hash " Martin KaFai Lau
2017-03-22 17:00 ` [PATCH net-next 4/4] bpf: Add tests for map-in-map Martin KaFai Lau
2017-03-22 22:46 ` [PATCH net-next 0/4] bpf: Add map-in-map support David Miller
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=58D2D17C.5000508@iogearbox.net \
--to=daniel@iogearbox$(echo .)net \
--cc=Kernel-team@fb$(echo .)com \
--cc=ast@fb$(echo .)com \
--cc=kafai@fb$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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