[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181011235136.mfryrjhur6yoslp5@ast-mbp.dhcp.thefacebook.com>
Date: Thu, 11 Oct 2018 16:51:38 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Mauricio Vasquez <mauricio.vasquez@...ito.it>
Cc: Song Liu <liu.song.a23@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Networking <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next v2 3/7] bpf: add MAP_LOOKUP_AND_DELETE_ELEM
syscall
On Wed, Oct 10, 2018 at 05:50:01PM -0500, Mauricio Vasquez wrote:
> > > Does it make sense to you?
> > I reread the other patch, and found it does NOT use the following logic for
> > queue and stack:
> >
> > rcu_read_lock();
> > ptr = map->ops->map_lookup_and_delete_elem(map, key);
> > if (ptr)
> > memcpy(value, ptr, value_size);
> >
> > I guess this part is not used at all? Can we just remove it?
> >
> > Thanks,
> > Song
>
> This is the base code for map_lookup_and_delete support, it is not used in
> queue/stack maps.
>
> I think we can leave it there, so when somebody implements lookup_and_delete
> for other maps doesn't have to care about implementing also this.
The code looks useful to me, but I also agree with Song. And in the kernel
we don't typically add 'almost dead code'.
May be provide an implementation of the lookup_and_delete for hash map
so it's actually used ?
imo it would be a useful feature to have for hash map and will clarify
the intent of it for all other maps and for stack/queue in particular.
Powered by blists - more mailing lists