bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Denis Salopek <denis.salopek@sartura.hr>
Cc: bpf <bpf@vger.kernel.org>, Luka Perkov <luka.perkov@sartura.hr>,
	Luka Oreskovic <luka.oreskovic@sartura.hr>,
	Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
Subject: Re: [PATCH bpf-next] bpf: add lookup_and_delete_elem support to hashtab
Date: Mon, 22 Feb 2021 16:53:12 -0800	[thread overview]
Message-ID: <CAEf4BzbckC2K29OWp=e7+oJd7U+NPszOkd=pp2RawOVC8SK0Jg@mail.gmail.com> (raw)
In-Reply-To: <YCwIMN3btcpQbIxZ@gmail.com>

On Tue, Feb 16, 2021 at 10:00 AM Denis Salopek <denis.salopek@sartura.hr> wrote:
>
> On Mon, Feb 08, 2021 at 09:44:59PM -0800, Andrii Nakryiko wrote:
> > On Wed, Jan 27, 2021 at 9:15 AM Denis Salopek <denis.salopek@sartura.hr> wrote:
> > >
> > > Extend the existing bpf_map_lookup_and_delete_elem() functionality to
> > > hashtab maps, in addition to stacks and queues.
> > > Create a new hashtab bpf_map_ops function that does lookup and deletion
> > > of the element under the same bucket lock and add the created map_ops to
> > > bpf.h.
> > > Add the appropriate test case to 'maps' selftests.
> > >
> > > Signed-off-by: Denis Salopek <denis.salopek@sartura.hr>
> > > Cc: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
> > > Cc: Luka Oreskovic <luka.oreskovic@sartura.hr>
> > > Cc: Luka Perkov <luka.perkov@sartura.hr>
> > > ---
> >
> > I think this patch somehow got lost, even though it seems like a good
> > addition. I'd recommend rebasing and re-submitting to let people take
> > a fresh look at this.
> >
> > It would also be nice to have a test_progs test added, not just
> > test_maps. I'd also look at supporting lookup_and_delete for other
> > kinds of hash maps (LRU, per-CPU), so that the support is more
> > complete. Thanks!
> >
>
> Hi Andrii,
>
> I'll also implement the LRU and per-CPU ones and resubmit. I don't quite
> understand the test_progs, what kind of test(s) exactly should I add there?

test_progs is our preferred test runner. It's a collection of
independent tests (sometimes including subtests). See any of the
recently added tests to get a feel for it. test_progs' tests resemble
real-world applications much closer than test_verifier or test_maps
tests, so it serves both as a readable test and as an API demo.

>
> Denis
>
> > >  include/linux/bpf.h                     |  1 +
> > >  kernel/bpf/hashtab.c                    | 38 +++++++++++++++++++++++++
> > >  kernel/bpf/syscall.c                    |  9 ++++++
> > >  tools/testing/selftests/bpf/test_maps.c |  7 +++++
> > >  4 files changed, 55 insertions(+)
> > >
> >
> > [...]

  reply	other threads:[~2021-02-23  0:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 17:12 [PATCH bpf-next] bpf: add lookup_and_delete_elem support to hashtab Denis Salopek
2021-02-09  5:44 ` Andrii Nakryiko
2021-02-16 18:00   ` Denis Salopek
2021-02-23  0:53     ` Andrii Nakryiko [this message]
     [not found] ` <74e61161-3330-88b8-aa18-84d7357cd945@iogearbox.net>
2021-02-10 17:56   ` Denis Salopek
2021-02-11  0:25     ` Daniel Borkmann
2021-02-16 19:46       ` Denis Salopek

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='CAEf4BzbckC2K29OWp=e7+oJd7U+NPszOkd=pp2RawOVC8SK0Jg@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=denis.salopek@sartura.hr \
    --cc=juraj.vijtiuk@sartura.hr \
    --cc=luka.oreskovic@sartura.hr \
    --cc=luka.perkov@sartura.hr \
    /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).