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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 28 May 2020 16:56:19 -0600
From:   David Ahern <dsahern@...il.com>
To:     Jesper Dangaard Brouer <brouer@...hat.com>,
        Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc:     David Ahern <dsahern@...nel.org>,
        Networking <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Toke Høiland-Jørgensen <toke@...hat.com>,
        Daniel Borkmann <daniel@...earbox.net>,
        john fastabend <john.fastabend@...il.com>,
        Alexei Starovoitov <ast@...nel.org>, Martin Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        Andrii Nakryiko <andriin@...com>
Subject: Re: [PATCH v2 bpf-next 5/5] selftest: Add tests for XDP programs in
 devmap entries

On 5/28/20 4:25 AM, Jesper Dangaard Brouer wrote:
> That said, you should use the new SEC(".maps") definitions, but you
> need to use some tricks to avoid a BTF-ID getting generated.  Let me
> help you with something that should work:
> 
> /* DEVMAP values */
> struct devmap_val {
> 	__u32 ifindex;   /* device index */
> };
> 
> struct {
> 	__uint(type, BPF_MAP_TYPE_DEVMAP);
> 	__uint(key_size, sizeof(u32));
> 	__uint(value_size, sizeof(struct devmap_val));
> 	__uint(max_entries, 4);
> } dm_ports SEC(".maps");
> 
> Notice by setting key_size and value_size, instead of the "__type",
> then a BTF-ID will be generated for this map.
> Normally with proper BTF it should look like:
> 
> struct {
> 	__uint(type, BPF_MAP_TYPE_DEVMAP);
> 	__type(key, u32);
> 	__type(value, struct devmap_val);
> 	__uint(max_entries, 4);
> } dm_ports_with_BTF SEC(".maps");
> 
> 

Thanks for the tip.

Powered by blists - more mailing lists