netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org
Subject: Re: [bpf-next PATCH v2 2/3] bpf: sockmap, add hash map support
Date: Fri, 27 Apr 2018 17:09:16 -0700	[thread overview]
Message-ID: <20180428000914.5k5xzgdbcadnx32g@ast-mbp> (raw)
In-Reply-To: <20180427232437.9985.16313.stgit@john-Precision-Tower-5810>

On Fri, Apr 27, 2018 at 04:24:38PM -0700, John Fastabend wrote:
> Sockmap is currently backed by an array and enforces keys to be
> four bytes. This works well for many use cases and was originally
> modeled after devmap which also uses four bytes keys. However,
> this has become limiting in larger use cases where a hash would
> be more appropriate. For example users may want to use the 5-tuple
> of the socket as the lookup key.
> 
> To support this add hash support.
> 
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
> ---
>  include/linux/bpf.h            |    8 +
>  include/linux/bpf_types.h      |    1 
>  include/uapi/linux/bpf.h       |    6 
>  kernel/bpf/core.c              |    1 
>  kernel/bpf/sockmap.c           |  494 +++++++++++++++++++++++++++++++++++++++-
>  kernel/bpf/verifier.c          |   14 +
>  net/core/filter.c              |   58 +++++
>  tools/bpf/bpftool/map.c        |    1 
>  tools/include/uapi/linux/bpf.h |    6 
>  9 files changed, 570 insertions(+), 19 deletions(-)

please split tools/* update into separate commit.

Also add man-page style documentation for new helpers to uapi/bpf.h

  reply	other threads:[~2018-04-28  0:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 23:24 [bpf-next PATCH v2 0/3] Hash support for sock John Fastabend
2018-04-27 23:24 ` [bpf-next PATCH v2 1/3] bpf: sockmap, refactor sockmap routines to work with hashmap John Fastabend
2018-04-27 23:24 ` [bpf-next PATCH v2 2/3] bpf: sockmap, add hash map support John Fastabend
2018-04-28  0:09   ` Alexei Starovoitov [this message]
2018-04-27 23:24 ` [bpf-next PATCH v2 3/3] bpf: selftest additions for SOCKHASH John Fastabend
2018-04-28  0:10   ` Alexei Starovoitov
2018-04-29  3:43     ` John Fastabend

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=20180428000914.5k5xzgdbcadnx32g@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@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 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).