From: Yonghong Song <yhs@fb.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>,
"Daniel Borkmann" <daniel@iogearbox.net>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"David Miller" <davem@davemloft.net>,
"Jesper Dangaard Brouer" <brouer@redhat.com>,
"Jakub Kicinski" <jakub.kicinski@netronome.com>,
"Björn Töpel" <bjorn.topel@gmail.com>
Subject: Re: [PATCH bpf-next v3 3/6] xdp: Add devmap_hash map type for looking up devices by hashed index
Date: Mon, 8 Jul 2019 16:47:31 +0000 [thread overview]
Message-ID: <aa88130d-91d4-981d-04b0-b2d20c244437@fb.com> (raw)
In-Reply-To: <156258334732.1664.10214955962271992722.stgit@alrua-x1>
On 7/8/19 3:55 AM, Toke Høiland-Jørgensen wrote:
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> A common pattern when using xdp_redirect_map() is to create a device map
> where the lookup key is simply ifindex. Because device maps are arrays,
> this leaves holes in the map, and the map has to be sized to fit the
> largest ifindex, regardless of how many devices actually are actually
> needed in the map.
>
> This patch adds a second type of device map where the key is looked up
> using a hashmap, instead of being used as an array index. This allows maps
> to be densely packed, so they can be smaller.
>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Yonghong Song <yhs@fb.com>
> ---
> include/linux/bpf.h | 7 ++
> include/linux/bpf_types.h | 1
> include/trace/events/xdp.h | 3 -
> include/uapi/linux/bpf.h | 1
> kernel/bpf/devmap.c | 194 ++++++++++++++++++++++++++++++++++++++++++++
> kernel/bpf/verifier.c | 2
> net/core/filter.c | 9 ++
> 7 files changed, 214 insertions(+), 3 deletions(-)
next prev parent reply other threads:[~2019-07-08 16:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 10:55 [PATCH bpf-next v3 0/6] xdp: Add devmap_hash map type Toke Høiland-Jørgensen
2019-07-08 10:55 ` [PATCH bpf-next v3 1/6] include/bpf.h: Remove map_insert_ctx() stubs Toke Høiland-Jørgensen
2019-07-08 10:55 ` [PATCH bpf-next v3 4/6] tools/include/uapi: Add devmap_hash BPF map type Toke Høiland-Jørgensen
2019-07-08 16:47 ` Yonghong Song
2019-07-08 10:55 ` [PATCH bpf-next v3 2/6] xdp: Refactor devmap allocation code for reuse Toke Høiland-Jørgensen
2019-07-08 10:55 ` [PATCH bpf-next v3 6/6] tools: Add definitions for devmap_hash map type Toke Høiland-Jørgensen
2019-07-08 10:55 ` [PATCH bpf-next v3 3/6] xdp: Add devmap_hash map type for looking up devices by hashed index Toke Høiland-Jørgensen
2019-07-08 16:47 ` Yonghong Song [this message]
2019-07-08 10:55 ` [PATCH bpf-next v3 5/6] tools/libbpf_probes: Add new devmap_hash type Toke Høiland-Jørgensen
2019-07-08 16:48 ` Yonghong Song
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=aa88130d-91d4-981d-04b0-b2d20c244437@fb.com \
--to=yhs@fb.com \
--cc=ast@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.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