lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Oct 2019 09:20:51 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>
Cc:     Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>
Subject: Re: [PATCH v2 bpf-next 2/7] selftests/bpf: samples/bpf: split off
 legacy stuff from bpf_helpers.h

On Thu, Oct 3, 2019 at 12:35 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> Andrii Nakryiko <andriin@...com> writes:
>
> > diff --git a/samples/bpf/map_perf_test_kern.c b/samples/bpf/map_perf_test_kern.c
> > index 2b2ffb97018b..f47ee513cb7c 100644
> > --- a/samples/bpf/map_perf_test_kern.c
> > +++ b/samples/bpf/map_perf_test_kern.c
> > @@ -9,25 +9,26 @@
> >  #include <linux/version.h>
> >  #include <uapi/linux/bpf.h>
> >  #include "bpf_helpers.h"
> > +#include "bpf_legacy.h"
> >
> >  #define MAX_ENTRIES 1000
> >  #define MAX_NR_CPUS 1024
> >
> > -struct bpf_map_def SEC("maps") hash_map = {
> > +struct bpf_map_def_legacy SEC("maps") hash_map = {
> >       .type = BPF_MAP_TYPE_HASH,
> >       .key_size = sizeof(u32),
> >       .value_size = sizeof(long),
> >       .max_entries = MAX_ENTRIES,
> >  };
>
> Why switch these when they're not actually using any of the extra fields
> in map_def_legacy?

See below, they have to be uniform-sized.

> >
> > -struct bpf_map_def SEC("maps") lru_hash_map = {
> > +struct bpf_map_def_legacy SEC("maps") lru_hash_map = {
> >       .type = BPF_MAP_TYPE_LRU_HASH,
> >       .key_size = sizeof(u32),
> >       .value_size = sizeof(long),
> >       .max_entries = 10000,
> >  };
> >
> > -struct bpf_map_def SEC("maps") nocommon_lru_hash_map = {
> > +struct bpf_map_def_legacy SEC("maps") nocommon_lru_hash_map = {
> >       .type = BPF_MAP_TYPE_LRU_HASH,
> >       .key_size = sizeof(u32),
> >       .value_size = sizeof(long),
> > @@ -35,7 +36,7 @@ struct bpf_map_def SEC("maps") nocommon_lru_hash_map = {
> >       .map_flags = BPF_F_NO_COMMON_LRU,
> >  };
> >
> > -struct bpf_map_def SEC("maps") inner_lru_hash_map = {
> > +struct bpf_map_def_legacy SEC("maps") inner_lru_hash_map = {
> >       .type = BPF_MAP_TYPE_LRU_HASH,
> >       .key_size = sizeof(u32),
> >       .value_size = sizeof(long),
> > @@ -44,20 +45,20 @@ struct bpf_map_def SEC("maps") inner_lru_hash_map = {
> >       .numa_node = 0,
> >  };
>
> Or are you just switching everything because of this one?

Exactly. Another way would be to switch all but this to BTF-based one,
but I didn't want to make this patch set even bigger, we can always do
that later
.
>
>
> -Toke
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ