pus remain whatever they were
when the re-used entry was previously freed.
A selftest is added to validate correct operation in above
scenario as well as in case of LRU per-cpu map element re-use.
Fixes: 6c9059817432 ("bpf: pre-allocate hash map elements")
Acked-by: Matthieu Baerts
pus remain whatever they were
when the re-used entry was previously freed.
A selftest is added to validate correct operation in above
scenario as well as in case of LRU per-cpu map element re-use.
Fixes: 6c9059817432 ("bpf: pre-allocate hash map elements")
Acked-by: Matthieu Baerts
On Thu, Oct 29, 2020 at 11:37 PM Andrii Nakryiko
wrote:
>
> On Thu, Oct 29, 2020 at 11:36 AM Song Liu wrote:
> >
> > On Thu, Oct 29, 2020 at 4:19 AM David Verbeiren
> > wrote:
> > >
> > > Tests that when per-cpu hash map or LRU hash map elements are
On Tue, Oct 27, 2020 at 11:55 PM Andrii Nakryiko
wrote:
> Looks good, but would be good to have a unit test (see below). Maybe
> in a follow up.
Here is the associated new selftest, implementing the sequence you
proposed (thanks for that!), and also one for LRU case:
https://lore.kernel.org/bpf/2
-david.verbei...@tessares.net/
Change-Id: I38bc7b3744ed40704a7b2cc6efa179fb344c4bee
Suggested-by: Andrii Nakryiko
Signed-off-by: David Verbeiren
---
.../selftests/bpf/prog_tests/map_init.c | 204 ++
1 file changed, 204 insertions(+)
create mode 100644 tools/testing/selftests
pus remain whatever they were
when the re-used entry was previously freed.
Fixes: 6c9059817432 ("bpf: pre-allocate hash map elements")
Acked-by: Matthieu Baerts
Signed-off-by: David Verbeiren
---
Notes:
v2:
- Moved memset() to separate pcpu_init_value() function,
On Mon, Oct 26, 2020 at 11:48 PM Andrii Nakryiko
wrote:
>
> On Fri, Oct 23, 2020 at 8:48 AM David Verbeiren
> wrote:
> > [...]
> > + if (!onallcpus)
> > + for_each_possible_cpu(cpu)
> > +
other cpus remain whatever they were
when the re-used entry was previously freed.
Fixes: 6c9059817432 ("bpf: pre-allocate hash map elements")
Acked-by: Matthieu Baerts
Signed-off-by: David Verbeiren
---
kernel/bpf/hashtab.c | 12
1 file changed, 12 insertions(+)
diff --git a/